Skip to main content
REST API Block
Updated over 6 months ago

REST API Block in Journeys:


The REST API block in Journeys allows you to use your own API within BIK Journeys, enabling you to send messages based on the API's response.

Steps to Add API Block

1. Open the Flow:

  • Navigate to the flow where you want to add the API block.

2. Add the REST API Block:

  • Click on the "Action" tab.

  • Look for the "REST API" block under the "Special Actions" section.

  • Select and add the block to your flow.

3. Configure the API Block:

  • Click on the newly added block to configure it.

4. Select Request Method:

  • Select the appropriate request method (GET, POST, etc.) from the drop-down menu.

5. Add Request URL:

  • Enter the full API URL, including https://.

6. Add Headers (if applicable): Add any necessary headers.

7. Add Body/Query Params:

  • Enter the body or query parameters for the API in JSON format.

8. Add Sample Response: Provide a sample response in the designated field.

Here, Expected response from the api should be added and values can be dummy.

We only use keys to show them in the variables in the next message block.

9. Save the Block:

  • After entering all the details, save the block.

10. Configure Success and Failure Nodes:

  • Upon saving, two nodes will appear: "Success" and "Failure".

  • Success Node:

    • Add a message block to handle the successful response.

    • Use API variables to share the response data with the customer.

  • Failure Node:

    • Add a fallback block to handle cases where the API request fails.


FAQs

1. What kind of APIs can I integrate with the REST API block?

You can integrate any RESTful API that supports HTTP methods such as GET, POST and PUT

2. Is it possible to use the API response in subsequent blocks?

Yes, the data from the API response can be used in subsequent message blocks by referencing the API variables.

3. What should I do if the API request fails?

Connect a fallback block to the "Failure" node. This block will be triggered if the API request fails, allowing you to handle the failure gracefully.


For further assistance or to raise feature requests related to REST api block, please contact [email protected]

Did this answer your question?