Tags
Tags are used for contacts to search and keep track of contact types, interests and more.
The following fields relate to the Tags endpoint.
Field | Limits | Required? | Writeable? |
---|---|---|---|
id | No | No | |
The ID of the tag | |||
content | Yes | Yes | |
The tag content, usually something used to describe a contact eg. 'Buyer' or 'Seller' |
Submit one Tag
To submit one tag:
POST https://api-v2.liondesk.com//tags
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
The request object should have this form:{
"content": "Buyer"
}
Update one Tag
To update some attributes on one tag:
PATCH https://api-v2.liondesk.com//tags/10
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
data: { content: "Buyer"}
Caveats to updating tags
- It will update the name of the tag for all contacts that have that tag. This requires many resource operations and may take some time.
- Updates are restricted to tag owners and contact owners for that tag.
Get One Tag
To get one tag:
GET https://api-v2.liondesk.com//tags/1
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
The response object will have this form:{
"id": 10,
"content": "Buyer"
}
Find All Tags
You find/search tags by issuing a GET
request to the base endpoint:
GET https://api-v2.liondesk.com//tags
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
The response will contain an array of tag objects, like so:
{
"total": 2,
"limit": 10,
"skip": 0,
"data": [
{
"id": 10,
"content": "Buyer"
},
{
"id": 20,
"content": "Seller"
}
]
}
Filtering Tags
The following filtering operators may be mixed and matched as desired.
Equality
You may query tag fields directly by specifying equality parameters in the request URI:GET /tags?content=Potential Buyer&content=Landlord
You may wish to exclude results having some value with $ne:GET /tags?content[$ne]=Seller
Limiting and Pagination
$limit will return only the number of results you specify: GET /tags?$limit=2
$skip will skip the specified number of results, useful for paginating:GET /tags?content=Seller&$limit=2&$skip=2
Sorting
$sort will order results based on the field given.
Use 1 for ascending order, and -1 for descending order:GET /tags?$limit=10&$sort[content]=-1
Inclusion / Exclusion
Find all records where the property values are ($in) some set:GET /tags?content[$in]=Moving Soon&content[$in]=Hot Buyer
If the column matches any of the given values, the resource shall be returned.
Similarly, you may exclude certain values with ($nin):GET /tags?content[$nin]=Moving Soon&content[$nin]=Hot Buyer
Remove
Tags can be removed with a delete request.
DELETE https://api-v2.liondesk.com//tags/21
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
Caveats to removing tags
- Removing a tag will also cause the tag to be removed from all contacts containing that tag. This requires many resource operations and may take some time.
- Removals are restricted to tag owners and contact owners for that tag.