This endpoint allows you to get and generate tokens which are usually used in authentication workflows

Collection /token

GET and PUT(generate) Tokens for use in authentication workflows

GET /token/:token

Check to see if a token is valid for use.
You will get an empty dataset returned if the token is not valid (invalid token, expired or disabled).
Not quite idempotent as accessing a single use token will disable it.

item value
Access SYSTEM KEYS ONLY
Full url https://api.buto.tv/v2/token/{token}
verb GET
params string:token

Example usage

#get video analytics for an organisation during Jan 2014
curl -u API_KEY:x --include https://api.buto.tv/v2/token/54180173aa899

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "token": "54180173aa899",
    "resource_name": 'video_authentication',
    "date_expires": "2014-09-16 12:55",
    "date_created": "2014-09-16 12:45",
    "is_single_use": false,
    "request_time": "2014-09-16 12:54"
}

PUT /token

Generate and return a token that's associated with a particular resource name

item value
Access SYSTEM KEYS ONLY
Full url https://api.buto.tv/v2/token
verb PUT
params string:resource_name, bool:is_single_use int:duration:60*60*24

  • resource_name - string MAX:30 chars, The name of the resource this token is associated with
  • is_single_use - DEFAULT false, should we disable this token on first access? Making it single use
  • duration - int OPTIONAL: DEFAULT 60*60*24=86400, How long should this token last for before expiring (in seconds)
curl -u API_KEY:x --include --request PUT --data-binary '{"resource_name":"video_authentication:xyz","is_single_use":true,"duration":126400}' https://api.buto.tv/v2/token

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "token":"44180173aa8929",
    "resource_name":"video_authentication:xyz"
    "duration":126400,
    "is_single_use": true,
    "date_expires":"2014-09-18 12:45"
}

DELETE /token/:token

Delete a token

item value
Access SYSTEM KEYS ONLY
Full url https://api.buto.tv/v2/token/:token
verb DELETE
params string:token

  • token - string REQUIRED, token to be deleted
token="my_token"
curl -u API_KEY:x --request DELETE https://api.buto.tv/v2/token/${token}

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "token":"44180173aa8929",
    "delete":true
}