Parent IDs in API

I noticed in the API response for tasks that the parentIds only returns 1 value in the array. Is there ever a time that it returns more than one? And if so, is 0 always the first or the one with the highest order to the root of the tree?

0
5 comentários
Spot On Innovative Approach Stellar Advice
Avatar

I'm currently doing some experimenting with this. Here's what I've learned:

If you append the following to a "tasks" call, it will return all associated parent ids (eg: if a task or project exists within multiple folders, it will return an ID for each parent folder):

?fields=["parentIds"]

Parent Folder is defined as the closest folder(s) above a task, project, or subfolder. I have not figured out how to get IDs from any folders higher in the folder structure yet.

Curious to know this as well.  

 

 

0
Ações de comentário Permalink
Spot On Innovative Approach Stellar Advice
Avatar
Stephen

Hi Tim & Shane,

For this, you'll need to query individual folders to get the IDs of their parent IDs.

I reckon this might work better if you save the Folder tree information and update it every so often so you can reference the parent Folder local data and reduce the number of API calls.

 

0
Ações de comentário Permalink
Spot On Innovative Approach Stellar Advice
Avatar

Hey Stephen,

That's how I'm solving the problem at the moment. Saving those parent folders to a cached JSON file and then updating it as additional required folders are added. 

Has there been any discussion about creating a field where we can set what the authoritative or home folder ID? I know this would help slim down on the number of API calls I make to figure out a few other things.

Thanks!
Tim

0
Ações de comentário Permalink
Spot On Innovative Approach Stellar Advice
Avatar
Stephen

Hey Tim, sorry for the delay getting back. There are no plans for this at the moment, but I've shared your interest with the relevant team so this could change in the future. I'll post back here to let you know if there are any updates 👍

0
Ações de comentário Permalink
Spot On Innovative Approach Stellar Advice
Avatar

Thank you for your help Stephen. 

0
Ações de comentário Permalink

Folllowing List for Post: Parent IDs in API
[this list is visible for admins and agents only]

Didn’t find what you were looking for? Write new post