I'm having issues with creating an authorization header and getting the token for it, as explained here : https://developer.amazon.com/fr/docs/smapi/skill-certification-operations.html
The API's endpoint is https://api.amazonalexa.com. Each API request must have an
Authorization header whose value should be the access token retrieved from Login with Amazon.
I would want to create and publish Alexa skills with SMAPI from Python code. I have no issues with sending the request or creating the json object to send, yet i did not get how to create the authorization header and token that need to be included in it. So i will get the 401 error code (unauthorized because missing authorization).
I'm using the requests library, for this kind of code :
with open("path/json_file.json") as json_file: response = requests.post(url="https://api.amazonalexa.com/v1/skills", data=json.load(json_file))
I have found multiples threads with people having the same issue, yet all the links in those threads are broken. I'm assuming that the token is to be generated from the access keys/secret access key in the amazon developer account, yet i did not found up to date clear documentation on that.
I'm not looking to use the command line interface as i need to send the requests from the Python code, and i would preferably want to get a permanent token, not a temporary one.
I would really appreciate a hand on exactly what should i put as the authorization header, and how to create it and include it in Python with the requests library, or in json if it needs to be included in the json data.
PS : I'm using Python 3.7, i'm precising it since i have found docs that are using Python 2