-
Notifications
You must be signed in to change notification settings - Fork 45
Authentication
OndrejVild edited this page May 16, 2023
·
6 revisions
You will need your API key - get one here. There are three ways to authenticate:
Set the Api-Key
key in the headers json.
Python example:
headers = {
"Content-Type": "application/json",
"Api-Key": "123abc",
}
response = requests.post("https://api.plant.id/v2/usage_info",
headers=headers)
See details here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization. Use the following credentials:
- username: "client"
- password: YOUR_API_KEY
Python example:
headers = {
"Content-Type": "application/json",
}
response = requests.post("https://api.plant.id/v2/usage_info",
headers=headers, auth=("client", "123abc"))
Add an "api_key"
parameter to your request.
Python example:
params = {
"api_key": "123abc",
}
headers = {
"Content-Type": "application/json",
}
response = requests.post("https://api.plant.id/v2/usage_info",
json=params,
headers=headers)