How to Get User Token using API

Modified on Sun, Jun 14 at 1:53 PM

Overview

This API retrieves a user token by validating the user's email address and password. The returned user token is required to authenticate subsequent TestGrid API requests.


Endpoint

URL - https://{your_base_url}.testgrid.io/api/get-usertoken

Method - POST

Request Parameters

ParameterTypeRequiredDescription
emailStringYesRegistered user email address
passwordStringYesUser account password

Example Request


curl --location 'https://{your_base_url}.testgrid.io/api/get-usertoken' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'email=USER_EMAIL' \
--data-urlencode 'password=USER_PASSWORD'


Success Response


{
"success": true,
"message": "User Token Fetched.",
"user_id": "21",
"email": "user@testgrid.io",
"user_token": "********"
}


Failure Response

{

  "success": false,

  "message": "Email and/or password does not match!"

}


Outcome

A valid user token is generated and can be used to authenticate future API requests.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article