I need to get token to connect to API. Tried with python this:
import requests, base64
url = 'https://api-b2b.alzura.com/common/login'
token_req = base64.b64encode(b'name:passwd').decode()
headers = {'Authorization': str(token_req)}
req = requests.post(url, headers=headers)
print(req)
And got <Response [400]>, but no token. :D I have read this post part about python, but it dint't work for me.
Looks like I does it completely wrong. What should I do/learn/read?
Thank you for your time!
UPDATE It should be a basic auth, and it looks like there is no need any user secrets. Here is little manual from developer:
Get a login token and expire date. Returns the X-AUTH-TOKEN which is required for authentication of the remaining endpoints. Authentication for this endpoint is basic auth. For authentication, an authentication-header formatted as 'Alzura ID:Password' must be transmitted as a base64-encoded string.