Category Group API Endpoint
Category groups are used to associate categories with defined group, which control access to your content (categories and articles).
Using the Category Group API, you can programmatically organize
category_group
objects from your own applications and scripts to control which categories have access to which groups.
The category_group object
Attributes
category_id
Unique numeric reference for the category object related to the object.
group_id
Unique numeric reference for the group object related to the object.
{
"category_id": 731,
"group_id": 85
}
Retrieve a category_group GET /category_group
Returns all category_group objects matching the specified criteria
Required parameters
At least one of the optional
category_id
or
group_id
parameters.
Optional parameters
category_id
Unique numeric identifier for a category to be matched when returning results.
If
group_id
is not specified, then all category_groups matching the specified category_id will be returned.
group_id
Unique numeric identifier for a group to be matched when returning results.
If
category_id
is not specified, then all category_groups matching the specified group_id will be returned.
limit
Optional limit on the number of objects to be returned, between 1 and 100
If this parameter is not provided, a default
limit
of 100 will be applied, returning the maximum of 100 items.
fetch_offset
A cursor to use for pagination. Defines the numeric offset from where results should begin being fetched.
For example, if you were working with a large number of records, and wanted to fetch them in pages of 10 at a time, you might set the
limit
value to 10 (indicating only 10 records at a time should be returned) and for the first page,
fetch_offset
would be 0 to indicate no offset (returning records 1-10).
For the second page,
fetch_offset
would be set to 10, allowing records 11-20 to be returned.
If this parameter is not provided, a default
fetch_offset
of 0 will be applied, returning records from the start of the result set.
curl -X GET https://api.gogoworx.com/category_group \
-H "x-api-key: qI9CSNml2mwL7zPVpwLW4WBJPCmTcIkBKeCQL1t7" \
-H "x-account-uuid: sitename/02fccd86-18e8-4816-a52c-bd3bf9f8446e" \
-d '{"group_id": 85, "limit": 20}'
Response (containing specified objects):
[{
"category_id": 731,
"group_id": 85
},
{
"category_id": 732,
"group_id": 85
}]
Create a category_group POST /category_group
Creates a new category_group based on specified parameters.
Required parameters
category_id
Unique numeric reference for the category object related to the object.
This must reference a valid category for the account.
group_id
Unique numeric reference for the group object related to the object.
This must reference a valid group for the account.
Optional parameters
None
curl -X POST https://api.gogoworx.com/category_group \
-H "x-api-key: qI9CSNml2mwL7zPVpwLW4WBJPCmTcIkBKeCQL1t7" \
-H "x-account-uuid: sitename/02fccd86-18e8-4816-a52c-bd3bf9f8446e" \
-d '{"category_id": 733, "group_id": 85}'
Response (containing the updated object):
[{
"category_id": 733,
"group_id": 85
}]
Delete a category_group DELETE /category_group
Deletes a single, specified category_group based on the specified
category_id
and
group_id
.
Note that once deleted, the related category will no longer be a member of the specified group, so will be excluded from being accessed by users related to that group.
Required parameters
The
category_id
and
group_id
parameters must be specified to uniquely identify the category_group to be deleted
Optional parameters
None
curl -X DELETE https://api.gogoworx.com/category_group \
-H "x-api-key: qI9CSNml2mwL7zPVpwLW4WBJPCmTcIkBKeCQL1t7" \
-H "x-account-uuid: sitename/02fccd86-18e8-4816-a52c-bd3bf9f8446e" \
-d '{"category_id": 733, "group_id": 85}'
Response (containing empty array):
[]