Rest api authentication issue


#1

Hi,
I am trying to generate signature in order to connect to twiiter search api but i am getting could not authenticate you can you please help me with this


#2

You can generate your own keys in the App settings https://developer.twitter.com/en/apps details under “Keys and tokens” so you don’t have to use any Oauth APIs to just use the Search API.

If you’re getting errors when signing & making calls to the search api it’s probably something else.


#3

Hi
I have tried to follow twitter search api documentation in the api call it is asking for auth signature and auth nonce i have tried to use current time now but i am getting could not authenticate you status code :32.


#4

You can use a Library in your preferred language to help you make and authenticate calls to the API https://developer.twitter.com/en/docs/developer-utilities/twitter-libraries.html instead of trying to do it yourself, it’s way easier that way.


#5

ok i will try implementing this but if i have to do this on my own then what approach should i follow?


#6

I’d avoid re-implementing things like oauth / adding headers to http calls etc. and use an already working library like https://github.com/geduldig/TwitterAPI but if you really want to do things from scratch, taking an existing library and looking at how things are implemented there should be a good approach to take.


#7

Ok i am trying to implement twitter api in react native and so the library mentioned is not helping me so want to know the way how it can be implemented


#8

I don’t know enough about React but I guess if React Native is a JavaScript framework, i assume a Javascript twitter library will work: https://www.npmjs.com/package/react-native-simple-twitter


#9

can you tell me that the bearer taken obtained from twitter oauth2/token api will expire in how many days?


#10

They don’t expire unless revoked: https://developer.twitter.com/en/docs/basics/authentication/FAQ

Have a look at this too for how to store them: https://developer.twitter.com/en/docs/basics/authentication/guides/securing-keys-and-tokens.html


#11

thanks for the help :slight_smile:


closed #12

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.