Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The API write-back can be customized by configuring the REST API Call bot block. Customizing the API write-back and creating an API REST block enables MSPbots to establish a seamless integration with your systems and allow allows us to retrieve relevant data so we can create reports that will help you monitor your performance, receive alerts, and perform necessary actions programmatically.

This article is a guide on how to configure the REST API Call bot block. It will use the Monitoring [Opened Tickets Today - Template] for_test bot as an example.

To set up the bot block

  1. Go to Bots on the MSPbots menu. 
    MSPbots botsImage Added
  2. Open the bot that you want to add the REST API Call block to, and switch
    my botImage Added
  3. Go to the Design tab. If a window opens, close it. 
    bot designImage Added
  4. Hover over the horizontal line between the blocks. Click and then click , select Add a Block.
    Image RemovedClick the blue box to select a , and select the new block. 
    Image Removedadd a blockImage Added
  5. Enter Type REST API Call into in the search bar , and then click on REST API Call to add .
    rest api callImage Added
  6. Next, hover over the ellipsis Image Added for the REST API Call block .
    Image Removed
  7. Click Image Removed and then click Edit to make your settings.
    Image Removed
  8. and select Edit.
    edit blockImage Added
  9. When the REST API Call window opens, enter the url address that will receive requests. 
    restful apiImage AddedEnter the url address.
    Image Removed
  10. (Optional) Select an an integration.
    If the RESTful API you want to configure is you are configuring a REST API from an existing integration integrated with MSPbots, please select that software from the integration list. Otherwise, please do not configure this parameter.
    Image Removedselect integrationImage Added
  11. Select the an appropriate HTTP method to use.
    • get : Use to retrieve - Retrieves information from the database without modifying or adding data. Results The results are consistent regardless of how many operations are performed.
    • post: Use to submit Submits data and add adds operations to the server.
    • put: Use to modify Modifies the existing data on the server, . This is similar to POST but focused on modifying rather than except that it modifies instead of adding.
    • delete: Use to remove Removes a specific resource, like deleting a record in a database.
    • options: A pre-check request made by of the browser to ensure the server accepts the request before sending get, post, put, or delete requests.
      Image Removedhttp methodImage Added
  12. Set Next, set up the headers and input the relevant key and value. 
    header key_valueImage Added
    Click Add to add more keys and values.
    Image RemovedPlease input the relevant key-value pair.
    If you need to remove it, click on Delete.add key-valueImage Added

    To remove a pair of key and value, click Delete

  13. Set up the params.
    there are usually two methods used Select either the URL query and request body method to pass parameters to the server-side: URL query parameters and request body.
    1. query
    1. URL query parameters are a way of passing parameters through the URL. In the URL, query parameters usually start with a "?" symbol and are separated by "&" symbols.
      For example: https://www.example.com/path/to/resource?param1=value1&param2=value2

    Image RemovedImage Removed
    1. query methodImage Added
    2. body
    :

    1. The request body is an HTTP request
    part that contains data, which
    1. with data that is usually part of a POST or PUT request. This data can be in various formats such as JSON, XML, or form data. These parameters are usually used for submitting forms, uploading files, or sending other types of data. 
      request bodyImage Added
  14. none
    Image Removed
    1. The params available for the request body method are noneform-data

    Image RemovedX-WWW
    1. x-www-form-urlencoded

    Image Removed
  15. json
    Image Removed
  16. xml
    Image Removed
    1. , JSON, and XML
      request body methodsImage Added
  17. Click Next to configure any remaining blocks, and click Finish when done. If there are any other blocks, such as an Alert block, after the REST API Call block, click Next to configure the remaining blocks and then click Finish when you're finished.
    Image Removed
    Image Removed
    If there are no more blocks after the REST API Call block, click on Finish to complete your settings.
    Image Removed