Versions Compared

Key

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

Table of Contents

Background Information

  • By configuring the REST API Call bot block, you can customize the API write back.
  • This wiki uses the 'Monitoring [Opened Tickets Today - Template] for_test’ bot as an example.

Main Section

  1. Go to Bots.
  2. Open the bot that you want to add the REST API Call block to, and switch to the Design tab.
  3. Click and then click Add a Block.
  4. Click the blue box to select a block.
  5. Enter REST API Call into the search bar, and then click on REST API Call to add the REST API Call block.
  6. Click and then click Edit to make your settings.
  7. Enter the url address.
  8. (Optional)Select an integration.
    • If the RESTful API you want to configure is from an integration integrated with MSPbots, please select that integration.
    • Otherwise, please do not configure this parameter.
  9. Select the appropriate method.
    • get: Use to retrieve information from the database without modifying or adding data. Results are consistent regardless of how many operations are performed.
    • post: Use to submit data and add operations to the server.
    • put: Use to modify existing data on the server, similar to POST but focused on modifying rather than adding.
    • delete: Use to remove a specific resource, like deleting a record in a database.
    • options: A pre-check request made by the browser to ensure the server accepts the request before sending get, post, put, or delete requests.
  10. Set up the headers.
    1. Click Add.
    2. Please input the relevant key-value pair.

      1. If you need to remove it, click on Delete.
  11. Set up the params.
    there are usually two methods used to pass parameters to the server-side: URL query parameters and request body.
    • query

      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

    • body:
      The request body is an HTTP request part that contains data, which 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.
      • none
      • form-data
      • X-WWW-form-urlencoded
      • json
      • xml
  12. 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.


    • If there are no more blocks after the REST API Call block, click on Finish to complete your settings.