Session URL API Contract

POST


Maya Mini App partner shall create this endpoint following the API contract below. This endpoint should also use POST method.

What Maya expects from your Session URL during session initiation:

  • Your Session URL should be able to receive the API request from the Maya Mini App
  • Your Session URL should be able to generate a unique sessionId for each API request. This sessionId should for one-time use only
  • Your Session URL should be able to acknowledge the API request from the Maya Mini App by responding with sessionId
    Before executing any complex logic that may cause a timeout, your session URL should promptly respond with sessionId in a successful status code (2xx). Implementing this approach would benefit your customer's rendering duration and redirection speed to your landing page.

  • Your Session URL should save the token details (such as the accessToken, refreshToken, expiryAt, etc.) received from Maya Mini App

Technical Guide:


Request Payload to Receive

Request Header

AttributeTypeFormatDescription
Content-Type REQUIREDstringapplication/jsonSpecifies the media type of the request
Request-Reference-No REQUIREDstringUUIDv4Unique reference identifier for tracking the request

Request Body

AttributeTypeFormatDescription
accessToken REQUIREDstringJWEThe customer access token; Your application should store this securely while also considering the expiration
refreshToken REQUIREDstringJWTToken for getting a new access token; Your application should store this securely while also considering the expiration
expiresAt REQUIREDintegerTimestamp of the session expiration, in seconds since the epoch (UNIX timestamp)

Response Payload to Return

Response Body

AttributeTypeFormatDescription
sessionId REQUIREDstringAN(255)Must be URL-safe and must be valid for one-time use only.

Recommended: UUIDv4 format.