Oauth is our essential authentication web service to use our services safely. Through this service you can receive, modify and see essential tokens to access all the rest methods of the bees that we provide.
Check out more at https://developers.openapi.it/services/oauth
Explore all our services at https://developers.openapi.it/services
With this call passing one or more scopes you receive a token that you will need to authenticate with the same scopes you passed. Tokens with expiration dates can be very useful if you want to restrict access to just the small number of scopes that your application/service needs: in this way you can avoid unwanted requests
scopes required | Array of strings 2 items List of scopes for which you want to be authorized to use; you can also pass an asterisk as a wild card for all methods or all domains or all endpoints. For example if I want all the methods and endpoints of a given domain '*:comparabili.realgest.it/*'; if I want all the scopes '*:*/*' |
expire | integer Default: "<integer>" The token lifespan in seconds, up to one year; if not provided, it will be set to expire in 1 year from now. The example shows how to request a token that has a lifespan of 30 days. |
scopes | Array of strings |
expire | integer |
token | string |
success | boolean |
message | string |
error | integer |
{- "scopes": [
- "GET:comparabili.realgest.it/annunci",
- "GET:imprese.altravia.com/*",
- "*:*.altravia.com/*"
], - "expire": 2592000
}
{- "scopes": [
- "POST:valutometro.altravia.com/valutazione"
], - "expire": 1634223407,
- "token": "5f8711afe4754a532a7a8358",
- "success": true,
- "message": "",
- "error": null
}
Method that returns all the tokens with their scopes still active for your account
scope | string Default: "<string>" Example: scope=GET:imprese.altravia.com/base name of the scope for which to filter the tokens |
Array of objects[ items ] | |
success | boolean |
message | string |
error | integer |
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://test.oauth.openapi.it/token?scope=GET%3Aimprese.altravia.com%2Fbase"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
{- "data": [
- {
- "scopes": [
- "POST:videoid.altravia.com/videoId"
], - "expire": 1603268553,
- "token": "5daebc49568fa1398c55186d"
}, - {
- "scopes": [
- "POST:videoid.altravia.com/request"
], - "expire": 1604049864,
- "token": "5dbaa848568fa113ad2e7fcf"
}, - {
- "scopes": [
- "GET:videoid.altravia.com/request"
], - "expire": 1604050325,
- "token": "5dbaaa15568fa113ad2e7fd1"
}
], - "success": true,
- "message": "",
- "error": null
}
Method that returns the token you passed in the path
token required | string Default: "<string>" Example: 5f8041e42efdfc468b6e60ea requested token |
Array of objects[ items ] | |
success | boolean |
message | string |
error | integer |
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://test.oauth.openapi.it/token/5f8041e42efdfc468b6e60ea"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
{- "data": [
- {
- "scopes": [
- "GET:imprese.altravia.com/base",
- "GET:imprese.altravia.com/advance"
], - "expire": 1627139406,
- "token": "5f0efd20568fa12c575182f0"
}
], - "success": true,
- "message": "",
- "error": null
}
Method that allows you to modify the entire token object by passing it new ones or the same reference scopes with a new expiration
token required | string Default: "<string>" Example: 5f8041e42efdfc468b6e60ea requested token |
scopes required | Array of strings 2 items List of scopes for which you want to be authorized to use; you can also pass an asterisk as a wild card for all methods or all domains or all endpoints. For example if I want all the methods and endpoints of a given domain '*:comparabili.realgest.it/*'; if I want all the scopes '*:*/*' |
expire | integer Default: "<integer>" The token lifespan in seconds, up to one year; if not provided, it will be set to expire in 1 year from now. The example shows how to request a token that has a lifespan of 30 days. |
Array of objects[ items ] | |
success | boolean |
message | string |
error | integer |
{- "scopes":