secretlm
secretlm

Reputation: 2361

Can't tweet to Twitter using Api Twitter 1.1 in PHP

I send http-post to tweet to Twitter by https://api.twitter.com/1.1/statuses/update.json api But the response show an error:

array(1) { ["errors"]=> array(1) { [0]=> array(2)


{ ["message"]=> string(23) "Bad Authentication data" ["code"]=> int(215) } } } 

How to fix and can tweet to Twitter using the API? Thanks so much.

Note: I don't want to use 3rd library, just API Twitter Api to do that.

Upvotes: 0

Views: 1028

Answers (1)

user149341
user149341

Reputation:

One of the following is probably true:

  • Your application has not submitted a complete oAuth authorization request to Twitter, so it is not authorized to post on your account.
  • You have not submitted the appropriate fields to the update.json endpoint to indicate your authorization.
  • You do not have an oAuth implementation in place at all. Uh oh.

The oAuth protocol is required for applications which interact with the Twitter API, and is quite complex to implement. Unless you are a big sucker for pain and suffering, you should strongly consider using an existing implementation rather than trying to build your own.

Upvotes: 1

Related Questions