Standard Task: Data Container

The 'data container' task allows you to create a custom endpoint that can receive posted JSON data and stores it as instance data in your Integrify database. This task is designed to be completed by an API POST. Once the workflow reaches the data container task, the endpoint is prepped to wait for data to be posted to it. Once the data is posted, the workflow moves forward.

How it Works

  • You add a data container task type to your workflow.
  • You configure the task, defining an expected field configuration with specific keys and data types.
  • Field Configuration: This shows which fields from your post body to store in the database (the other fields are ignored). None of the fields will be required in the post body, so you can include as many as you would like in the post body without producing an error.
  • Data Types: The expected data types for each field, such as 'string', 'numeric', or 'date'.

 

 

 

To begin working with the function described below, make sure that you have at least one Data Container task active in a request in your Integrify instance.

Checking for Endpoints Programmatically

You can always find your endpoint in the request summary, but you can also programmatically check for endpoints by sending a GET request to:

/tasktypes/data-container/endpoints      

You can optionally filter by task name, instance ID, or instance SID. See complete filtering options at developer.integrify.com

Here is an example response that shows two ready endpoints:

{
  endpoints: [
    "/tasktypes/data-container/instances/tasks/reciptasks/d854f1fd-773d-4883-a2b7-0acc8c33d138?task_name=myTaskName",
    "/tasktypes/data-container/instances/tasks/reciptasks/d854f1fd-773d-4883-a2b7-0acc8c33d138?task_name=myOtherTaskName"
  ]
}

As a convenience, the task name is appended to each endpoint in the response for easier visual parsing and searching. When a GET or POST request is made to the endpoint, this 'task_name' querystring will be ignored if included.

Here is an example response that includes no endpoints (You will get this result if no Data Container tasks are currently active in Integrify):

{
    endpoints: [ ]
}

Getting the Field Configuration

Each endpoint will accept a GET request or a POST request.

  • GET
    • Returns the field configuration for your endpoint, in case you need to know what field keys and data types are expected.

Here is an example field configuration

{
    field_configuration: [
        {
            key: "client_name",
            value_type: "string"
        },
        {
            key: "client_number",
            value_type: "numeric"
        }
    ]
}

See more information at developer.integrify.com

Posting Data

  • POST
    • Stores any data fields from the post body that match the expected field configuration.
    • Completes the task and pushes the workflow to the next task.

Here is an example post body:

{
    "client_name": "John Doe",
    "client_number": 5
}

Sending file attachments to a data container is a 2 part process.  First, you must upload the file to the server using this API call: https://developer.integrify.com/rest/Files/upload.  Using the key value that is returned in this call, you then complete the data container file upload field using the key value you just retrieved:

{
     "client_name": "John Doe", 
      "file_attachment":  "1a9dec20-3e93-11e5-8b58-7b9ee7d080f1"
}