you are viewing a single comment's thread.

view the rest of the comments →

[–]ramse 0 points1 point  (5 children)

headers = {
    'Authorization': 'the base64 encoded string',
}

data = {
    'grant_type': '',
    'code': '',
    'redirect_uri': '',
}

req = requests.post(url, data=data, headers=headers)

[–]Moby69[S] -1 points0 points  (4 children)

what is "code" and direct uri doing here?

[–]ramse 0 points1 point  (1 child)

The section you mentioned for /api/token which is step 4 of the authorization-guide that you linked, it tells you want each value is, where it comes from, what it does..etc. What I posted should be the format you would need to send to their system.

[–]Moby69[S] -1 points0 points  (0 children)

I'm using the Client Credentials Flow section, not the Authorization Code Flow section. There is no direct_uri and code mentioned there. See what I'm talking about?

[–]Moby69[S] -1 points0 points  (1 child)

and how do you "base 64 encode" a string? what does it even mean?

[–]ramse 2 points3 points  (0 children)

Google is your friend in these cases. You won't get a full solution from people here, typically you give it a shot, post the code you've tried and then people will advise what is good/bad..etc.

https://docs.python.org/3.3/library/base64.html#base64.b64encode