Authenticatie
Authenticatie
De API maakt gebruik van OAuth2 authenticatie. Een token is te verkrijgen door een POST request te sturen naar /oauth/access_token.
curl -X POST https://api.yes-co.com/oauth/access_token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "user_id=YOUR_USER_ID"
Parameters
Naam | Type | Opmerking |
---|---|---|
grant_type | string | Verplicht, altijd: client_credentials |
client_id | string | Verplicht |
client_secret | string | Verplicht |
user_id | string | Optioneel. Dit is een API object id |
Response
Status: 200 OK
{
"token_type":"Bearer",
"expires_in": 3600,
"access_token": "TOKEN"
}
Token gebruiken
Bij alle requests naar de API wordt de verkregen access_token meegestuurd als Authorization header.
curl -X GET https://api.yes-co.com/1.0/project/1 \
-H "Authorization: Bearer TOKEN"