Hi!
I’ve been playing around with the twitter API. I can access most end points I need without issues, but I am having issues with the ‘hide reply’ end point.

I know that I must specify the the ID of a single reply to hide it, but I’m getting a 401 error. I’ve generated all tokens (all 4) and have provided them in PostMan. The other end points I’m hitting are responding with the information I expect.

I suspect it is something to do with the fact that I am hiding a reply of my own account but haven’t added an authenticated user. But, the docs say explicitly that I don’t need to do this because It is my account, so I can use the API Key and Secret Key.

Is it potentially that doing this with PostMan is causing the issues?
Have you guys got this workign from Curl/TWurl?
Is there any other configurations I need to add for PostMan.

Thanks :slight_smile:

Interesting! where does it say about the API key only? I thought hide replies was always User Auth Only - PUT /2/tweets/:id/hidden | Docs | Twitter Developer Platform so you have to have API key, API Secret and Access Token & Secret.

sigh i don’t think i can find the bit that made it really obvious to me now but i’ll share this:

on this page it says:

To properly make a request to the Twitter API, you need to verify that you have permission to do so. To do this with the PUT /tweets/:id/hidden endpoint, you must authenticate your request with OAuth 1.0a User Context. The Postman collection is already configured to perform all the steps to generate the OAuth signature for you

And when you go to oAuth 1.0a it says at:

Think of these as the user name and password that represents your Twitter developer app when making API requests.

to use your consumer key and consumer secret.

Maybe i’m not understanding and even if this is blocking replies FOR YOURSELF you still need to set up additional authentication.

Best,
Matthew

OK.

Consumer Key (API Key) + Consumer Key Secret (API Key Secret) == the identity of the app. You will get both of these values in the developer portal when you create the app. You should treat them as sensitive values.

Access token + Access Token Secret == the values that prove that you, are you. Combined with the above Consumer (API) values, you have 4 secret values that enable YOU, to post to or access Twitter, via an App. You can get these for you (as app owner) in the developer portal. If you are not the app owner, you need to go via sign-in with Twitter, to get those 2 values back.

For Hide Replies, you definitely need all 4 values, and for the Tweets you are looking to hide replies on, you need the access token and secret for the owner of the Tweet.

1 Like

Just wanted to let you guys know what the solution was.
Andy, I was indeed following these steps correctly as I had thought. However, I was trying to reply one of my own replies to my status, rather the reply of someone else.
When I went through the process again (slowly) and read every bit of documentation I found:

“Ask a friend to reply to a Tweet (let them know you’re testing hide replies)”
so I quite literally asked a friend, retried the API and it worked.

Thank you for your help

1 Like