I want to make a python query for API Authentication token but am not getting any response.
The curl request on the website is like this
curl -X "POST" "https://integrations.apptopia.com/api/login" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "client=<client>" \
--data-urlencode "secret=<secret>"
where credentials are like this
client: XXXXXXXXXX
secret: XXXXXXXXXXXXXXXX
I want a python query for this to get JSON Token
I have tried following :
import requests
url = "https://integrations.apptopia.com/api/login"
payload = {
'client': "XXXXXXXXXXXXX",
'secret': "XXXXXXXXXXXXXXXXXXX"
}
headers = {
'Content-Type': "application/x-www-form-urlencoded"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
But I am getting no response from this code. Please help me out.