Docusign Webhook POST API - how to get body?

Hi All - I've created an integration with Docusign and have configured the Web API to receive a response from Docsign when the document is signed. Docusign responds and successfully kicks off the process, but I can't figure out how to pull the envelopeid and documentid from the message response.  I've got the sample code that converts the http!request.body from json to a processparameter. But I can't figure out how to get the data from there? I've tried converting to process variables and various settings within the Start Trigger panel, but haven't been able to see the message body/data anywhere.

Any guidance would be appreciated.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi, 

    In your Appian process model, create a variable of type Text or dictionary to receive the raw JSON payload. Modify your Web API to pass http!request.body directly into the process variable you created.. In your process model, parse the JSON from the Text variable into a Dictionary using a!fromJson() within a Script Task.and after parsing, extract envelopeId and documentId from the Dictionary variable in subsequent Script Tasks or Gateways.

    a!startProcess(
    processModel: cons!WMO_Docusign_Receive,
    processParameters: { jsonText: http!request.body },
    onSuccess: a!httpResponse( /* success response */ ),
    onError: a!httpResponse( /* error response */ )
    )

    And in your process model, you would have a parameter, let's say jsonText, to capture the raw JSON. Then, in the first Script Task.

    local!jsonData: a!fromJson(local!jsonText),
    local!envelopeId: local!jsonData.envelopeId,
    local!documentId: local!jsonData.documentId

    ---By doing this, the process starts with the complete JSON payload, which you then parse and manipulate within the process model.

    if this solution is not working , please ignore 

Reply
  • 0
    Certified Senior Developer

    Hi, 

    In your Appian process model, create a variable of type Text or dictionary to receive the raw JSON payload. Modify your Web API to pass http!request.body directly into the process variable you created.. In your process model, parse the JSON from the Text variable into a Dictionary using a!fromJson() within a Script Task.and after parsing, extract envelopeId and documentId from the Dictionary variable in subsequent Script Tasks or Gateways.

    a!startProcess(
    processModel: cons!WMO_Docusign_Receive,
    processParameters: { jsonText: http!request.body },
    onSuccess: a!httpResponse( /* success response */ ),
    onError: a!httpResponse( /* error response */ )
    )

    And in your process model, you would have a parameter, let's say jsonText, to capture the raw JSON. Then, in the first Script Task.

    local!jsonData: a!fromJson(local!jsonText),
    local!envelopeId: local!jsonData.envelopeId,
    local!documentId: local!jsonData.documentId

    ---By doing this, the process starts with the complete JSON payload, which you then parse and manipulate within the process model.

    if this solution is not working , please ignore 

Children
No Data