migueldevora | Posts: 1

i cant access to the api

0 votes

no postman, no python , no this site OneSpan Sign Sandbox | OneSpan Community Platform

 

curl -X 'GET' \ 'https://sandbox.esignlive.com/api/packages' \ -H 'accept: application/json; esl-api-version=11' \ -H 'Authorization: Basic 687964726146a69190ad25d90b98401e16986a4d75f62c77a880bc8bbfa09e3fc7be4da580'


Approved Answer
Duo_Liang | Posts: 3776

Reply to: i cant access to the api

1 votes

Hi migueldevora,

 

Thanks for your post!

The credentials you are using (687964726146a69190ad25d90b98401e16986a4d75f62c77a880bc8bbfa09e3fc7be4da580) looks like API Client Secret to me, please use API Client ID + Secret to retrieve an access token first, then use the access token as the bearer header:

Step1:

HTTP Request

POST /apitoken/clientApp/accessToken

HTTP Headers

Accept: application/json

Content-Type: application/json

Request Payload

{ "clientId": "your_client_id", "secret": "your_client_secret", "type": "OWNER" }

The available options for the field “type” are “OWNER” and “SENDER”. If the latter, “email” field is required:

{ "clientId": " your_client_id ", "secret": " your_client_secret ", "type": "SENDER", "email": "sender_email" }

By specifying the type and the email, it determines who the authorized user is when the temporary access token is used later to make API requests.

Example Response

{ "accessToken": "17270a2f8960e84937478a60013404", "expiresAt": 1591029428203 }

 

Step2:

GET /api/packages

Authorization: Bearer {access_token}

Accept: application/json; esl-api-version=11

 

Duo

 


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off