0

I'm trying to retrive some data from apptopia but I'm finding it pretty tricky (due to my lack of experience). In their authentication page: https://dev.apptopia.com/#authentication there are some instructions, but I just can't make it work.

I need a client and a secret (these bellow are not mine but the ones on the company's site)

client: JFqXPDhiLuvY
secret: L2nerprCksacBoFzUqtfHz8v

And I must use those information in order to obtain a Session token via HTTPS POST request:

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>"

I just don't know how to do it. I tried using the answen on this post: Python Request Post with param data but it didn't work. Could someone help me please? Thanks!

2
  • 1
    It doesn’t work” isn’t particularly helpful. What error messages are you seeing? What is the expected behavior of the code you’ve written here, and what did you observe it do in actuality? How to Ask Commented Sep 22, 2021 at 18:13
  • I'm really sorry about that, I should have added more details. I get a <Response [401]> error. The expected behavior should be a JSON token, as can be seen here: dev.apptopia.com/#authentication Commented Sep 22, 2021 at 18:23

1 Answer 1

1

Did you try passing credentials as data in your request?

import requests

headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = {
    'client':your_client,
    'secret':your_secret'
}

response = requests.post('https://integrations.apptopia.com/api/login', headers=headers, data=data)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.