This user-authenticated POST request to create a webhook endpoint fails

Request

curl -X "POST" "https://api.twitter.com/1.1/account_activity/all/dev/webhooks.json?url={Active URL-Encoded Endpoint}" \
     -H 'Authorization: OAuth oauth_consumer_key="{Consumer API Key}", oauth_nonce="{Created by PAW.app}", oauth_signature="{Created by PAW.app}", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1537901078", oauth_token="{Access Token}", oauth_version="1.0"'

Response

{"errors":[{"code":32,"message":"Could not authenticate you."}]}


This user-authenticated GET request to verify credentials works as expected:

Request

curl "https://api.twitter.com/1.1/account/verify_credentials.json" \
     -H 'Authorization: OAuth oauth_consumer_key="{Consumer API Key}", oauth_nonce="{Created by PAW.app}", oauth_signature="{Created by PAW.app}", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1537901334", oauth_token="{Access Token}", oauth_version="1.0"'

Response

{"id":[snipped full response],"suspended":false,"needs_phone_verification":false}


EDIT 1: Additionally, with twurl installation authenticated to the same app, I receive the same error when requesting to add a new webhook.

EDIT 2: The sample Account Activity Dashboard app configured with ngrok tunnel works, allowing me to create a webhook (so I can now proceed with configuring the CRC response, etc.) but I’d still like to know what went wrong with the straight curl request.

Relevant notes:

  • Developer account (same as Discourse username) is approved for premium endpoints
  • Application environment named dev was created…
  • …for the app’s tokens I’m using
  • OAuth headers generated via PAW.App using same workflow I’ve used with other OAuth 1-authorized endpoints.
  • App has Read, write, and direct messages permissions
  • Connection hash of recent failed request: 100bdb3537d5d11c0cbaad0e1b4b02da

Any advice on where to go from here?

Hi @spdustin

Have you regenerated your access_token and access_token secret (within your app at https://developer.twitter.com/en/apps) AFTER changing any permissions (Read,Write,DirectMessages)?

Code 32 seems like an oauth error or signature error… likely not the AAA

Everything else looks correct for creating a webhook and all the checks you’ve mentioned check out.

We have more details on this on our troubleshooting page.

Hey @spdustin,

Any luck with these additional instructions?

I’ve since used the sample dashboard app to register my dev webhook, so for now, I’ve moved past this blocker. Thanks for checking in.

1 Like