Problem with updating Item TagRelations.Tag

in Development
Hello Everyone,
I am currently experiencing a problem with trying to update the tags of items through the API.
The query string is: "{"Tags": {"Tags": ["a", "b"]}}"
And the error returned is: "{'httpCode': '500', 'httpMessage': 'Internal Server Error', 'message': 'Can not convert an array to XML when array has numeric indexed values.', 'errorClass': 'Exception'}"
If I only put one tag in the query which looks like: "{"Tags": {"Tags": "a"]}}", the update is successful. So as the error suggests, there is a problem with the array.
I have searched all the documentation but did not find an answer.
Please advise the correct way to update multiple tags or append tags to existing ones.
Thank you.
I am currently experiencing a problem with trying to update the tags of items through the API.
The query string is: "{"Tags": {"Tags": ["a", "b"]}}"
And the error returned is: "{'httpCode': '500', 'httpMessage': 'Internal Server Error', 'message': 'Can not convert an array to XML when array has numeric indexed values.', 'errorClass': 'Exception'}"
If I only put one tag in the query which looks like: "{"Tags": {"Tags": "a"]}}", the update is successful. So as the error suggests, there is a problem with the array.
I have searched all the documentation but did not find an answer.
Please advise the correct way to update multiple tags or append tags to existing ones.
Thank you.
Tags:
5 comments
There is a bug in our API that doesn't allow you to add multiple tags using a JSON formatted request. You have to enter it in via XML like this:
Request URL:
https://api.lightspeedapp.com/API/Account/{{accountID}}/Item/{{itemID}}
Request Method: PUT
Request Payload:
Hope this helps!
Adrian Samuel
Software Developer
Lightspeed HQ
Thank you for the quick response!
Has this bug been fixed?
Also where did you find the documentation on where to add tags to an item?
Hi @Quincey,
Here is some more information on the tags:
* If the product already has a tag an update will overwrite the existing tag(s),
* Using JSON you can only create/update the item with one tag, and
* For multiple tags creation/update you will need to use XML.
Example JSON Payload:
Example XML Payload:
Hope this helps.