UpdateDelegation : The remote server returned an error: (400) Bad Request.

Answered

Comments

4 comments

  • Avatar
    Harish Lakshmana

    Prakashkumar, the values of 'FromUser' and 'ToUser' should be an actual AgilePoint user such as domainname\username or username@company.com.

    For better understanding capture and log the WebException response data. It might include information like Invalid user 'NAMBP4123'. 

    You can also copy paste the payload to postman which will always read response data from WebException. Call the same API from postman to easily identify the reason for the (400) Bad Request.

    4
    Comment actions Permalink
  • Avatar
    Chaitra

    Hi Prakashkumar,

    1) To Update delegation, DelegationID is mandatory. Try passing the DelegationID along with other properties in payload.

    2) The payload you are making use of will let you create a Delegation. if you are actually trying to AddDelegation, then you will have to change the endpoint.

     

    Hope you find this answer helpful.

    2
    Comment actions Permalink
  • Avatar
    Aviksha Ramya Koneri

    Hi Prakash,

    You may need to modify your jsonRequestData to make your code work. We should mention domain name in the values of FromUser and ToUser, and Delegation ID is required for update delegation.

    You can refer below payload

    {

        “DelegationID”:”DELEGATIONID”,
        "FromUser":"DOMAINNAME\\NAMBP4123",
        "ToUser":" DOMAINNAME\\SVIJA2987",
        "StartDate":"/Date(1714674600000+0000)/",
        "EndDate":"/Date(1715106600000+0000)/",
        "Description":"testing ewwrwer",
        "Status":"Active"
    }

    Modification: Replace DELEGATIONID with your delegation ID and DOMAINNAME to your Domain name.

    Document Link: https://documentation.agilepoint.com/11/developer/restmethodUpdateDelegation.html

    2
    Comment actions Permalink
  • Avatar
    Prakashkumar Nambi

    Thanks a lot Chaitra,Harish Lakshmana and Aviksha Ramya Koneri its working as expected.

    0
    Comment actions Permalink

Please sign in to leave a comment.