Authentication API

Papaya Global ensures the secure authentication of requests by employing an API key and Client ID. It is crucial to avoid sharing these credentials in publicly accessible areas like GitHub or client-side code. A bearer token is necessary to authenticate all API requests. All API requests must be made over HTTPS, as requests made over plain HTTP will not be successful. Moreover, any API requests made without proper authentication will also fail. It is important to note that the sandbox and production environments have separate keys and client IDs.Used for authenticating with Papaya Global servers.

Obtain Access Token

To acquire an access token, include your api_key and client_secret in the HTTP request header (Will be provided to you by the integration support). This token is essential for making calls to any other API endpoints, and the HTTP header must contain Authorization: Bearer [token]. The access token remains valid for 24 hours and can be utilized multiple times for all other API endpoints until it expires. It is advisable to rely on the expiration time provided (valid_until) in the response for a precise token expiration time.

POST /token

Body Parameters Request

NameTypeDescription

api_key

string

This is a unique identifier used to authenticate the client making the request (Will be provided to you by the integration support).

client_secret

string

This is a secret key associated with the API key. It acts as a password to provide an additional layer of security (Will be provided to you by the integration support).

expiration

numeric

This field specifies the time-to-live (TTL) for the token in seconds. If the field is not provided, the default 24-hour (86400 seconds) TTL will be used.

token_name

string

This field specifies a name for the token being created. If provided, this name will be assigned to the token. If not provided, a new random UUID will be used as the token name

Body parameters Response

NameTypeDescription

valid_until

ISO 8601 date-time format

This field indicates the expiration date and time of the token.

token

JWT

This field contains the JWT itself.

token_name

string

This field specifies the name of the token being created.

Request Example

POST /token

{
   "api_key": "82725488-22bf-40d1-ace6-9ea6ee42f870",
   "client_secret": "MySecret!!!",
   "expiration": 100001,
   "token_name": "82725488-22bf"
}

Response

{
   "valid_until": "2024-07-11T07:48Z",
   "token": "eyJ0eXAiOiJKV1QiLCJraWQiOiJBUElLRVkwIiwiYXBpX3Rva2VuX2lkIjoiYjZmMzhhN2QtMDc4MS00OGIyLWFhMTEtODUzMzA5NjEyNWFiIiwiYWxnIjoiUlMyNTYifQ.eyJpYXQiOjE3MjA1OTc3MTEsImV4cCI6MTcyMDY4NDExMSwic3ViIjoiYWNjZXNzIiwidXNlciI6eyJpZCI6IjgyNzI1NDg4LTIyYmYtNDBkMS1hY2U2LTllYTZlZTQyZjg3MCIsImVtYWlsIjoiZXlhbDEubmV0QGdtYWlsLmNvbSIsIm93bmVyIjp7ImlkIjoiMjAxMDAwIiwib3duZXJUeXBlIjoib3JnX2lkIn19fQ.gLmL4am5bro27H_ICzLT2OMxnh7MtyuenND9yR1J_jmZyxcnB_XbN1hTXLsqU4l-73UWLNWB9eMseFLVEVSx0z-XtDtDyPvwWHsicxTwC-PmZrhg1EvQRrRgEzUk5D-wJNqXRnfP5CNS78pPo6ZRHwW7N1t1fpop48gKnPdtyOt5m0w0apOyzgLPOWwsTHMKw8qCe5e5d6IumjKpxxeJUcgpzffEibUmaqGL9PFAS5Yky0ABFe37VFwdgj89muLW5RdaOz3HvYiZYLdtH91SIJYKhWMME38_xWSFb8wxoHZsRH3taBdyBUuU5zE8J7wfYQYsm_iA1BMlNZ9d73R71g"
   "token_name": "82725488-22bf"
}

Last updated

© All rights reserved to papaya global 2024