Collect the API key (device token)
const url = 'https://api.ringingbytes.com/v1/agent/device/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"device_code":"example","grant_type":"example","client_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ringingbytes.com/v1/agent/device/token \ --header 'Content-Type: application/json' \ --data '{ "device_code": "example", "grant_type": "example", "client_id": "example" }'RFC 8628 token request. No authentication. Until the person decides: HTTP 400 with error = authorization_pending (keep polling every interval seconds), slow_down (add 5 seconds), access_denied, expired_token, or invalid_grant (unknown code, or the key was already returned: it is returned once). On approval: the organization’s new API key. Accepts JSON or form encoding.
Request Bodyrequired
Section titled “Request Bodyrequired”object
urn:ietf:params:oauth:grant-type:device_code (optional).
Example generated
{ "device_code": "example", "grant_type": "example", "client_id": "example"}Responses
Section titled “Responses”OK
object
The API key (shown once).
The granted scopes, space-separated (RFC 6749).
The API key again, under a plain name.
Example
{ "token_type": "Bearer", "scopes": [ "checks:create" ]}