Forum Discussion
AbleMPeter
Feb 21, 2025Copper Contributor
MSP online: How to fetch all the TASK relationship?
How to fetch all the TASK relationship (Predecessor, lag, dependency type (SS,FS) using RestAPI?
RodFromm
Feb 27, 2025Steel Contributor
I do something similar in Power BI.
The ProjectServer TaskLinks endpoint contains the task successor/predecessor, task type, etc information. you'll need.
https://<PWA>/_api/ProjectServer/Projects?$select=ProjectIdentifier,TaskLinks
This link contains the definition of the DependencyType field in the TaskLinks table
https://learn.microsoft.com/en-us/previous-versions/office/project-class/jj232950(v=office.15)?redirectedfrom=MSDN
- AbleMPeterMar 06, 2025Copper Contributor
We are currently using the MS Project Server API to retrieve tasks and their associated task links for a specific project. At the moment, I make individual API calls for each task and its predecessors, which leads to thousands of requests—for example, 3,000 tasks result in over 6,000 API calls. This approach causes significant performance issues.
I am using these endpoints:
- To fetch task predecessors:
pwa/_api/ProjectServer/Projects('{ProjectId}')/Tasks('{taskId}')/Predecessors - To fetch task links:
pwa/_api/ProjectServer/Projects('{ProjectId}')/TaskLinks('{taskLinkId}')/Start
- Is there an alternative method or endpoint that would allow me to retrieve all tasks and task links for a project in a single or significantly reduced number of requests?
- Also is there any proper documentation for this APIs?
- RodFrommMar 09, 2025Steel Contributor
Is there a reason you have to call each task individually? If not, refer to my post to get all TaskLinks in one call, or you could write a function to retrieve them one project at a time? It's hard to provide an answer without knowing what your process/requirements. Regarding documentation.....good luck MS Project Online is not supported and documentation is sparse at best.
- To fetch task predecessors: