Clarity

  • 1.  REST APIs + Project PUT Operation (14.3)

    Posted Jul 13, 2017 06:38 PM

    So REST API for Project PUT operation expects all attributes. Does that mean each and everyone or just Non-Optional defined into REST APIs?

     

    I'm getting following error: "API-1020 : Could not update resource(s). All attributes are required."

     

    From Model Schema I could see below are non-optional and even with passing these attributes I'm getting above error.

     

    Project {
    pageLayout (SVLookupNumber): Page Layout ,
    name (string): Investment Name ,
    percentCompleteCalcMethod (SVLookupNumber): Percent Complete Calculation Method ,
    status (SVLookupNumber): Status ,
    code (string): Investment Unique Name ,
    scheduleStart (string): Schedule Start ,
    scheduleFinish (string): Schedule Finish ,
    assignmentPool (SVLookupNumber): Can be set to allow Managers to add non-Team members to Task,
    progress (SVLookupNumber): Progress

    }

     

    Sample data used into REST API URL (http://clarity-server.com/niku/rest/describe/index.html) for testing:

    {
    "pageLayout": "50240",
    "name": "This is Project",
    "percentCompleteCalcMethod": "0",
    "status": "1",
    "code": "PRJ0181000",
    "scheduleStart": "2016-12-01T08:00:00",
    "scheduleFinish": "2017-12-31T17:00:00",
    "assignmentPool": "1",
    "progress": "1"
    }



  • 2.  Re: REST APIs + Project PUT Operation (14.3)

    Posted Jul 14, 2017 12:21 AM

    Hi DJ.V 

     

    If you want to update only few attribute instead of all, then you should be using PATCH instead of PUT.

     

    Regards,

    Prashank Singh



  • 3.  Re: REST APIs + Project PUT Operation (14.3)

    Posted Jul 14, 2017 09:46 AM

    I understand that already but Data is coming out of other system and it does not support PATCH.

     

    My question is about PUT for a reason.

     

    Sorry if my question is not clear, specifically Is PUT operation requires all attributes in Project object or Project REST fields? Why REST definition says optional against some fields?

     

     

     

    Thanks & Regards,

    DJ



  • 4.  Re: REST APIs + Project PUT Operation (14.3)
    Best Answer

    Posted Jul 17, 2017 02:56 AM

    Hi DJ.V ,

     

    If system is blocking patch then you can follow a work around.

    Method: PUT 

    Set Connection Header Property: x-api-force-patch = true

    By this connection will allow PUT method to update Project infromation without passing all attributes.

     

    Do let me know if this work around works for you.

     

    Regards,

    Prashank Singh



  • 5.  Re: REST APIs + Project PUT Operation (14.3)

    Posted Jul 19, 2017 12:24 PM

    Thanks Prashank.Singh. Let me try that out. This has been show-stopper.I'll pray it works. Thanks again.