Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Jan 30, 2020 13:27

In addition to generating a security token through the Perfecto UI, you can generate a token using an HTTP-based API, by supplying your Perfecto username and password credentials.

When using this API, note that:

  • The generated token invalidates any existing token registered for this user.
  • The API does not accept an existing token as the password for the user. Only the username and password assigned for Perfecto Lab access are accepted as parameters.

To use the generated token in API calls, you need to include it in the header. For details, see Smart Reporting Public API > Headers.

On this page:

Note: For security reasons, there is no API to validate the security token. However, you can validate a token manually via the Perfecto UI (click your username at the top right and select My security token to view the existing token).

Request

Use the following HTTP GET command to generate a new security token for the user.

MethodAPI
GEThttps://<lab-name>.app.perfectomobile.com/users/api/v1/auth/tokens?username=<username>&password=<password>

Where: <lab-name> is the name of the Perfecto Lab, for example demo in "demo.app.perfectomobile.com"

Parameters

The following URL query parameters are mandatory for the request.

NameValueDescription
user<username>The Perfecto Lab username for the user
password<password>The Perfecto Lab password (not token) for the user

Note: This API is not supported for externally authenticated accounts.

Response

The response is the security token. A successful response has the following format:

eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJhZGJh...cfRSv7ttCLIWQbShDjWcr4wvdA