-
-
Notifications
You must be signed in to change notification settings - Fork 17
Authentication
Davide Santangelo edited this page Oct 17, 2022
·
7 revisions
dato.rss API uses OAuth 2.0 token for user authorization and API authentication. Applications must be authorized and authenticated before they can fetch data.
permissions let you specify exactly what type of access you need. Permissions limit access for OAuth tokens. They do not grant any additional permission beyond that which the user already has.
# POST /tokens
RestClient.post "https://<your.host>/api/tokens", {}
# POST /tokens/refresh
RestClient.post "https://<your.host>/api/tokens/refresh", {}, { Authorization: "Token #{TOKEN}" }
# GET /tokens/current
RestClient.get "https://<your.host>/api/tokens/current", { Authorization: "Token #{TOKEN}" }
{
"data": {
"id": "c50bc253-9a49-48b6-aee7-a93782a108a6",
"type": "token",
"attributes": {
"key": "AoaNW3PnEplDB8mLqghiXMcfons_BOUqNeJe1iy9bwsdijqNcE3BBkzXSNYjZ4ROYf1zevKzC4e-Q7JgYd3Gtg",
"expires_at": 1612175284,
"active": true,
"permissions": [
"read"
]
}
}
}