How to POST status update with link (using postman)


#1

Hi everyone,

I’m trying to post a status update that contains a youtube link using POSTMAN.

POST https://api.twitter.com/1.1/statuses/update.json?status=https://www.youtube.com/watch?v=vpaPWuDQUcc

Tried to post the link as a value to the status parameter but I get:
{
“errors”: [
{
“code”: 32,
“message”: “Could not authenticate you.”
}
]
}

What am I not understanding/doing wrong?

Don’t judge hard, I’m new to all this.
Help will be much appreciated.

p.s.: if I use say “www.google.com” without additional suffixes - it goes thru.


#2

I think you need to url encode status text https://developer.twitter.com/en/docs/basics/authentication/guides/percent-encoding-parameters.html

so https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvpaPWuDQUcc should work


#3

Thank you, Igor.
I tried your option and it still doesn’t work.

I guess that’s a premium option, that’s why it’s not available.


#4

Oh, posting tweets should work just fine - it’s not a premium feature.

Are you sure postman is including all the headers for signing the call correctly? You need to make sure to include those: https://developer.twitter.com/en/docs/basics/authentication/guides/authorizing-a-request.html

The awkward one is the timestamp - if it’s out of sync it can also cause an Authentication error.


#5

So, I’m able to tweet plain text (ex.: “Hello World”) but not able to tweet URLs and user mentions.
I use OAuth 1.0 and keep the Timestamp value empty.


#6

oh, weird - not really sure why that is to be honest! I would have expected “hello world” to also fail if it’s missing headers. I’d maybe try the example with one of the Python / Java / other language libraries instead of postman https://developer.twitter.com/en/docs/developer-utilities/twitter-libraries.html


#7

Unfortunately I’m not familiar with these languages yet.
However, If I’ll find an answer to my question in the next 2 weeks, I’ll post it here.

Thanks for your time, Igor.


#8

@ion_secrieru Just wanted to give you a hint for this. This is likely an issue around OAuth signature generate flow which Postman does internally and we really don’t have control over well.

As a workaround, you can perhaps use request “body” instead of request parameters.

  1. Select x-www-form-urlencoded in Body tab and set key and value as needed:

  2. Make sure “Content-Type” request header is set and its value is application/x-www-form-urlencoded:


#9

Igor, thank you. Will give it a try and let you know how it goes.

Cheers,

Ion