Sending Data To Your App
Once you have setup your automation, you can choose to send specific sets of data back to your app. This can either be an entire data set or you can pick values of individual fields and send that info back to your app.
For this, your app would need to have an API endpoint to receive the data that is sent.
Once your API has been setup to receive, you can create your API in Automation and use the API within your automation.
The below sample walks you through how you can send a json object received from a previous task.
There are multiple ways available to you to send data back to your app.
We will look at 2 types - Sending a section of a JSON object received from the previous task and Sending specific dynamic text from previous task. The API creation will change based on the type of data you are sending.
- Start by clicking on API on the top navigation bar
- Click on New API and click on Build
- Add a POST call to your app's API endpoint
- in the body, add the following dynamic json you want to receive (the sample below shows the 'data' part of a json received from a provider that needs to be sent to the app)
- Click on Initialize
- In the Dynamic Values section, change the dropdown to JSON Object (since we are moving a section of the json)
- Add a sample json object within the Data input field (if you are working with data received from the previous task, you can copy a sample response from the Monitor tab and paste it here)
- Click on Continue Initialize
- Once successful, click on Use
- Give your API a name and click on Save
This setup option will allow you to send only specific data text from any of the previous tasks .
- Start by clicking on API on the top navigation bar
- Click on New API and click on Build
- Add a POST call to your app's API endpoint
- in the body, add the following dynamic json you want to receive (the sample below shows 3 data points that needs to be sent to the app)
- Click on Initialize
- The Dynamic Value will remain as Free Text since we are picking text response from previous tasks to send to our app
- Add sample response in the Dynamic field values (these can be just dummy text to help initialize the API call)
- Click on Continue Initialize
- Once successful, click on Use
- Give your API a name and click on Save
Once you have created the relevant API for your app to receive the data, you can call this API as a step to the automation.
- In your automation, click on Call API to add a task
- Search for the API you created to send data back to your app and select it
- For sending the JSON Data Object, click on the dynamic field and choose the data field
- For specific field values, click on the field and choose the text you want to dynamically insert from any of the previous tasks
- Once you have selected all the required dynamic fields, give your task a name (the task will not save unless you give it a name)
- Go to the Test and Publish tab to test the automation
- On successful completion, Push to Live
Please make sure you have published your Automation to live, the live endpoint will not work unless the Automation has been published,