Path Variables in REST API Triggers

In BuildShip, you can define dynamic parts of the path using named parameters, often called wildcards or path variables. This allows you to create flexible and reusable API endpoints.

Path Variable in REST API Call Trigger

Setting Up Path Variables

To set up a path variable in the REST API trigger configuration, specify the Path and Method. For dynamic paths, use a named parameter by prefixing it with a colon (:).

Example Configuration

  • Path: /api/call/:id
  • Method: GET (or POST, PUT, DELETE depending on your requirement)

With this configuration, if a request is made to a URL like https://myproject.buildship.run/api/call/123, the workflow associated with this path will be triggered. The variable part, 123, is captured by :id.

Accessing Path Variables

You can access the path variable within your workflow using the request.path object. The request will be the variable from the Trigger. To extract the id from the path, you can use the following expression within your workflow's expression editor:

💡

Remix this workflow to see how it works: link (opens in a new tab)

Need Help?

  • 💬
    Join BuildShip Community

    An active and large community of no-code / low-code builders. Ask questions, share feedback, showcase your project and connect with other BuildShip enthusiasts.

  • 🙋
    Hire a BuildShip Expert

    Need personalized help to build your product fast? Browse and hire from a range of independent freelancers, agencies and builders - all well versed with BuildShip.

  • 🛟
    Send a Support Request

    Got a specific question on your workflows / project or want to report a bug? Send a us a request using the "Support" button directly from your BuildShip Dashboard.

  • ⭐️
    Feature Request

    Something missing in BuildShip for you? Share on the #FeatureRequest channel on Discord. Also browse and cast your votes on other feature requests.