Authorization
Authenticate the requests to Unified APIs
Overview
When making requests to the Integrate API, you will need to pass proper authentication parameters so that you can identify yourself as an authorized user.
There are two primary authentication methods as mentioned below:
- BrowserStack Integrate API Key
- User access tokens
The credentials you retrieve from any of the authetication method, they need to be included in the headers for every request you send to the Integrate API.
Below are details of both the authetication methods:
BrowserStack API key
API Keys
# HTTP basic authentication syntax using cURL
username= YOUR_USERNAME
access_key= YOUR_ACCESS_KEY
For any request you make when communicating with the API, you will need API key to authenticate yourself as an authorized user.
Do not share or include your API keys on the client side code. Please ensure to keep them 100% secure and be sure to not share your secret API keys in areas that are publicly accessible.
User access tokens
Fetch user access token
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://integrate.browserstack.com/api/user-access-tokens?unique_user_id=<user_id>"
{
"success": true,
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM4MjQ1NzYsImRhdGEiOnsidXNlciI6eyJncm91cElkIjoyLCJleHRlcm5hbFVzZXJJZCI6IjM2MDMzOTIifX0sImlhdCI6MTY4MzgyMzY3Nn0.G3lRirK8FkrJtAecbST5iPTf_amep7EOsmzs2avFhxY",
"expires_at": 1683824576
}
When sending requests to the API regarding your end users’ data, you’ll only be authorized to access that data if you’ve successfully stored the access_token
for use with these requests.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.