Less Annoying CRM logo Less Annoying CRM LACRM
Core API Functions

Group Memberships

Groups allow you to segment your contacts so you can easily pull up a list of related contacts. When interacting with groups via the API, it's important to understand that there are two sets of functions. In the settings section, you'll see API functions for managing the groups themselves. Those are rarely used, because once a group has been created, you normally don't need to mess with it. This section is about group memberships which is how you control which contacts are in which groups.

When you're using the LACRM app and you "attach a group to a contact", that's creating a group membership. A group membership is just a link between a contact and group. So to add a contact to a group, you'll want to create a group membership. To remove a contact from a group, delete the group membership.

Because group memberships are really just links between two other objects, the API functions are a bit different from normal. There's no ID for group memberships, you just pass both the contact and group IDs. Similarly, you can't edit group memberships because they don't contain any additional information beyond the IDs of the records they're linking together.

Create a group membership

This function creates a new group membership. This is the equivalent of attaching a group to a contact record using the LACRM user interface.

How to call this function
Function name
CreateGroupMembership
Parameters
ContactId Uid Required

The Id of the contact or company that will become a member of a group.

GroupId Uid

The Id of the group the contact should be a member of. You must either pass a GroupId or GroupName to identify the group, but you shouldn't pass both. If you're not sure which one to use, we recommend using GroupId because it's more precise.

GroupName Text

You can optionally identify groups by their name instead of GroupId, although we generally don't recommend it.

Response
This function doesn't return anything. If there's no error message returned, that means the call was completed successfully.

Delete a group membership

This function deletes a group membership. In other words, it removes a contact from a group.

How to call this function
Function name
DeleteGroupMembership
Parameters
ContactId Uid Required

The Id of the contact or company that will become a member of a group.

GroupId Uid

The Id of the group the contact should be a member of. You must either pass a GroupId or GroupName to identify the group, but you shouldn't pass both. If you're not sure which one to use, we recommend using GroupId because it's more precise.

GroupName Text

You can optionally identify groups by their name instead of GroupId, although we generally don't recommend it.

Response
This function doesn't return anything. If there's no error message returned, that means the call was completed successfully.

Get contact group memberships

This function gets all of the groups a contact is a member of.

How to call this function
Function name
GetGroupsAttachedToContact
Parameters
ContactId Uid Required

The Id of the contact or company to whom the groups are attached.

MaxNumberOfResults Number Default: 500

How many results should be returned from a single API call? The max value is 10,000. If you need to return more results, call this API function again, but increment the Page parameter.

Page Number Default: 1

If there are more results than MaxNumberOfResults, you can call this function again with an incremented Page value to get the next page of results. For example, if there are 700 results, but you're only requesting 500 at a time, you could call this function with Page=2 to get the remaining 200 results.

Response
{
"HasMoreResults": false,
"Results": [
{
"ContactId": "3950581960392876745979627042108",
"GroupId": "3950581960392876745979627869602",
"GroupMetaData": {
"Name": ""
}
},
{...},
{...}
]
}

Get contacts in a group

This function gets all of the contacts that are members of a specific group

How to call this function
Function name
GetContactsInGroup
Parameters
GroupId Uid

The Id of the group you're getting the members of. You must either pass a GroupId or GroupName to identify the group, but you shouldn't pass both. If you're not sure which one to use, we recommend using GroupId because it's more precise.

GroupName Text

You can optionally identify groups by their name instead of GroupId, although we generally don't recommend it.

MaxNumberOfResults Number Default: 500

How many results should be returned from a single API call? The max value is 10,000. If you need to return more results, call this API function again, but increment the Page parameter.

Page Number Default: 1

If there are more results than MaxNumberOfResults, you can call this function again with an incremented Page value to get the next page of results. For example, if there are 700 results, but you're only requesting 500 at a time, you could call this function with Page=2 to get the remaining 200 results.

Response
{
"HasMoreResults": false,
"Results": [
{
"ContactId": "3950581960397488431998053740845",
"GroupId": "3950581960397488431998055245795",
"ContactMetaData": {
"Name": "John Doe",
"AssignedTo": "123456"
}
},
{...},
{...}
]
}