How to change customer tags with the API

Adam Robinson shared this question 2 years ago
Need Answer

I'm trying to update the tags for a customer using the API. I'm using this as a reference. I'm posting this data:

{ tags : "test1,test2" } 
and getting a 409 code back, but the tags are not updated. The modified time does change however.

I've also tried to update the fax number for a customer.

{ fax : "54321" }
This works as expected, code 409 is returned and the customer's fax number is updated.


Am I using the wrong format for tags or is this a bug?

Comments (8)

photo
1

This sounds like a bug. I have a developer looking into it and will get back to you.

photo
1

try using custtags instead

photo
1

custtags works, but will only add tags. If it's already tagged with "Corporate", and I send:

{ custtags : "test1,test2" }
the tags now read: ["test1","test2","Corporate"]

Is there any way to have it set the tags instead of adding to them?

photo
1

I've added another option:

cleartags: 1

this will cause the custtags to clear before setting.

photo
1

I think it did remove the tags, but only once. It seems to have stopped working now.

Since then, I haven't gotten it to work again. Posting:

{ cleartags: 1, custtags: 'aaa' }
adds "aaa" to the tags, keeping all previous tags. I've been testing this on customers 2439085 and 2448047 if that helps.

photo
1

You need to be using api2, as api1 doesn't support this flag.

photo
1

I just double checked, I think I am using api2.

photo
1

Okay, this has been fixed (again)! Sorry about the delay on this.