Documentation

Internal API

Make an Internal API Call

The Internal API task is a powerful tool for advanced workflows, allowing you to interact directly with QReserve’s API endpoints. Combined with a Script task, this enables you to call any existing API endpoint to perform complex actions like creating, modifying, or retrieving resources, projects, and other data in response to triggers.

Dynamic Data via Scripts

A Script task can be used to inject content that is a function of your workflow such as a reservation or user. Please refer to the help text provided in the Input Script Task ID field for information about the fields you can set via a script. If a script includes a dictionary as the POST contents then your request will automatically be sent as JSON.

Note: The task automatically handles adding the site_id for certain endpoints, so it does not need to be included in your script.

Examples

Example 1: Create a New Reservable

This workflow creates a new resource named "New Automated Resource" every time it runs.

  1. Script Task: The script prepares the body for the API call.
  1. Internal API Task: This task is configured to take its input from the script.
  • Endpoint: /reservables

Example 2: Create a New Project

This workflow creates a new project using information from the trigger.

  1. Trigger: "Reservation Confirmed"
  2. Script Task: The script uses the reservation's purpose as the name for a new project.
  1. Internal API task: This task is configured to take its input from the script.
  • Endpoint: /projects/create

Example 3: Get a User's Training Records

This workflow retrieves all the training records for the user who made the reservation.

  1. Trigger: "Reservation Confirmed"
  2. Script Task: The script gets the user's ID from the trigger data and prepares the query parameters for the API cal
  1. Internal API Task: This task is configured to take its input from the script.
  • Endpoint: /training/records