Following are the steps to setup External APIs in Custom Bots :

  1. Select the option ‘External API Requests’ in the Settings page and click on the ‘New API Request’ button.
  2. The ‘New API Request’ page appears. Enter the API name under the ‘Request Title’ box.
  3. Select an appropriate method from the ‘Method’ box for the API call. You can use the following methods:
    • GET – to retrieve the data from an external system
    • POST– to write data
    • PUT– to update data in the external system
  4. Enter the ‘Target URL’ for the API endpoint. Optionally, you can also enter a dynamic URL that includes parameters and variables in the Target URL field.
  5. Once you enter a dynamic URL, the URL parameters will appear under the ‘Parameter Keys’ section in read-only fields.

  6. Under Authentication, select one of the two available options:
    • Basic Auth: Enter the Username and Password
    • Custom Auth: Enter the custom username and password.
  7. You can also add keys for the API Parameters which you want to pass with Requests by using the Parameter Key button. Although it is not mandatory to enter Parameters, however, it is recommended to add at least one parameter.
  8. Click the + Query Parameter Key’ button to add the Query Parameter key, if required. Once you click the button, an editable query parameter row appears at the bottom.
  9. Click ‘Next’ after completing the above steps.
  10. In order to test the API set up, you can enter dummy values. For example, if the Parameter value is a date, then use the date-picker to enter a date.
  11. The Status Code and Response Body both are displayed when the API request is successful.

  12. In case the test fails, then you can edit the sample values and click the ‘Test Again’ button.
    Note: In order to proceed to the next step, ensure that you get a successful status code API response in the Status box.
  13. Click ‘Next’, the application displays the API response.
  14. Successful API Response code is 2XX and it includes all the selected keys.
  15. Select the keys that you want to use in the Custom Bots. It is also supported that you do not select any keys, especially in POST / PUT scenarios.
  16. In case of a failure, the API Response code is either 3XX, 4XX, and 5XX.
  17. Click ‘Save’. The new API appears under the ‘New API Request’ list.

For more information, refer to Custom Bots API.