Signup For A Live Demo Now!!

Signup For A Live Demo Now!!

API

Authentication methods

This section will help developers to authenticate and start making API calls using the Zenscale REST API.


Zenscale OAuth 2.0 Authentication

To start using Zenscale APIs You need to enable API Key Access in your Zenscale Account using below steps.

*you need to login using your company's primary user to complete below steps.

 Login to api.zenscale.in > Go To Company Profile > API Tab > Enable API Key Access.

Once that is in place, you'll have to allow one of your zenscale user for Developer Access using below steps:

 Login to api.zenscale.in > Go To Add User > Enable Developer Access.

Now you can access APIs using this Developer Account


For obtaining access/bearer tokens, we support Password Grant Client of RFC-6749's grant flows

Get Access Token

Once you have enable API Key Access you may request an {access_token} by issueing POST request to /oauth2/login endpoint
If the request is successful, you will receive an access_token and refresh_token in the JSON response from the server. Below is the example of Access Token / Login API with cURL.

curl --location --request POST 'https://api.zenscale.in/resource/api/oauth2/login' \
--header 'Content-Type: application/json' \
--form 'company_code={company_code}' \
--form 'username={username}' \
--form 'password={password}'


Get Refresh Token

Our {access_tokens} expire in 15 minutes. When this happens you'll get 401 response.

now, you need to call below api to get new {access_token} for next 15 minutes. Remember, our {refresh_token} would be active for 30 minutes, that means after 15 minutes of {access_token}'s Expiration you can get new {access_token}.

curl --location --request POST 'https://api.zenscale.in/resource/api/oauth2/refresh_token' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--form 'refresh_token={refresh_token}'
                


Start Accessing APIs

Below is base url for accessing all of Zenscale APIs
  https://api.zenscale.in/resource/api/v1  
When you start calling APIsappend the api endpoint with base url and then pass Header Variables

'Content-Type: application/json', 
'Authorization: Bearer {access_token}'

now you need to pass parameters as body part of your request.

API Response

each of Zenscale API's response body will contain below three index
  {'type':'','message':'','data':[]} 
a) 'type' could be success / error/ warning.
b) 'message' This index will contain message regardig response.
b) 'data' This index will be usually of array which will contain list of data objects.