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;">
{
    "response": {
        "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/user",
        "uri_description": "List of users for a requested gateway.",
        "doc_uri": "https://yombo.net/api/#gw-users",
        "gateway_users": [
            {
                "id": "wj56npJYO3veKml2GW",
                "gateway_id": "PZywd7j0VLR4PzWz",
                "user_id": "GQbrd9P8xp4wE10pqae",
                "created_at": 1501307383,
                "updated_at": 1501307383,
                "email": "mitch@example.com"
            }
        ],
        "locator": "gateway_users",
        "locator_type": "integer"
    },
    "code": 200,
    "warnings": [],
    "pages": {
        "total_items": 8,
        "page_limit": 400,
        "total_pages": 1,
        "page_start": 1
    },
    "message": "OK",
    "html_message": "OK"
}

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;">
{
    "response": {
        "uri": "/api/v1/gateway/PZyVLR4PzWzwd7j0/user/wE9v8xp4pqa0GQbrde",
        "uri_description": "Detailed information for a single userid for a given gateway id..",
        "doc_uri": "https://yombo.net/API:Gateway_users",
        "gateway_users": {
            "id": "wj56npJYO3veKml2GW",
            "gateway_id": "PZywd7j0VLR4PzWz",
            "user_id": "GQbrd9P8xp4wE10pqae",
            "created_at": 1501307383,
            "updated_at": 1501307383,
            "email": "mitch@example.com"
        },
        "locator": "gateway_users",
        "locator_type": "integer"
    },
    "code": 200,
    "warnings": [],
    "message": "OK",
    "html_message": "OK"
}

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;">
{
    "response": {
        "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/user",
        "uri_description": "Add a user to a gateway.",
        "doc_uri": "https://yombo.net/API:Gateway_users",
        "gateway_users": {
            "user_id": "9Vej6rAZ25Rgdy9qJ6",
            "gateway_id": "PZywd7j0VLR4PzWz",
            "updated_at": 1518684287,
            "created_at": 1518684287,
            "id": "Qgo0a7Plj9kqryBAek"
        },
        "locator": "gateway_users",
        "locator_type": "object"
    },
    "code": 201,
    "warnings": [],
    "message": "Created",
    "html_message": "Created"
}


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;">
{
    "response": {
        "uri": "/api/v1/gateway/PZyVLR4PzWzwd7j0/user",
        "uri_description": "Add a user to a gateway.",
        "doc_uri": "https://yombo.net/API:Gateway_users",
        "gateway_users": {
            "user_id": "Rgd9Vej69qJ6yrAZ25",
            "gateway_id": "PZyVLR4PzWzwd7j0",
            "updated_at": 1518684287,
            "created_at": 1518684287,
            "id": "Qgo0a7Plj9kqryBAek"
        },
        "locator": "gateway_users",
        "locator_type": "object"
    },
    "code": 201,
    "warnings": [],
    "message": "Created",
    "html_message": "Created"
}