0

I am trying to post a status from website to a Twitter account and succeeded using https://api.twitter.com/1.1/statuses/update.json API and with the help of this link.

When I try to add another parameter URL like &url= http://t.co/ReadMore&expended_url=https://www.google.com included with the status to post on twitter it gives error:

The remote server returned an error: (401) Unauthorized.

Can some one guide me how to add URL parameters with status? I searched a lot but not succeeded.

Community
  • 1
  • 1
Asad kamal
  • 45
  • 1
  • 10

1 Answers1

1

If you look at the API documentation for that endpoint, you'll see that it does not accept arbitrary parameters. The only parameters allowed are status, in_reply_to_status_id, possibly_sensitive, lat, long, place_id, display_coordinates, trim_user, media_ids. If you want to add a url as part of the tweet, you'll need to encode it and include it in the "status" parameter.

Rob Watts
  • 6,866
  • 3
  • 39
  • 58