Quick Start
  • 08 Jul 2022
  • 1 Minute to read
  • Dark
    Light

Quick Start

  • Dark
    Light

Article summary

Introduction

To call Partner API, you need to call OAuth services to obtain a token used for the authentication first. This article shows the steps to call the API for obtaining the Partner account's platforms.

Step By Step Instructions

  1. Getting Access Token
  2. Calling Partner API

Getting Access Token

Parameter

Client_ Id: ID of OAuth Client created in partner system.
Email: Email of Partner account.
Password: The password corresponding to the partner account.

Example

Sample Request:

curl https://partner.comm100.io/oauth/token  \
-H 'Content-Type:x-www-form-urlencoded'  \
-X 'POST'  \
-D 'client_id=client1&grant_type=password&email=client1@company.com&password=******'

Response

HTTP/1.1 200 OK
Content-Type:  application/json
{
    "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6ImF0K2p3dCJ9.eyJuYmYiOjE2NTI5MzkzOTEsImV4cCI6MTY1Mjk4MjU5MSwiaXNzIjoiaHR0cDovL2ludGVybmFscGFydG5lci50ZXN0aW5nLmNvbW0xMDBkZXYuaW8iLCJhdWQiOiJpZHMucmVzb3VyY2UuMSIsImNsaWVudF9pZCI6ImRhdGFzeW5jIDEwMDAwIiwic3ViIjoiYmZlYjQ1ZDctNTBkYy00MTZkLWIzYzgtMzVkYjY0ZDI4OGYzIiwiYXV0aF90aW1lIjoxNjUyOTM5MzkxLCJpZHAiOiJsb2NhbCIsInVzZXJJZCI6ImJmZWI0NWQ3LTUwZGMtNDE2ZC1iM2M4LTM1ZGI2NGQyODhmMyIsInBhcnRuZXJJZCI6IjEwMDAwIiwidGh1bWJwcmludCI6Ijk2MTY2Q0EzQjM0QUJGMkQwNERGOTZBMDE1QkJEREQwOUIwQTdDNTkiLCJzdWNjZXNzIjoiVHJ1ZSIsInJvbGUiOiJVc2VyIiwianRpIjoiODVFNzUzQTYwRDY4MzI4MjlEMkU4MDEwNUU3NTAwNjIiLCJpYXQiOjE2NTI5MzkzOTEsInNjb3BlIjpbImlkcy5zY29wZSIsIm9wZW5pZCIsInByb2ZpbGUiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsicHdkIl19.ADZQq2R3-zJl_Bg9jOUREvrXvvmLc669iZSUZhU6oRmd6vu1UXU8VkXgxQZSk4pFxCW7j2UGuDi0jTF27e5W4PzyGWmE-qj9gE-iY9b7PSOPwYENS8rylFwB3dL7f_qlQCbzQ2kUoCoAlIPLqVbQHN76ftMoo57Ge9rg0xOw-BJT4GBKiflgE6dz8ikQhlg7_DAM-JY51Vk7bmsvny356P5Rv5cdJnBvrCCqAJeV-Y5jzUblAKx61HSZE9gBoRhYOprYgK37pw3XMqG9H5BvCr32DSufA0U91rA1sOX945yNLrYAAsDHlMO2-nmEHgOMFrnIOvzsgjnMktcxkR0NQG",
    "expires_in": 43200,
    "token_type": "Bearer",
    "refresh_token": "F13741023427FFB7404FDE64EF485D858721D88A488763592B08CF303E721BE0",
    "scope": "comm100 offline_access"
}

Calling Partner API

Use the access token obtained in the previous step to call the interface for obtaining the platforms available to a Partner account.

Example

Sample Request:

curl https://partnerapi.comm100.io/v4/global/platforms \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

[
  {
      "id": 100,
      "name": "US"
  }
] 

Was this article helpful?

What's Next