Im new to the twitter api and i’m trying to create a bearer token to start testing some of the api’s
but when entering:
curl -u “(api-key)-(api-secret-key)” / --data “grant_type=client_credentials” / “api.twitter /oauth2/token(but then correct url)”
It’s asking for "Enter host password for user ‘(api-key)-(api-secret-key)’: "
but i have no clue what the password should be
if i just hit enter i get “curl: (3) (url) malformed” , any ideas?
In your curl command, you should have the Consumer Key and Secret separated/joined by a colon :
curl -u "(api-key):(api-secret-key)" --data "grant_type=client_credentials" "https://api.twitter.com/oauth2/token"
That tells curl to send the Key and Secret as the two halves of a username and password parameter. It sounds like you’ve not got a colon in there, so it assumes you’re sending just the username, and prompts for the password. You also need the protocol (https) on the URL.
Thank you so much, not sure how i ended up replacing : by a -
system
Closed
#4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.