Sending Your First Syncari Embed Request

Varsha Neelesh
Varsha Neelesh
  • Updated

This topic, will walk you through to making your first requests to the Syncari Embed APIs. First, a request will be made to the OAuth/token endpoint to get the access token. Using this token, another request will be made to get a list of users in Syncari.

Step 1: Find Your API Credentials

API credentials are needed to get an access token. If they are unavailable, please refer API Credentials to get them.

Step 2: Get an Access Token

Create a POST request to the OAuth/token endpoint that includes the API credentials (Client ID and Client Secret) in the header. See the example request below or see Authentication for detailed steps.

curl --location --request POST 'https://api.syncari.com/api/v1/oauth/token?grant_type=client_credentials&client_id=<Syncari Client ID>&client_secret=<Syncari Client Secret>' --header 'Content-Type: application/x-www-form-urlencoded'

Step 3: Make an API Request

Let's start with a simple GET request for the first API call. Unless the Syncari instance is entirely empty, there should be Synapses connected. The first call will get a list of the synapses in the requisite instance.

Create an HTTP request to the synapses endpoint and include the access_token that was received in the response to the POST oauth/token call made in the previous step. See the example (access token will be longer than you see here).

Example Request

curl --location --request GET 'https://api.syncari.com/api/v1/synapses' --header 'Authorization: Bearer eyJ0eXAiOiJKV1...'

A successful request will respond with lists all of the synapses in the instance.

Example Response

{
   "success": true,
   "requestId": "1978486042",
   "timestamp": "2023-01-23T20:20:10.314830Z",
   "result": [
      {
         "id": "6196b0e2a5adb2000196f4b5",
         "name": "Hubspot",
         "createdBy": "5fd79c1a0753fa0001035ba4",
         "createdAt": "2021-11-18T20:00:34.390+00:00",
         "updatedBy": "62db156e3358d4e49092551d",
         "updatedAt": "2022-12-20T19:24:32.184+00:00",
         "synapseTypeId": "5e11526a7df51d4f9f0f625c",
         "status": "ERROR",
         "refreshSchemaStatus": "NEW",
         "configuration": {
            "accessToken": "*****",
            "refreshToken": "*****",
            "clientId": "*****",
            "clientSecret": "*****",
            "oAuthRedirectUrl": "https://app.syncari.com/oauth/authorize?client_id=xxxx-xxxx-xxxxx-xxxxx",
            "portalId": "20499581",
            "authType": "Oauth"
         }
      },
      {
         "id": "6196b84a4f1718000198345d",
         "name": "JIRA Service Desk",
         "createdBy": "5fd79c1a0753fa0001035ba4",
         "createdAt": "2021-11-18T20:32:10.218+00:00",
         "updatedBy": "5f85e300931b05000143e41a",
         "updatedAt": "2021-11-18T20:44:00.845+00:00",
         "synapseTypeId": "5f8899a97df51d7c31d15570",
         "status": "ACTIVE",
         "refreshSchemaStatus": "SUCCESS",
         "configuration": {
            "userName": "someone@syncari.com",
            "accessToken": "*****",
            "endpoint": "https://someone.atlassian.net",
            "serviceDeskId": "1",
            "notifyUsers": "false",
            "authType": "ApiKey"
         }
      },
      {
         "id": "6196b2734f17180001980c06",
        "name": "Salesforce",
         "createdBy": "5fd79c1a0753fa0001035ba4",
         "createdAt": "2021-11-18T20:07:15.194+00:00",
         "updatedBy": "6328aab72e826d000195271d",
         "updatedAt": "2022-10-27T16:34:50.200+00:00",
         "synapseTypeId": "5e11526a7df51d4f9f0f625b",
         "status": "INACTIVE",
         "refreshSchemaStatus": "NEW",
         "configuration": {
            "userName": "somename",
            "password": "*****",
            "token": "*****",
            "endpoint": "https://someone.my.salesforce.com",
            "authType": "UserPasswordToken"
         }
      }
   ]
}
Share this

Was this article helpful?

0 out of 0 found this helpful