Start Event: Calling a workflow

To trigger a flow on the Liberate platform, developers can use the following curl request. Please note that this request requires a unique bearer token obtained from Liberate. The specific curl request information may vary for each workflow and can be found in the properties of a "Start Event."

Production and QA Environment

Every customer has a production and QA environment. Start Events contain the curl requests for each environment. All customers also have their own unique endpoint URL. The below is an example, but you'll find you URL in the Start Event curl example

curl -X PUT -H "Authorization: Bearer YOUR_BEARER_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"slug": "YOUR_FLOW_SLUG", "context": {}}' \
     https://integration.liberateinc.io

Request Details

The curl command triggers a flow by sending a PUT request to the specified API endpoint https://integration-core-dev-api.liberateinc.io. The request is configured with the following options and data:

  • -X PUT: Specifies the HTTP method as PUT.
  • -H "Authorization: Bearer YOUR_BEARER_TOKEN": Sets the "Authorization" header with the bearer token obtained from Liberate. Replace YOUR_BEARER_TOKEN with the actual token.
  • -H "Content-Type: application/json": Sets the "Content-Type" header to indicate that the request body is in JSON format.
  • -d '{"slug": "YOUR_FLOW_SLUG", "context": {}}': Sets the request body as a JSON object. Replace YOUR_FLOW_SLUG with the specific flow's slug or identifier. The context field can be populated with additional information relevant to the flow if needed.

Example

Here's an example curl request with a bearer token and flow slug:

curl -X PUT -H "Authorization: Bearer 20133ab0efb1712341804bfe4351e2b8d3" \
     -H "Content-Type: application/json" \
     -d '{"slug": "simple-flow-d9379aa1-2508-49a2-b7be-7537013535f0", "context": {}}' \
     https://integration-core-dev-api.liberateinc.io

Ensure to replace the bearer token (20133ab0efb17aasd4804bfe4351e2b8d3) and flow slug (simple-flow-d9379aa1-2508-49a2-b7be-7537013535f0) in the example with your actual values.

Response

The Liberate platform will respond with the appropriate data based on the triggered flow. The specific response will depend on the logic and implementation of the flow itself.

Remember to handle the response appropriately in your application code based on the expected behavior defined for the triggered flow.

If you encounter any issues or need further assistance, please consult the Liberate platform's documentation or reach out to their support team for guidance.