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.openapi.it/*'; if I want all the scopes '*:*/*' |
expire | integer Deprecated Default: "<integer>" |
ttl | integer Default: "<integer>" The token lifespan (time-to-live) in seconds, up to one year; if not provided, when creating a token 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 A list of the scopes you requested, expanded |
expire | integer A UNIX timestamp, in seconds, rappresenting the expiring date of the token |
token | string Your new token |
success | boolean |
message | string |
error | integer |
{- "scopes": [
- "GET:comparabili.openapi.it/tassonomie",
- "GET:imprese.openapi.it/*",
- "*:*.openapi.it/*"
], - "expire": "<integer>",
- "ttl": 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.openapi.it/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://oauth.openapi.it/token?scope=GET%3Aimprese.openapi.it%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://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.openapi.it/base",
- "GET:imprese.openapi.it/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
Please note that the TTL option is not available for this method.
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.openapi.it/*'; if I want all the scopes '*:*/*' |
expire | integer Default: "<integer>" An expiration date in expressed as a UNIX timestamp in seconds. If not set, the date will be set one year from now |
Array of objects[ items ] | |
success | boolean |
message | string |
error | integer |
{- "scopes": [
- "GET:comparabili.openapi.it/tassonomie",
- "GET:imprese.openapi.it/*",
- "*:*.openapi.it/*"
], - "expire": 1660640780
}
{- "data": [
- {
- "scopes": [
- "GET:comparabili.openapi.it/tassonomie"
], - "expire": 1583942471,
- "token": "5f0efd20568fa12c575182f0"
}
], - "success": true,
- "message": "",
- "error": null
}
Method that allows you to modify individual fields of the token object by passing it new ones or the same reference scopes or 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.openapi.it/*'; if I want all the scopes '*:*/*' |
expire | integer Deprecated Default: "<integer>" |
ttl | integer Default: "<integer>" The token lifespan (time-to-live) in seconds, up to one year; if not provided, when creating a token 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 |