Partners can call editor URL with their Tokens passing it to the query parameter instead of passing apiKey directly .
The tokens can be generated via the below APIs.
First, you need to generate token, In the body, you can pass multiple param and value which you were passing as a query parameter
Generate token endpoint
POST :
...
Requesting a Token
Once you have an access key, you can request a token using the token REST API. A typical request includes these elements:
URL
HTTP Header:
here x-api-key
will be key to specific customer
...
Content-type:application/json |
...
|
...
Body :
Code Block |
---|
{
"auth" : "apiKey",
"file" : "filePath",
"userId" : "userId",
"server": "serverId",
"param": "value"
} |
Result :
On successful, it will give 200 status code
...
"<Access Key>" |
The parameters in the HTTP header are described in this table.
Parameter | Description |
---|---|
x-api-key | The access key ID for which you want to generate a token. its unique for each partner |
Request Body
The request body contains all URL parameters as JSON body
{ |
Expand | ||
---|---|---|
| ||
The file id is the just name of the file in S3. User id should be the real user id in production but can be any arbitrary id for testing. |
Response
If successful, the service will return a 200 status code with the token and expiration time.
status: 200 Ok |
...
|
...
1595917409 |
On error, it the service will give return a 403 error code like below
...
with a descriptive error message.
status: |
...
403 |
...
Validate token and get all param and valued stored for that token
To validate the token, we have another endpoint API, in which you have to pass token on header. on success , it will return all param and values stored for that token
GET:
...
Forbidden |
...
|
Token validation
You can optionally validate a token with the verification endpoint
URL
HTTP Header :
...
Content-type:application/json |
...
|
...
Result :
Code Block |
---|
Status: 200 OK
{
"auth" : "apiKey",
"file" : "filePath",
"userId" : "userId",
"server": "serverId",
"param": "value"
} |
On error, it will give 403 error code like below
...
token |
The parameters in the HTTP header are described in this table.
Parameter | Description |
---|---|
x-api-token | token generated using |
Response
If successful, the service will return a 200 status code with all URL parameters which is passed using /generate
endpoint
Status: 200 OK |
On error, the service will return a 403 error code with a descriptive error message.
status: 403 Forbidden |