User Group API Endpoint
A user_group object associates a user with a defined group, which in turn control access to your content (categories and articles).
Users who are members of specific groups (as determined by a corresponding user_group object) will be able to access categories and articles within those categories that are also associated with the same group.
Using the User Group API, you can programmatically organize user_group
objects from your own applications and scripts to control which users have access to which groups.
The user_group object
Attributes
user_id
Unique numeric reference for the user related to the object.
group_id
Unique numeric reference for the group related to the object.
{
"user_id": 1001,
"group_id": 85
}
Retrieve a user_groupGET /user_group
Returns all user_group objects matching the specified criteria
Required parameters
At least one of the optional user_id
or group_id
parameters.
Optional parameters
user_id
Unique numeric identifier for a user to be matched when returning results.
If group_id
is not specified, then all user_groups matching the specified user_id will be returned.
group_id
Unique numeric identifier for a group to be matched when returning results.
If user_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/user_group \
-H "x-api-key: qI9CSNml2mwL7zPVpwLW4WBJPCmTcIkBKeCQL1t7" \
-H "x-account-uuid: sitename/02fccd86-18e8-4816-a52c-bd3bf9f8446e" \
-d '{"user_id": 1001, "limit": 20}'
Response (containing specified objects):
[{
"user_id": 1001,
"group_id": 85
},
{
"user_id": 1001,
"group_id": 104
}]
Create a user_groupPOST /user_group
Creates a new user_group based on specified parameters.
Required parameters
user_id
Unique numeric reference for the user object related to the object.
This must reference a valid user 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/user_group \
-H "x-api-key: qI9CSNml2mwL7zPVpwLW4WBJPCmTcIkBKeCQL1t7" \
-H "x-account-uuid: sitename/02fccd86-18e8-4816-a52c-bd3bf9f8446e" \
-d '{"user_id": 1001, "group_id": 512}'
Response (containing the updated object):
[{
"user_id": 1001,
"group_id": 512
}]
Delete a user_groupDELETE /user_group
Deletes a single, specified user_group based on the specified user_id
and group_id
.
Note that once deleted, the related user will no longer be a member of the specified group, so will no longer be able to content related to that group.
Required parameters
The user_id
and group_id
parameters must be specified to uniquely identify the user_group to be deleted
Optional parameters
None
curl -X DELETE https://api.gogoworx.com/user_group \
-H "x-api-key: qI9CSNml2mwL7zPVpwLW4WBJPCmTcIkBKeCQL1t7" \
-H "x-account-uuid: sitename/02fccd86-18e8-4816-a52c-bd3bf9f8446e" \
-d '{"user_id": 1001, "group_id": 512}'
Response (containing empty array):
[]