API: Categories
From Yombo
- Overview
- Quick start
- Various Topics
- Manage Results
- Core Resources
- Other resources
Summary
Categories are used organize various items within the Yombo framework. Device types and input types are the primary use cases.
To add new categories, please contact Yombo support.
GET - All categories
Retrieve all categories available.
Request URL
- GET https://api.yombo.net/api/v1/categories
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/categories?page[size]=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/categories?page[size]=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;">
{
"data": [
{
"type": "categories",
"id": "vleRWgpRJ5hj0ao3m",
"attributes": {
"id": "vleRWgpRJ5hj0ao3m",
"parent_id": "vleRWgpRJ5hj0ao3m",
"category_type": "input_type",
"machine_label": "input_type",
"label": "Input Type",
"description": "Types of various inputs. Usually used to help user setting up devices and also used by devices to determine what type of input to expect.",
"status": 1,
"created_at": 1482065386,
"updated_at": 1482065386
}
},
{
"type": "categories",
"id": "5M9logKwykI7gRVbJ",
"attributes": {
"id": "5M9logKwykI7gRVbJ",
"parent_id": "5M9logKwykI7gRVbJ",
"category_type": "input_type",
"machine_label": "address",
"label": "Address",
"description": "Various device addressing input formats.",
"status": 1,
"created_at": 1482065387,
"updated_at": 1482065387
}
}
],
"meta": {
"count": 2,
"current_page": 1,
"from": 1,
"last_page": 16,
"path": "https://api.yombo.net/api/v1/categories",
"per_page": 2,
"to": 2,
"total": 31,
"includable": []
},
"links": {
"first": "https://api.yombo.net/api/v1/categories?page%5Bsize%5D=2&page%5Bnumber%5D=1",
"last": "https://api.yombo.net/api/v1/categories?page%5Bsize%5D=2&page%5Bnumber%5D=16",
"prev": null,
"next": "https://api.yombo.net/api/v1/categories?page%5Bsize%5D=2&page%5Bnumber%5D=2",
"self": "https://api.yombo.net/api/v1/categories"
}
}
GET - Specific category
Retrieve a specific category id.
Request URLs
- GET https://api.yombo.net/api/v1/categories/{category_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/categories/vleRWgpRJ5hj0ao3m
<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/categories/vleRWgpRJ5hj0ao3m
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;">
{
"data": {
"type": "categories",
"id": "vleRWgpRJ5hj0ao3m",
"attributes": {
"id": "vleRWgpRJ5hj0ao3m",
"parent_id": "vleRWgpRJ5hj0ao3m",
"category_type": "input_type",
"machine_label": "input_type",
"label": "Input Type",
"description": "Types of various inputs. Usually used to help user setting up devices and also used by devices to determine what type of input to expect.",
"status": 1,
"created_at": 1482065386,
"updated_at": 1482065386
}
},
"links": {
"self": "https://api.yombo.net/api/v1/categories/vleRWgpRJ5hj0ao3m"
},
"meta": {
"includable": []
}
}
GET - Meta Information
Get the current meta information about the categories resource. Used for sorting, filtering, and relations.
Request URL
- GET https://api.yombo.net/api/v1/categories/meta}
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/categories/meta
<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/categories/meta'
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;">
{
"type": "categories_meta",
"id": "categories_meta",
"attributes": {
"sortable": [
"category_type",
"machine_label",
"label",
"status",
"created_at",
"updated_at"
],
"includable": [],
"filterable": [
"parent_id",
"category_type",
"machine_label",
"label",
"status",
"created_at",
"updated_at"
]
}
}