0

I am trying to implement Asana oAuth mechanism in my android application. I was successful in getting the access token after successful authentication and allowing access to my registered app. Is this token enough to perform API operations further ?? what are the corresponding URLs for the same?

Please help !!

Thanks

  • *Is this token enough to perform API operations further ??* **And what is written in the documentation?** *what are the corresponding URLs for the same?* **And what is written in the documentation?** – Selvin May 13 '15 at 13:25
  • In documentation , it was mentioned to use the API key , specific for user. As i am new to using oAuth2, I am just trying to understand. – user4890073 May 13 '15 at 13:41
  • API Key is only used to get the token(at least in the oauth use case senario) – Joran Beasley May 13 '15 at 19:23
  • I will explain what i have done so far .. I have created an activity with a webview, which loads the authorization url https://app.asana.com/-/oauth_authorize with client id, secret and redirect uri. My webview loads the url (login screen of asana). After succesful authorization and allowing access to my registered app, i am able to get the access token from the redirect uri. so far authentication is completed , now i want to retrieve user information like user Id, workspace information etc. How to start with that . I hope i could be able to make my question understand.. Thanks – user4890073 May 14 '15 at 04:03

1 Answers1

0

I assume you are using the implicit grant flow by passing response_type=token when directing the user to https://app.asana.com/-/oauth_authorize in order to get retrieve the access_token from the fragment of the redirect URI.

Once you have obtained the access_token you may use this token to make calls to the API by supplying it in the authorization header like this:

curl -H "Authorization: Bearer <ACCESS_TOKEN>" https://app.asana.com/api/1.0/users/me
Andrew Noonan
  • 848
  • 6
  • 13