legacy-api-documentation
legacy-api-documentation copied to clipboard
Tags are randomly surrounded by quotes
Hi!
I've uploaded a photo with the following tags: uno, due, tre, quattro, cinque, sei. It succeeded, but the tags which have been set on the photo are:
uno "due" tre "quattro" cinque "sei"
It looks like every other one has extra quotes around it.
Hey Alberto,
can you send the full request (the body) you're sending?
Cheers, Martin
Sure, here it is (tokens redacted):
auto_activate=true&category=0&description=&name=&privacy=0&tags=%22uno%22,%22due%22,%22tre%22,%22quattro%22,%22cinque%22,%22sei%22&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_consumer_key=AAA&oauth_token=BBB&oauth_timestamp=1513629238&oauth_nonce=966420642&oauth_signature=CCC
And the photo has been uploaded here
Actually, the tags are not visible in the link I sent you, but in my "manage photos" page I can see them: and "due", "quattro" and "sei" have double quotes around them.
I see, so just to make sure - you're trying to have tags with quotes around them but only every other tag ends up with the quotes, correct?
Correct, except that I don't want to have any quotes around tags. :-)
So what if you just set them without quotes?
auto_activate=true&category=0&description=&name=&privacy=0&tags=uno,due,tre,quattro,cinque,sei&oauth_signature_method=...
That wouldn't work?
I need to try. But then, can I add tags containing a comma? Or are there some restrictions on what characters can be used in tags?
can I add tags containing a comma?
Not really, no. But then tags with a comma don't make that much sense, no? Do you have some examples in mind?
Well, in some cases they are used, but I agree it's not a typical use-case. The important thing is to know which characters are allowed and which are not. :-)
If you really need to have comma in a tag, you can send an array of tags, eg.
auto_activate=true&category=0&description=&name=&privacy=0&tags[]=uno&tags[]=due,tre&tags[]=quattro&tags[]=cinque,sei&oauth_signature_method=...
should result in tags uno, due,tre, quattro, cinque,sei
But then again, I'd argue that if you need to have
a comma in a tag, those should be two standalone
tags. Like you have Roma, Italy, it should really
be Roma, Italy.
OK, I've tried it and it seems to be working. I can even upload tags with quotes in them, which is good. However, I tried to upload a tag that's life and it failed. This is the body:
auto_activate=true&category=0&description=&name=&privacy=0&tags=that%27s life&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_consumer_key=AAA&oauth_token=BBB&oauth_timestamp=1513711992&oauth_nonce=1662534350&oauth_signature=CCC