How do I find my user id?

I want to create an automated task that requires my user id - how do I find my user id #?

2 Likes

Mark,

While logged into Asana in your browser, click here:
https://app.asana.com/api/1.0/users

That should display some information including your User Id.

6 Likes

Hi Phil,

I used to be able to use this link to extract the User IDs but, it seems like this link has some threshold.
I’m getting the followin error right now, could you please help me to fix this issue or show me a way that I can extract users’ IDs individually?
{“errors”:[{“message”:“The result is too large. You should use pagination (may require specifying a workspace)!”,“help”:“For more information on API status codes and how to handle them, read the docs on errors: Build an app with Asana”}]}
I tried to fix it but I wasn’t able to do that.

Thanks,
Ali G

Hi @Ali_G and welcome to the forum,

Yes, there’s a limit of 100 max records that Asana will return from the API in one call, and the default is 10 so you likely have now gone over 10 users.

I would recommend using the Asana API Explorer as it can help you with the paging.

Do this call:
image

and set the limit to 100:
image

1 Like

Thank you. That solve my problem.
Ali G

1 Like

Asana API Explorer Doesn’t work anymore.
Is there any other way that I can export the user ID?

Thanks,
Ali G

@Ali_G Pretty sure they are in the process of fixing the API Explorer.

@sasha_f @Kem_Ozbek ?

1 Like

@Ali_G Yes, as @Phil_Seeman said we’re working to fix the API Explorer asap.

2 Likes

I found the other way with the API that you can get the gid.
If you know the user’s email, you can get the gid from the URL below by replacing the USEREMAIL with the user’s email
https://app.asana.com/api/1.0/users/USEREMAIL

Thanks,
Ali G

2 Likes

Is there a way to get a combination of the two outputs? For reference, https://app.asana.com/api/1.0/users works great for giving me a list of all users but it doesn’t list emails whereas https://app.asana.com/api/1.0/users/USEREMAIL has both the email and the gid in the same place. Is there a way to see both the gid and email for all users?

You bet! Do this: https://app.asana.com/api/1.0/users?opt_fields=email

1 Like