Tags management

Contact API supports Tag operations. Using this operation you can directly apply tags to any contacts.

GET Method

you can retrieve all the tags applied to specific contact by making get a request to contact’s tag API. You need to pass email address or id of a contact while making request.

http://yoursite.com/wp/wp-json/gh/v3/contacts/tags?id_or_email=1

This request fetch all the tags aid and return list of tag id.

{
    "tags": [
        3
    ],
    "status": "success"
}

Apply tags

You can apply tags by making PUT or PATCH request to the apply tag URL. It requires email id of contact or id of contact. id_or_email and tags are the require arguments while making this request.

http://yoursite.com/wp/wp-json/gh/v3/contacts/apply_tags

Request argument looks like follows.

{
    "id_or_email":"1",
    "tags" : [ 
        1, 
        2, 
        3, 
        "user", 
        "confirm" 
    ]
}    
{
    "status": "success"
}

Remove Tags

You can remove tags by making a PUT/PATCH request to contacts remove tag endpoint with the same arguments as Apply Tags.

http://yoursite.com/wp/wp-json/gh/v3/contacts/remove_tags
Was this article helpful to you? Yes No

How can we help?