Authentication Endpoint – /app/authenticate
Authenticate an application's Svrf API Key to retrieve an access token to the Svrf API.
Parameters
| Parameter | Type | Description |
|---|---|---|
| apiKey | string | Your application's API key. |
Response
The application was successfully authenticated and an Application Token was returned to be used in subsequent requests as the x-app-token header. The expiresIn field denotes how many seconds this token will be valid for.
| Key | Type | Description |
|---|---|---|
| success | boolean | If the request was successful. |
| message | string | An error message if the request fails. |
| token | string | Token to be used in the x-app-token header to access authenticated routes. |
| expiresIn | integer | How many seconds this token will be valid for. |
Examples
cURLcurl --request POST \--url https://api.svrf.com/v1/app/authenticate \--header 'accept: application/json' \--header 'content-type: application/json' \--data '{"apiKey":"YOUR_API_KEY"}'
Node.jsvar request = require("request");var options = {method: 'POST',url: 'https://api.svrf.com/v1/app/authenticate',headers: {accept: 'application/json', 'content-type': 'application/json'},body: '{"apiKey":"YOUR_API_KEY"}'};request(options, function (error, response, body) {if (error) throw new Error(error);console.log(body);});