Clarity

 View Only
Expand all | Collapse all

Utilizing REST API (perhaps efficiently)

  • 1.  Utilizing REST API (perhaps efficiently)

    Posted Jan 27, 2021 03:11 AM
    Hello Everyone.

    We are currently in Clarity v15.8.1 and we are using REST API to interface with External Applications.
    We are allowing Other Applications to update Project, Task and Assignments through OOB REST API.

    To Update Assignments for a Project, Assume

    1. There are 10 Tasks
    2. We need to assign a resource to each of these task

    The External Application needs to make 10 API Calls to
    POST : /projects/{projectinternalid}/tasks/{taskinternalid}​


    The Users feel it adds an overhead to the network in this approach. They want to achieve the same with one API call, may be to 

    POST : /projects/{projectinternalid}/tasks


    with the tasks and assignment passed as array of objects.

    is it possible OOB? Can some customization be done to achieve the expected result?



  • 2.  RE: Utilizing REST API (perhaps efficiently)

    Broadcom Employee
    Posted Jan 27, 2021 07:03 AM

    Yes we do support expand and we have documented the same too. Please review our API documentation under Expand Query Parameter

    https://techdocs.broadcom.com/us/en/ca-enterprise-software/business-management/clarity-project-and-portfolio-management-ppm-on-premise/15-8-1/reference/Clarity-REST-APIs/rest-api-documentation-for-authorized-developers.html

    projects/5000001?expand=(tasks=(fields=(code,startDate,costType)),teams)

    The expand query parameter in URL indicates that resources associated with the REST resource must be represented inline within the response.



    ------------------------------
    Thanks & Regards
    Suman Pramanik
    Sr. Principal Support Engineer | Customer Success & Support, Enterprise Software Division
    Broadcom
    ------------------------------



  • 3.  RE: Utilizing REST API (perhaps efficiently)

    Posted Jan 27, 2021 09:09 AM
    Hi Suman,

    Thank you for your quick response. We have used expand query for GET request.
    Can we do the same for POST/PATCH or PUT?

    Can you confirm on this.

    Thanks


  • 4.  RE: Utilizing REST API (perhaps efficiently)

    Broadcom Employee
    Posted Jan 27, 2021 01:12 PM

    The batch limit for bulk is 50 only at this point and here is the documentation 

    https://techdocs.broadcom.com/us/en/ca-enterprise-software/business-management/clarity-project-and-portfolio-management-ppm-on-premise/15-8/reference/rest-api-documentation-for-authorized-developers.html#concept.dita_a02421bf966fed381bd1178ddc1b6ec319b070fb_SampleAPIRequestsandResponses

    You can't get multiple projects and multiple tasks and multiple assignments in a single request, but you can get multiple projects and multiple tasks. "multi" part goes at 2 levels only.  This is different from saying "bulk". This is giving you data for different related objects.


    POST/PATCH/DELETE
       You can bulk "PATCH" (or POST/DELETE) up to 50 instances in a single API call. This avoids HTTP overhead. (Remember that behind the scene, it still processes the records one by one). You can't create tasks (subobjects) for multiple projects in the same call, but you can create multiple tasks for the same project in one call.



    ------------------------------
    Thanks & Regards
    Suman Pramanik
    Sr. Principal Support Engineer | Customer Success & Support, Enterprise Software Division
    Broadcom
    ------------------------------



  • 5.  RE: Utilizing REST API (perhaps efficiently)

    Posted Jan 27, 2021 01:57 PM
    And can we update multiple tasks and multiple assignments in a single project at once?


  • 6.  RE: Utilizing REST API (perhaps efficiently)

    Broadcom Employee
    Posted Jan 27, 2021 02:00 PM
    You can't create tasks (subobjects) for multiple projects in the same call, but you can create multiple tasks/assignments for the same project in one call.

    ------------------------------
    Thanks & Regards
    Suman Pramanik
    Sr. Principal Support Engineer | Customer Success & Support, Enterprise Software Division
    Broadcom
    ------------------------------



  • 7.  RE: Utilizing REST API (perhaps efficiently)

    Posted Jan 27, 2021 02:06 PM
    Hi Suman,

    Thank you once again for quick your responses, considering my endpoint being

    POST : /projects/{projectinternalid}

    Can you please give be a sample JSON file that will create/update both tasks and assignments in a single call?
    Not Urgent. If you can let me know when possible it would be great.

    Thank You.

    Regards,

    Velayutham Palaniappan


  • 8.  RE: Utilizing REST API (perhaps efficiently)

    Broadcom Employee
    Posted Jan 28, 2021 04:24 AM
    Sure I will try out few and share.

    ------------------------------
    Thanks & Regards
    Suman Pramanik
    Sr. Principal Support Engineer | Customer Success & Support, Enterprise Software Division
    Broadcom
    ------------------------------