Skip to main content

Authentication

You need authentication token to access Streams data and resources through the API

Generate authentication token

Make Post request to the below link with the credentials to generate an authentication token.

POST https://app.tpstreams.com/api/auth/login/

NameTypeDescription
usernamestringEmail address of the user
passwordstringPassword of the user
organization_idstringOrganization id

Sample code

import requests

url = "https://app.tpstreams.com/api/auth/login/"

payload = "{\n \"username\": \"hari@example.com\",\n \"password\": \"welcome\",\n \"organization_id\": \"auhf2k\"}"
headers = {
'content-type': "application/json",
'cache-control': "no-cache",
}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

Response

The response will return an token which should be prefixed with Token and included in all API requests to the server in a header that looks like the following:

Authorization: Token auth-token-string