Skip to main content

Overview

Generate Temporary Token - API Request

Overview

The partner server sends a request to the Nuclei server to generate a temporary token, enabling seamless login.

EndPoint:

Method: POST

Headers: Content-Type: application/json

Request Body

{
"payload": "AES encryption of (<cif of user>|<deviceIdentifier>|<timestamp in long>|<CountryCode in integer>)",
"partner_key": "<SDK-PARTNER-KEY-GOES-HERE>"
}

CIF means customer information file which is a common identifier between partner and nuclei. The common format of cif is a unique identifier from partner appended by country code. Ex: IN9956304876

Parameters

  • payload: AES-encrypted string containing <cif of user>|<deviceIdentifier>|<timestamp in long>|<CountryCode in integer>.
  • partner_key: The SDK partner key associated with the partner app.

Sample Response

{
"token": "<token>",
"timestamp": 1234567890
}

Response Parameters

  • token: The temporary token generated by the Nuclei server.
  • timestamp: The timestamp extracted from the initial request payload.

Errors and Resolutions

412 Errors

  • Invalid payload: <payload>
    Description: Payload should be in format <cif of user>|<deviceIdentifier>|<timestamp in long>|<country code in integer>
    Resolution: Verify that the payload is created correctly: AES encrypted <cif of user>|<deviceIdentifier>|<timestamp in long>|<country code in integer>

  • Invalid payload: <payload>
    Description: Payload does not have sufficient information
    Resolution: Ensure all three parameters (cif, deviceIdentifier, timestamp) are provided. If the user is international, the fourth parameter (country code) should also be included.

  • Country code is not a valid number
    Resolution: Verify that the country code provided in the payload is an integer and a valid country code.

404 Errors

  • Partner not found for partner key: <partner-key>
    Resolution: Verify that the partner key sent in the request is correct.

  • Country not found for country code: <country code>
    Resolution: Ensure that the entered country code is an integer and a valid country code.