Recipes
🦉
NinjaEdge
Open Recipe

Request

Header

NameDescriptionExampleRequired
x-api-keyA unique key issued during onboarding6rprzP8q6b7ulYcLsKz2Yes
Content-TypeThe type of the content. By default, 'application/json'application/jsonNo

Body

The endpoint supports the generation of different tokens.

KeyDescriptionExampleRequired
consumer_idRequired for widget_token generation
A unique identifier of the consumer. Preferably prefixed with an abbreviation of your business name.
CN233433552No
product_request_idRequired for embedded_report_token generation
A unique identifier of the product request. Provided by NinjaEdge in a webhook or over API.
IBV420CE406A15E1EBF3B43No
typeType of token that will be generated. widget_token or embedded_report_token
widget_token by default
widget_tokenNo

consumer_id (string)

Response

a) Access Token Issued - HTTP 200

NameDescriptionExampleType
access_tokenA valid access tokeneyJhbGciOiJIUzI1NiJ9String
expires_in The length of time in seconds that the access token is valid for.
The default is one hour (3600).
3600 String
messageThe details of the failureInvalid credentialsString

b) Bad Request - HTTP 400

NameDescriptionExampleType
messageThe details of the failureInvalid credentialsString
fieldsDetailed error description specified by field{...}Object

c) Unauthorized - HTTP 401

NameDescriptionExampleType
errorThe details of the failureInvalid credentialsString

Examples for status code

{  
  "access_token": "eyJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfaWQiOiI1NWUwNmNjMmFhMzVjZWI1ZmE1OSIsImNvbnN1bWVyX2lk  
IjoiZGVtbzEyMzQifQ.lnICYcqNx3Ia5WqfifX_orvnyKW8vNjeltSnYRNvwGA",  
  "expires_in": 3600  
}
{
    "message": "Validation error",
    "fields": {
        "product_request_id": [
            "is required for generation of embedded report token"
        ]
    }
}
{
    "error": "Invalid token"
}
Language
Authorization
http
Click Try It! to start a request and see the response here!