API: Gateway users

From Yombo
Jump to: navigation, search

Summary

Display and manage users allowed to access a gateway.

GET - List gateway users

Get all users allowed to access a gateway.

Filters

List of available filters:

  • status

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/user

Parameters

None

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/user?_pagelimit=2
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/user?_pagelimit=2'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
response = requests.get(url, headers=headers)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/user",
 4         "uri_description": "List of users for a requested gateway.",
 5         "doc_uri": "https://yombo.net/api/#gw-users",
 6         "gateway_users": [
 7             {
 8                 "id": "wj56npJYO3veKml2GW",
 9                 "gateway_id": "PZywd7j0VLR4PzWz",
10                 "user_id": "GQbrd9P8xp4wE10pqae",
11                 "created_at": 1501307383,
12                 "updated_at": 1501307383,
13                 "email": "mitch@example.com"
14             }
15         ],
16         "locator": "gateway_users",
17         "locator_type": "integer"
18     },
19     "code": 200,
20     "warnings": [],
21     "pages": {
22         "total_items": 8,
23         "page_limit": 400,
24         "total_pages": 1,
25         "page_start": 1
26     },
27     "message": "OK",
28     "html_message": "OK"
29 }

GET - Specific gateway user

Retrieve a specific user for a gateway.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/user/{user_id}

Parameters

None

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/user/GQbrd9P8xp4wE10pqae
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/user/GQbrd9P8xp4wE10pqae'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
response = requests.get(url, headers=headers)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZyVLR4PzWzwd7j0/user/wE9v8xp4pqa0GQbrde",
 4         "uri_description": "Detailed information for a single userid for a given gateway id..",
 5         "doc_uri": "https://yombo.net/API:Gateway_users",
 6         "gateway_users": {
 7             "id": "wj56npJYO3veKml2GW",
 8             "gateway_id": "PZywd7j0VLR4PzWz",
 9             "user_id": "GQbrd9P8xp4wE10pqae",
10             "created_at": 1501307383,
11             "updated_at": 1501307383,
12             "email": "mitch@example.com"
13         },
14         "locator": "gateway_users",
15         "locator_type": "integer"
16     },
17     "code": 200,
18     "warnings": [],
19     "message": "OK",
20     "html_message": "OK"
21 }

POST - Add user to gateway

Adds a new user to the gateway. Currently, once a user is added to the gateway, they will have full control. Future updates will add access control.

To find the user's id, see the user API documentation.

Request URLs

  • POST https://api.yombo.net/api/v1/gateway/{gateway_id}/user

Parameters

Name Type Description
Required
user_id string User id to allow access to gateway.

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X POST -d '{"user_id": "yrAZ25"}' \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/user
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/user'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

payload = {
    "user_id": "yrAZ25",
    }

response = requests.post(url, headers=headers, json=payload)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/user",
 4         "uri_description": "Add a user to a gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateway_users",
 6         "gateway_users": {
 7             "user_id": "9Vej6rAZ25Rgdy9qJ6",
 8             "gateway_id": "PZywd7j0VLR4PzWz",
 9             "updated_at": 1518684287,
10             "created_at": 1518684287,
11             "id": "Qgo0a7Plj9kqryBAek"
12         },
13         "locator": "gateway_users",
14         "locator_type": "object"
15     },
16     "code": 201,
17     "warnings": [],
18     "message": "Created",
19     "html_message": "Created"
20 }


DELETE - Remove user from gateway

Removes access for a user to a gateway. To find the user's id, see the user API documentation.

Request URLs

  • DELETE https://api.yombo.net/api/v1/gateway/{gateway_id}/user/{user_id}

Parameters

None

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X DELETE https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/user/3M2VK9x7q9r
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/user/3M2VK9x7q9r'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

response = requests.put(url, headers=headers)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZyVLR4PzWzwd7j0/user",
 4         "uri_description": "Add a user to a gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateway_users",
 6         "gateway_users": {
 7             "user_id": "Rgd9Vej69qJ6yrAZ25",
 8             "gateway_id": "PZyVLR4PzWzwd7j0",
 9             "updated_at": 1518684287,
10             "created_at": 1518684287,
11             "id": "Qgo0a7Plj9kqryBAek"
12         },
13         "locator": "gateway_users",
14         "locator_type": "object"
15     },
16     "code": 201,
17     "warnings": [],
18     "message": "Created",
19     "html_message": "Created"
20 }
This page was last edited on 14 September 2018.