Discussions

Ask a Question
Back to All

I am not able to understand , What value should i put in authentication Bearer token .

I am using api to create animation , But u need to require disparity url to do it . But if I want to get url in animation I need to give some Authorisation bearer token in rght hand side box .What token should I provide in that box for authentication . I have already provided id, secret , access token . But simply that was not working

import requests

url = "https://api.leiapix.com/api/v1/disparity"

payload = {
"inputImageUrl": "https://res.cloudinary.com/dv31jevup/image/upload/v1713788468/samples/woman-on-a-football-field.jpg",
"resultPresignedUrl": "https://res.cloudinary.com/dv31jevup/image/upload/v1713788468/samples/woman-on-a-football-field.jpg",
"correlationId": "4f444d1a-c866-49fa-a540-edcb39c4fdef",
"dilation": 0.01,
"inputType": "image2d",
"outputBitDepth": "uint8"
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer Bearer jeyJleHAiOjE3MTM3ODQzMDMsImlhdCI6MTcxMzc4MzQwMywianRpIoiMDU0OTA3NGUtYTQ2Ny00YjlmLWIxNDQtNzQ4NjhkMTlmOTdjIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmxlaWFsb2Z0LmNvbS9hdXRoL3JlYWxtcy9sZWlhbG9mdCIsInN1YiI6IjQ4MmMyODdjLTBiYjgtNDcyYi04NzZkLWM5ZjMxMDM0YTg1MCIsInR5cCI6IkJlYXJlciIsImF6cCI6IjIwNTY0YjlkLWFlZGItNDlkYy1iMTM2LTNjOWIxNTI2ZjMwYSIsImFjciI6IjEiLCJzY29wZSI6ImxlaWEtYXBpLWdhdGV3YXkiLCJjbGllbnRJZCI6IjIwNTY0YjlkLWFlZGItNDlkYy1iMTM2LTNjOWIxNTI2ZjMwYSIsImNsaWVudC1vd25lci11c2VyLWlkIjoiMTIxNTYyM2UtYTE2ZS00YjUxLTlkNTMtMDUxZWZiYzU1NWVhIiwiY2xpZW50SG9zdCI6IjQ0LjIzMy4xNTEuMjciLCJjbGllbnRBZGRyZXNzIjoiNDQuMjMzLjE1MS4yNyJ9"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)