Requirements

  • Java 8
  • Maven

Installation

If you use Maven, place the following within the <dependencies> tag in your pom.xml file:

<dependency>
  <groupId>dev.panora</groupId>
  <artifactId>panora-sdk</artifactId>
  <version>0.0.1</version>
</dependency>

If you use Gradle, paste the next line inside the dependencies block of your build.gradle file:

implementation group: "dev.panora", name: "PanoraSDK", version: "0.0.1"

Authentication

To see whether an endpoint needs a specific type of authentication check the endpoint’s documentation.

Bearer Authentication

The PanoraSDK API uses bearer tokens as a form of authentication. You can set the bearer token when initializing the SDK through the constructor:

PanoraSDK sdk = new PanoraSDK("YOUR_BEARER_TOKEN");

Or through the setBearerToken method:

PanoraSDK sdk = new PanoraSDK();
sdk.setBearerToken("YOUR_BEARER_TOKEN");

List all connections to your app

package dev.panora.examples;

import dev.panora.PanoraSDK;
import dev.panora.exceptions.ApiException;

public class Main {

  public static void main(String[] args) {
    PanoraSDK client = new PanoraSDK(System.getenv("PANORASDK_BEARER_TOKEN"));
    try {
      Object response = client.connectionsService.getConnections();
      System.out.println(response);
    } catch (ApiException e) {
      e.printStackTrace();
    }
  }
}

This will list all the connections available, across all users. You should get an object similar to this one below. Read more about the connection object.

{
        "id_connection": "6cd057cb-39df-44ce-9be8-ax9d167c3940",
        "status": "valid",
        "provider_slug": "hubspot",
        "account_url": null,
        "token_type": "oauth",
        "access_token": "904570287538dddf72fd821e4d5cec51:66266ee62310752d4a243c12b133656edd5af42947a832f4439c710334e045e59782107d40e856c27e813b7a6ed068100376b3ff83d1c8237330ba034605dd846650524e6fcfb708e3f62b1401d8a0dc3d90022cdf9ad1c76fc9209f3a5d153f6e33bbb8f6642600a6c9a098e81fb1e2da0fdff0455b7823519fba195b5065b4319a314013e22f934c80e4f60bec4385989c92c2dd9036d19f720e85b10325c42dc8a035c363e279af0e4ab2c4cd016051c5b32bf6009bf0df0aa8565d048856",
        "refresh_token": "904570287538dddf72fd821e4d5cec51:58d9c1492b908caef83885b467d1ab1ea9fc6994a59ed4392edbb5365b89a02a8a4995347d8ec37037192a96856e2c24",
        "expiration_timestamp": "2023-12-20T18:44:44.869Z",
        "created_at": "2023-12-10T18:20:06.275Z",
        "id_project": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
        "id_linked_user": "d7a0af02-0f9b-40a6-86a9-612dcfe341fe"
}