Skip to content

epilot-dev/sdk-java

Repository files navigation

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