GithubHelp home page GithubHelp logo

epilot-dev / sdk-java Goto Github PK

View Code? Open in Web Editor NEW
2.0 10.0 0.0 528 KB

Java SDK for Epilot APIs

Home Page: https://docs.epilot.io/docs/intro

License: Apache License 2.0

Java 100.00%
ecommerce energy java sdk epilot energy-platform energy-transition

sdk-java's Introduction

Epilot Java SDK

Epilot is the digital foundation for sales, service, network and implementation processes in the context of the energy transition. This SDK is for the Epilot Journey, Entity and Automation APIs. Please see the Epilot developer documentation for more information.

SDK Installation

Gradle

implementation 'dev.epilot.sdk:epilot-sdk-java:1.5.2'

Authentication

To call epilot APIs, requests must be authorized using a valid Access Token.

Using Access Token Authorization

The access token should be passed in the Authorization request header.

Authorization: Bearer <your-access-token>

Creating Access Tokens

Users logged into the epilot 360 portal can manage their Access Tokens from Settings > Access Tokens.

Creating access tokens requires the token:create permission.

Access Token API Authenticated users can generate long-term access tokens for 3rd party applications using the epilot Access Token API createAccessToken operation.

POST /v1/access-tokens
{
  "name": "Token for my application"
}

Optionally, you can pass a list of Role IDs, to define the roles the access token will have access to. By default, the access token inherits the caller's roles.

POST /v1/access-tokens
{
  "name": "Postman Access Token",
  "assume_roles": ["123:owner"]
}

Each Access Token generated via the API gets a generated a unique ID.

// 201 - success
{
  "id": "api_5ZugdRXasLfWBypHi93Fk",
  "created_at": "2019-08-24T14:15:22Z",
  "name": "Postman Access Token",
  "assignments": ["123:owner"]
}

Access tokens may also be revoked using the revokeAccessToken operation

DELETE /v1/access-tokens/api_5ZugdRXasLfWBypHi93Fk
// 200 - success
{
  "id": "api_5ZugdRXasLfWBypHi93Fk",
  "created_at": "2019-08-24T14:15:22Z",
  "name": "Postman Access Token",
  "assignments": ["123:owner"]
}

SDK Example Usage

package hello.world;

import dev.epilot.sdk.EpilotAPI;
import dev.epilot.sdk.models.shared.Security;

public class Application {
    public static void main(String[] args) {
        try {
            EpilotAPI.Builder builder = EpilotAPI.builder();

            builder.setSecurity(
                new Security() {{
                    epilotAuth = new SchemeEpilotAuth() {{
                        authorization = "Bearer YOUR_BEARER_TOKEN_HERE";
                    }};
                }}
            );

            EpilotAPI sdk = builder.build();

            AttachActivityRequest req = new AttachActivityRequest() {{
                pathParams = new AttachActivityPathParams() {{
                    id = "unde";
                }};
                queryParams = new AttachActivityQueryParams() {{
                    entities = new String[]{{
                        add("porro"),
                        add("nulla"),
                        add("id"),
                    }};
                }};
            }};

            AttachActivityResponse res = sdk.activity.attachActivity(req);

            if (res.activityItem.isPresent()) {
                // handle response
            }
        } catch (Exception e) {
            // handle exception
        }

SDK Available Operations

activity

  • attachActivity - attachActivity
  • createActivity - createActivity
  • getActivity - getActivity
  • getEntityActivityFeed - getEntityActivityFeed

entities

  • autocomplete - autocomplete
  • createEntity - createEntity
  • deleteEntity - deleteEntity
  • getEntity - getEntity
  • searchEntities - searchEntities
  • updateEntity - updateEntity
  • upsertEntity - upsertEntity

export

  • exportEntities - exportEntities
  • importEntities - importEntities

journeys

  • createJourney - createJourney
  • getJourney - getJourney
  • getJourneysByOrgId - getJourneysByOrgId
  • patchUpdateJourney - patchUpdateJourney
  • removeJourney - removeJourney
  • searchJourneys - searchJourneys
  • updateJourney - updateJourney

relations

  • addRelations - addRelations
  • deleteRelation - deleteRelation
  • getRelations - getRelations
  • updateRelation - updateRelation

savedViews

  • createSavedView - createSavedView
  • deleteSavedView - deleteSavedView
  • getSavedView - getSavedView
  • listSavedViews - listSavedViews
  • updateSavedView - updateSavedView

schemas

  • createNewSchemaVersion - createNewSchemaVersion
  • deleteSchemaById - deleteSchemaById
  • getSchema - getSchema
  • getSchemaVersions - getSchemaVersions
  • listSchemaBlueprints - listSchemaBlueprints
  • listSchemas - listSchemas
  • listTaxonomyClassificationsForSchema - listTaxonomyClassificationsForSchema

taxonomy

  • getTaxonomy - getTaxonomy
  • listTaxonomies - listTaxonomies
  • taxonomiesClassificationsSearch - taxonomiesClassificationsSearch
  • taxonomyAutocomplete - taxonomyAutocomplete
  • updateClassificationsForTaxonomy - updateClassificationsForTaxonomy

executions

  • cancelExecution - cancelExecution
  • getExecution - getExecution
  • getExecutions - getExecutions
  • retriggerAction - retriggerAction
  • startExecution - startExecution

flows

  • createFlow - createFlow
  • deleteFlow - deleteFlow
  • getFlow - getFlow
  • putFlow - putFlow
  • searchFlows - searchFlows

SDK Generated by Speakeasy

sdk-java's People

Contributors

github-actions[bot] avatar simplesagar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.