Get a workflow
curl --request GET \
--url https://app.trelica.com/api/workflows/v1/{workflowId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trelica.com/api/workflows/v1/{workflowId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trelica.com/api/workflows/v1/{workflowId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trelica.com/api/workflows/v1/{workflowId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trelica.com/api/workflows/v1/{workflowId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.trelica.com/api/workflows/v1/{workflowId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trelica.com/api/workflows/v1/{workflowId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"next": "https://app.trelica.com/api/workflows/v1?after=eyJpZCI6ImI3Mjg4YzJjNjRmNzc5ZTI4MDI0ZWEwZSJ9&limit=100",
"results": [
{
"id": "b7288c2c64f779e28024ea0e",
"name": "Offboarding",
"enabled": true,
"createdDtm": "2023-06-22T14:02:36.136Z",
"deleted": false,
"lastModifiedBy": {
"userId": "b2c3d4e5-f678-90ab-cdef-1234567890ab",
"name": "Priya Patel",
"email": "priya.patel@example.com"
},
"lastModifiedDtm": "2023-06-22T20:28:35.846Z",
"trigger": {
"id": "5e0e8a1c64f779e28024ea0d",
"name": "Person leaves",
"type": "PersonLeaves"
},
"steps": [
{
"id": "4f2f9f6850fb2ce64a8ffb04",
"name": "Create task",
"type": "CreateTask"
},
{
"id": "f82c5f04e4b54a96f20ff8b5",
"name": "Create Jira (Cloud) ticket",
"type": "CreateExternalTask"
},
{
"id": "f9bff20456884e0f2c2f65ab",
"name": "Offboard person from apps",
"type": "OffboardPersonApps"
}
]
}
]
}{
"type": "about:blank",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "The request body failed validation. See errors for the offending fields.",
"errors": {
"email": [
"The email field is required."
]
},
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
}Workflows
Get a workflow
Returns the published workflow with the given ID, including its trigger and steps. The workflow is returned inside a one-item result page (empty if no workflow has that ID).
Required scope: Workflows.Read (Read-only access to workflow definitions)
GET
/
api
/
workflows
/
v1
/
{workflowId}
Get a workflow
curl --request GET \
--url https://app.trelica.com/api/workflows/v1/{workflowId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trelica.com/api/workflows/v1/{workflowId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trelica.com/api/workflows/v1/{workflowId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trelica.com/api/workflows/v1/{workflowId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trelica.com/api/workflows/v1/{workflowId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.trelica.com/api/workflows/v1/{workflowId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trelica.com/api/workflows/v1/{workflowId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"next": "https://app.trelica.com/api/workflows/v1?after=eyJpZCI6ImI3Mjg4YzJjNjRmNzc5ZTI4MDI0ZWEwZSJ9&limit=100",
"results": [
{
"id": "b7288c2c64f779e28024ea0e",
"name": "Offboarding",
"enabled": true,
"createdDtm": "2023-06-22T14:02:36.136Z",
"deleted": false,
"lastModifiedBy": {
"userId": "b2c3d4e5-f678-90ab-cdef-1234567890ab",
"name": "Priya Patel",
"email": "priya.patel@example.com"
},
"lastModifiedDtm": "2023-06-22T20:28:35.846Z",
"trigger": {
"id": "5e0e8a1c64f779e28024ea0d",
"name": "Person leaves",
"type": "PersonLeaves"
},
"steps": [
{
"id": "4f2f9f6850fb2ce64a8ffb04",
"name": "Create task",
"type": "CreateTask"
},
{
"id": "f82c5f04e4b54a96f20ff8b5",
"name": "Create Jira (Cloud) ticket",
"type": "CreateExternalTask"
},
{
"id": "f9bff20456884e0f2c2f65ab",
"name": "Offboard person from apps",
"type": "OffboardPersonApps"
}
]
}
]
}{
"type": "about:blank",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "The request body failed validation. See errors for the offending fields.",
"errors": {
"email": [
"The email field is required."
]
},
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
}Authorizations
OAuth 2.0. Obtain an access token via the Client Credentials or Authorization Code flow, then send it as Authorization: Bearer <token>.
Path Parameters
Was this page helpful?
⌘I