This endpoint allows you to work with third party OAuth providers

Collection /oauth/thirdparty

To work with third party provided OAuth tokens.

GET /oauth/thirdparty/:id

Get OAuth token data by id

NB
- This endpoint is system only

  • int:id The id of the data you're after

item value
Access system
Full url https://api.buto.tv/v2/oauth/thirdparty/{id}
verb GET
params int:id

Example

curl -u API_KEY:x --include https://api.buto.tv/v2/oauth/thirdparty/1042

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

{"id": "13",
"organisation_id": "mbSwA",
"service_name": "youtube",
"called_by": "youtubeupload",
"username": "freddy",
"token": "12blknsdf-99sdf546knnsdmasfajsfajf",
"auth_url": "http://google.com",
"other_data": {
    "errors":"none"
},
"date_created": "2015-06-05 14:07:46",
"date_expiry": "2015-06-08 14:06:06",
"date_last_modified": "2015-06-05 14:17:37",
"user_id": "6789",
"deleted": "0"}

GET /oauth/thirdparty/attribute/:attribute/value/:value

Get OAuth token data by attribute/value.

NB
- This endpoint is system only
- This endpoint always excludes deleted tokens

  • string:attribute The name of the attribute you're after
  • string:value The value of the attribute you're after

item value
Access system
Full url https://api.buto.tv/v2/oauth/thirdparty/attribute/{attribute}/value/{value}
verb GET
params string:value string:value

Example

curl -u API_KEY:x --include https://api.buto.tv/v2/oauth/thirdparty/attribute/username/value/james@brownz.com

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

{"id": "13",
"organisation_id": "mbSwA",
"service_name": "youtube",
"called_by": "youtubeupload",
"username": "james@brownz.com",
"token": "12blknsdf-99sdf546knnsdmasfajsfajf",
"auth_url": "http://google.com",
"other_data": {
    "errors":"none"
},
"date_created": "2015-06-05 14:07:46",
"date_expiry": "2015-06-08 14:06:06",
"date_last_modified": "2015-06-05 14:17:37",
"user_id": "6789",
"deleted": "0"}

POST /oauth/thirdparty/:id

Create a brand new OAuth token data entry

NB
- This endpoint is system only

  • The following data should be POST'ed in:
    • organisation_id - string: the organisation id
    • service_name - string: Third party provider name | OPTIONAL | default empty string
    • called_by - string: Buto specific identifier | OPTIONAL | default empty string
    • username - string: third party provider username | OPTIONAL | default empty string
    • token - string: token | default empty string
    • auth_url - string: third party authentication endpoint | default empty string
    • other_data - string: any other data in JSON format | default empty string
    • date_expiry - string: date after which token expires | default empty string
    • user_id - string: the Buto user id | OPTIONAL | default empty string

item value
Access user system
Full url https://api.buto.tv/v2/oauth/thirdparty
verb POST

Example

curl -u API_KEY:x -X POST --data "data={\"organisation_id\":\"BhpZz\",\"user_id\":\"Hjloc\"}" --include https://api.buto.tv/v2/oauth/thirdparty

returns

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

{"id": 14584,"status": 1,"created": "2015-06-05 14:39:10"}

PUT /oauth/thirdparty/:id

Update an existing token

NB
- This endpoint is system only

  • id - string: the id you want to post against : REQUIRED
  • The following data should be POST'ed in:
    • organisation_id - string: the organisation id
    • service_name - string: Third party provider name | OPTIONAL | default empty string
    • called_by - string: Buto specific identifier | OPTIONAL | default empty string
    • username - string: third party provider username | OPTIONAL | default empty string
    • token - string: token | default empty string
    • auth_url - string: third party authentication endpoint | default empty string
    • other_data - string: any other data in JSON format | default empty string
    • date_expiry - string: date after which token expires | default empty string
    • user_id - string: the Buto user id | OPTIONAL | default empty string

item value
Access user | system
Full url https://api.buto.tv/v2/oauth/thirdparty/{id}
verb PUT
params int:id, The rest of the data should be POST'ed in

Example

curl -u API_KEY:x -X POST --data "data={\"user_id\":\"GhThG\"}" --include https://api.buto.tv/v2/oauth/thirdparty/12345

returns

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

{"id": "546723","status": 1,"Updated": "2015-06-05 14:45:16"}

DELETE /oauth/thirdparty/:id

Delete token data

NB
- This endpoint is system only

  • id - int: the id you want to delete : REQUIRED

item value
Access user system
Full url https://api.buto.tv/v2/oauth/thirdparty/{id}
verb DELETE
params string:id

Example

curl -X DELETE -u <your_api_key>:x --include https://api.buto.tv/v2/oauth/thirdparty/45124

returns

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

{"id": "45124","status": 1,"Deleted": "2015-06-05 14:47:17"}