Generate security tokens via public API

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.

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.

Method

API

GET

https://<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.

Name

Value Description

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.