Closed Bonias closed 8 years ago
@randerson @erickrause we're still having this problem, would you mind taking a look at that? Thanks!
I've taken a look at your curl's above.
What are you trying to do with this one:
$ curl -i -H "Content-Type: application/json" -X PUT -d '{"person":{"tags":[{"name":"One","_destroy":"1"}]}}' -# https://bonias.batchbook.com/api/v1/people/1594.json?auth_token=xxx | head -n 1
Are you trying to remove the tag from a contact or delete the tag in its entirety?
I'm trying remove tag from contact. I want contact to be equal:
{"person":{"id":1594,"about":null,"emails":[],"phones":[],"websites":[],"addresses":[],"tags":[],"comments":[],"cf_records":[],"created_at":"2015-09-22T10:32:10-04:00","updated_at":"2015-09-22T10:39:00-04:00","prefix":null,"first_name":"TestContact remove tag","middle_name":null,"last_name":null,"champion":false,"company_affiliations":[]}}
I think I do the same what is showed at xml example at https://github.com/batchblue/batchbook-api/blob/master/sections/people.md:
<tags type="array">
<tag>
<name>awesome</name>
</tag>
<tag>
<name>not awesome</name>
<_destroy type="integer">1</_destroy>
</tag>
</tags>
Unfortunately, there is no example using json format.
@Bonias @challengee looks like we've got an odd bug in tags. We should be checking for pretty much any truthy value on that _destroy flag but instead we're explicitly checking for "true" or a boolean true. We should have a full fix out later in the week. In the meantime you should be able to use "_destroy": "true"
instead of 1 and it will work. Sorry about the confusion and thanks for the bug report.
Here's a sample for Contact ID 17 in your account (just add your auth and subdomain)
curl -vH "Content-Type: application/json" -X PUT -d '{
"person": {
"tags": [
{
"_destroy":"true",
"name":"bbstaffer"
}
]
}
}' -# https://subdomain.batchbook.com/api/v1/people/17.json?auth_token=authtoken
It is working with "_destroy": "true"
. Thanks.
I have a problem with tags removing. I tried with (as documentation says):
but tags are not removed. I tried also:
and:
I'm able to destroy email without a problem, but tags are not removed.
Here is curl command: