help getting data

Hi

I’m trying to get all the data of specific project_id via the API.
we are looking to automate the manual download of the CSV,
which API should we use? (currently I’m using the personal token)

can you give me some code sample of getting all the tasks in the project including the customed fields?

Hi,

Did you check out the official library documentation as well as existing librairies like nodeJS GitHub - Asana/node-asana: Official node.js and browser JS client for the Asana API v1?

Regarding the personal token, that would be fine for a script you run yourself. You can also use OAuth if you need users to log in themselves. Just be careful not sharing your token with anyone, it gives access to your whole account.

Hope that helps.

Hi @Bastien_Siebman
Thanks for your answer,

I did look at the libraries (python-wise).

I succeeded to get the data of the project. I got the gid of all tasks in the project and then used another API to get the data within each task. That being said, it seems odd to me that I need to request the data within any task by itself. Is there a way to get all the data of all tasks in batches?

Thank you
Ziv

Yes you need to use opt_fields to ask for specific field in the first answer from the server.

I had the same goal of automating the manual download of the CSV. I used Power Query within excel to make the API call and create a table from the data that I needed at the project and task level. I did not go down to the subtask level.

I have attached a snipping of the Power Query call that I made. @Bastien_Siebman is correct in that you need to use the opt_fields to get the desired fields for each resource_type. My first API call ask for a list of projects under a [Team], and my second API call “Project Function” passed through each unique project gid under that [Team] into the call to get all the task under that Project.

  • API Call 1 → /teams/{team gid}/projects?opt_fields=…
    *API Call 2 → /workspacesw/{workspace gid}/teaks/search?projects.any={project gid}&opt_fields=…


1 Like