Skip to main content
Participant
March 20, 2018
Question

Send an agreement via a workflow with the REST API

  • March 20, 2018
  • 1 reply
  • 1036 views

I am trying to configure a request to the REST API to send a workflow. The workflow requires a file, which can be one of several depending on the request.  When I pass the workflow library document ID of the file I want to include, in the "fileInfos" object, the API returns an error: INVALID_TRANSIENTDOCUMENT_ID

The API documentation says: Note: Only one of the four parameters in every FileInfo object must be specified even though the fileInfos object documentation only has three parameters: "name", "transientDocumentId", and "workflowLibraryDocumentId" and none of them are specified as optional.

{

  "documentCreationInfo": {

    "name": "TEST AGREEMENT NAME",

    "fileInfos": [

      {

        "name": "document1",

        "workflowLibraryDocumentId": "...ENwh1iObQMUWQEfMo9KHyf7D..."

      }

    ], 

    "recipientsListInfo": [

      {

        "name": "Signer1",

        "recipients": [

          {

            "email": "test@example.com"

          }

        ]

      }

    ]

  }

}

Am I misunderstanding? Does someone have a working snipped of JSON to get me started here? Or is this an error in the API?

This topic has been closed for replies.

1 reply

Participant
March 21, 2018

Here are some notes that I took on what I've discovered to get workflow sending to function. These aren't described anywhere else, so hopefully these help someone besides myself.

  • MISSING_REQUIRED_TO_FIELD: the "name" in each "recipientsListInfos" object can be found by making a proper API call to get the workflow by ID, and checking the "recipientsListInfo". Each object contains a "name". (you can also check CCs this way) An incorrect name will result in the error. Note that the names are case sensitive and numerical order might be confusing. If a recipient is marked as "editable": false, I don't think you can override it with an API call, you must make it editable in the workflow designer.
  • INVALID_TRANSIENTDOCUMENT_ID: The document(s) must already be added to the workflow in the workflow designer. The document "name" required in the "fileInfos" object can be found by making a proper API call to get the workflow by ID, and checking the fileInfos for the document you want to send with the workflow. Do not specify this as a transient ID, instead as a workflowLibraryDocumentId.
  • If you do not specify a "name" you will get a FILE_INFO_NAME_MISSING error.
  • ALL files marked as required in the workflow designer or otherwise MUST BE DEFINED in the fileInfos.
  • If you specify an incorrect "fileInfos" "name", it will succeed, but you will get an error message email.
  • MISC_ERROR: in my case this was caused by a field being marked as required in the workflow designer "Sender Input Fields" tab and I did not merge a value into it with the "mergeFieldInfo" parameter (even though the field had a default value specified).
  • Also note that in the workflow designer, one can only specify 10 input fields as required, why? What if everything is required?

It seems that there is a lot of work that needs to go into to the workflow designer as well as making the actual API call, but it's not really outlined anywhere...