PUT/PATCH Method

If you want to update tag details this method can help you. To update detail of tag tag_id is required so you need to pass tag_id in tags section of your JSON PUT/PATCH request. following example update tag we just created.

You can also perform this operation by setting “id_or_email” to user id of a user and passing by_user_id = true.

http://yoursite.com/wp-json/gh/v3/tags
{
	"tag_id" : "5",
	"tag_name" : "test",
	"tag_description":"Test Tag"
	
}

above update operation returns following response. 

{
    "code": "success",
    "message": "Tag updated successfully."
}

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.

You can also perform this operation by setting “id_or_email” to user id of a user and passing by_user_id = true.

http://yoursite.com/wp/wp-json/gh/v3/tags/apply

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/tags/remove
Was this article helpful to you? Yes No 1

How can we help?