简体   繁体   中英

Cannot key in bearer api token into Postman Santau.io api

The below link is the santau.io api documentation.

https://documenter.getpostman.com/view/6411292/TVev3iy5

I am using python code. However, if I type the code below, I could not extract the data as expected. The weird thing is that it does not show how to key in the bearer api token into the code to get authorized for extracting the data. Anyone have experience to deal with it?

import requests

url = "https://santau.io/api/v1/histories?name=3A&start_date=2019-08-13&end_date=2020-08-15&limit=100&offset=0"

api_token="B67KqyJstY4SLrf4......" #not real API token, just an example

payload={}
headers ={"Authorization": "Bearer " + api_token}
response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

After you register http://santau.io/register , you can get API token.

在此处输入图片说明

Then you put it to header to make a request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM