Groups
Groups Overview
Groups are a smaller container for businesses within a single account. This is often used to filter data for large, multi-location clients.
For example, Walmart has 1'000's of locations that can be grouped into regions, states, countries, territories, etc.
The Reporting API allows you to view groups - not create them
if you have interest in creating groups, please contact your Reply Pro account manager and they will create them for you.
Default Fields
The following fields are used to access group data:
Field | Type | Description |
---|---|---|
name | string | The name associated to the group. Usually the name of a territory or defined geographic area. |
id | int | The ID associated to the group used to make API calls associated to the group. |
Additional Fields
Field | Type | Description |
---|---|---|
remote_id | string | A field intended to make it easier for you to relate your data to ours. |
List All Groups
Use this URL to list all groups for the authenticated user.
https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/groups
Example of returned data:
{
"next": null,
"previous": null,
"results": [
{
"id": 275,
"name": "Northwest"
},
{
"id": 852,
"name": "Islands"
}
]
}
Get Group
Use this URL to get a single group object:
https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/groups/<group_id>
Example of returned data:
{
"next": null,
"previous": null,
"results": [
{
"id": 275,
"name": "Northwest"
}
]
}
Adding Groups
To create a new Group, submit a POST request to following URL containing, at minimum, the name for the new Group. A remote_id
or list of business_ids
can also be included in the request.
https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/groups
{
"name": "New Group Name",
"remote_id": "New identifier", // Optional
"business_ids": [21, 23, 36] //Optional, but must be an array of integers
}
{
"id": 275,
"name": "Northwest",
"remote_id": "Identifier" // Only if included in request
}
Updating Groups
You can update the name
or remote_id
fields of the group object. These can be updated together or separately.
Additionally, a list of business_ids
can be provided, along with an additional parameter operation
. If operation
is passed the string "add", then the provided business_ids will be added to the group. These businesses must be associated to the company the group belongs to.
If operation
is passed the string "remove", the provided business_ids will be removed from the group.
Examples of PUT requests to add new companies or edit existing ones:
https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/groups/<group_id>
{
"name": "New Name",
"remote_id": "New identifier",
"business_ids": [23, 45, 56],
"operation": "add" | "remove" // denotes whether to add or remove the business_ids provided
}
{
"id": 275,
"name": "Northwest",
"remote_id": "Identifier" // Only if included in request
}
List Group Businesses
Use this URL to get a list of businesses belonging to a single group object:
https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/groups/<group_id>/businesses
Example of return data:
{
"next": null,
"previous": null,
"results": [
{
"id": 28675,
"name": "Local Bakeries"
},
{
"id": 86752,
"name": "Code Nibblers"
}
]
}
Filtering
Looking to filter by specific values in a field? Checkout Filters
Updated almost 7 years ago