Twitter Preview with non alpha numerics


#1

Oh no’s this seems to fail :frowning:

GET https://ads-api.twitter.com/0/accounts/nzpij/tweet/preview?media_ids=705544330602098688&status=Hello+World+!

Maybe a POST method would be better, what do you think ?

Marc


#2

It fails how? What is the response?


#3

{“errors”:[{“code”:“UNAUTHORIZED_ACCESS”,“message”:“This request is not properly authenticated”}],“request”:{“params”:{}}}

But when I try it without an exclamation mark, not a problem.


#4

The status parameter should be properly url-encoded. For example, in PHP you would use urlencode('Hello World !'), which would give Hello+World+%21 - note that the exclamation point is encoded too, with the rest of the data.


#5

Doh. You are correct, solved

Mar 04, 2016 7:56:59 AM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 1 * Client out-bound request
1 > GET https://ads-api.twitter.com/0/accounts/nzpij/tweet/preview?media_ids=705544330602098688&status=Hello%2BWorld!
1 > Accept: application/json


#6

:slightly_smiling: Then, could you please mark the answer as the solution? So others know this topic has been solved. Thank you!

Edit: the solution is in post number 4, not 5. :slight_smile: