Retrieve all projects in express


I am trying to retrieve all projects in express, and this is my code.
var Asana = require(‘asana’);
var client = Asana.Client.create({
clientId: ,
redirectUri: ‘http://localhost:8000

When I print client.projects, it only shows
Projects {
Dispatcher {
authenticator: OauthAuthenticator { credentials: [Object], flow: null, app: undefined },
asanaBaseUrl: ‘’,
retryOnRateLimit: false,
handleUnauthorized: [Function],
_cachedVersionInfo: null,
requestTimeout: null } }

So how can i retrieve all the projects? Thanks.
If possible, please show me any related information, thanks a lot!


Your authentication process went smoothly and Asana sent the user back to your app with a token?


Hi Bastien, thanks for your reply. Do you mean this?
when i try this code: (user) {
I can get the user id, email, name, photo, and workspaces after print the “user”.
And I need to retrieve all the projects from this workspace. What kinds of syntax I can use? And where can I check those syntax from documentation? I have read the github code( but I didn’t see it.


Hey @Jiahao_Yu,

Thanks for reaching out. To get all projects you use the function findAll(), which requires at least one param (e.g. workplace, team, archived).

Here’s an example of getting all projects in a workspace using the Node client library:

	.then(function(response) {

You can find the code to get all projects on line 160 of projects.js in the Asana Node client library.



@Jeff_Schneider Thank you very much! That’s what I need!


@Jeff_Schneider Hi Jeff, I have one more question about this.
I am trying to retrieve one specific project, after read the documentation, I try this code:
client.projects.findById({ “project”: 12345678}).then(function (response) {
but it doesn’t work.
In the documentation,
Projects.prototype.findById = function(
) {
var path = util.format(’/projects/%s’, project);

return this.dispatchGet(path, params, dispatchOptions);
How can i make the correct format of the params? Thanks a lot.


Hey @Jiahao_Yu,

You just need to pass the project_id as a param:

	.then(function(response) {