legacy-api-documentation icon indicating copy to clipboard operation
legacy-api-documentation copied to clipboard

Tags are randomly surrounded by quotes

Open mardy opened this issue 8 years ago • 11 comments

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.

mardy avatar Dec 09 '17 12:12 mardy

Hey Alberto,

can you send the full request (the body) you're sending?

Cheers, Martin

mck182 avatar Dec 18 '17 19:12 mck182

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

mardy avatar Dec 18 '17 20:12 mardy

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.

mardy avatar Dec 18 '17 20:12 mardy

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?

mck182 avatar Dec 18 '17 21:12 mck182

Correct, except that I don't want to have any quotes around tags. :-)

mardy avatar Dec 19 '17 06:12 mardy

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?

mck182 avatar Dec 19 '17 17:12 mck182

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?

mardy avatar Dec 19 '17 18:12 mardy

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?

mck182 avatar Dec 19 '17 18:12 mck182

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. :-)

mardy avatar Dec 19 '17 18:12 mardy

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.

mck182 avatar Dec 19 '17 19:12 mck182

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

mardy avatar Dec 19 '17 19:12 mardy