Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETE requests return HTTP 401: 32 - "Could not authenticate you" #203

Open
sykezz opened this issue Jan 28, 2020 · 0 comments
Open

DELETE requests return HTTP 401: 32 - "Could not authenticate you" #203

sykezz opened this issue Jan 28, 2020 · 0 comments

Comments

@sykezz
Copy link

sykezz commented Jan 28, 2020

DELETE requests on the new Direct Message endpoints doesn't seem to work, as they are returning HTTP/1.1 401 Authorization Required with response {"errors":[{"code":32,"message":"Could not authenticate you."}]}.

I don't have any issues with DELETE account_activity/all/:env_name/webhooks/:webhook_id or other endpoints (including POST direct_messages/events/new with PR #202) .

I've tried passing the id into parameters, but it returns HTTP 401:

$tmhOAuth->user_request([
  "method" => "DELETE"
  "host" => "direct_messages/events/destroy"
  "url" => "https://api.twitter.com/1.1/direct_messages/events/destroy.json"
  "params" => [
    "id" => "0000000"
  ]
  "multipart" => false
 ]);

I've also tried adding the id into the url as query parameters, but then it returns me HTTP/1.1 400 Bad Request with response {"errors":[{"code":38,"message":"id parameter is missing."}]}. Apparently, the query parameters weren't passed at all since it was filtered out in prepare_url() method, so I made some adjustments to work around it, and it lead me back to HTTP 401 again :/

$tmhOAuth->user_request([
  "method" => "DELETE"
  "host" => "direct_messages/events/destroy"
  "url" => "https://api.twitter.com/1.1/direct_messages/events/destroy.json?id=0000000"
  "params" => []
  "multipart" => false
 ]);

Furthermore, the follow PUT request has the same issue as well (requires PR #202 and c9f0f47).

$tmhOAuth->user_request([
  "method" => "PUT"
  "host" => "direct_messages/welcome_messages/update"
  "url" => "https://api.twitter.com/1.1/direct_messages/welcome_messages/update.json?id=1111"
  "params" => "{"message_data":{"text":"Updated welcome message"}}"
  "multipart" => false
 ]);

Any help would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant