How can i get user timline into my website also how can i post status on user timeline


#1

Hello friends,
i tried a lot for this but i did’t get any thing.
i saw documentatioin from
https://dev.twitter.com/rest/public/timelines
after that i paste url into by browser:
https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=socialpostdemo&count=2
but it shows following error:
{“errors”:[{“message”:“Bad Authentication data”,“code”:215}]}
\

i integrate api using PHP Please give sample code or any reference which is working fine,so i can easily access twitter api .


#2

Hey welcome!
One of the most important things to note first, is that all API endpoints (except oembed) require authentication. The authentication is done using OAuth 1.0a, and there are several PHP libraries that can do that for you, you might want to take a look at TwitterOAuth, a PHP library especially made for Twitter’s oAuth implementation.

I hope this helps a bit and feel free to ask if you don’t understood something.


#3

sorry but there is no sample code to show how we use code in php and where we have to put .so if you have some working sample please give me.


#4

There is sample code on the TwitterOAuth Website. If you need even more, please have a look at this GitHub repo.


#5

Thanks ePirat.it’s working