Get a workflow run
curl --request GET \
--url https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}', 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://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}",
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: Basic <encoded-value>"
],
]);
$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://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"data": {
"cancel_reason": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"current_state": "create_customer / resolve_conflict.find_holder",
"error": {
"code": 3100,
"hint": "<string>",
"message": "<string>",
"quickbooks_message": "<string>",
"type": "name_in_use"
},
"headline": "Created Riverbend Electric in QuickBooks.",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": {},
"links": {
"cancel": "<string>",
"decisions": "<string>",
"search": "<string>",
"self": "<string>",
"ui": "<string>"
},
"outcome": "<string>",
"output": {},
"prompt": {
"choices": [
{
"description": "Try the add again under a name you choose.",
"detail": "Customer · similar name",
"fields": [
{
"label": "New name",
"name": "name",
"required": true,
"type": "string",
"columns": [
{
"enum": [
{
"label": "Service",
"value": "item_service"
}
],
"kind": "account",
"label": "Income account",
"name": "income_account",
"required": true,
"type": "string",
"when": {
"action": [
"create"
]
}
}
],
"enum": [
{
"label": "Service",
"value": "item_service"
}
],
"kind": "customer",
"rows": [
{
"columns": [
"action",
"list_id",
"income_account"
],
"detail": "Item",
"key": "invoice_line_add.0.item_ref",
"kinds": {
"income_account": "account",
"list_id": "item"
},
"label": "Vinyl Banner",
"values": {
"item_type": "item_non_inventory"
}
}
]
}
],
"id": "rename",
"label": "Add it under another name"
}
],
"details": [
{
"label": "Customer",
"value": "Lone Star Supply Co"
}
],
"kind": "decision",
"token": "<string>"
},
"reference": "<string>",
"revision": 2,
"state": "running",
"summary": {
"calls": [
{
"item_index": 123,
"outcome": "<string>",
"state": "create_customer",
"status": "completed",
"workflow": "<string>"
}
],
"changes": [
{
"action": "create",
"kind": "customer",
"full_name": "<string>",
"item": 123,
"list_id": "<string>",
"ref_number": "<string>",
"settled": "found",
"txn_id": "<string>"
}
],
"decisions": [
{
"at": "2023-11-07T05:31:56Z",
"item_index": 123,
"option": "<string>",
"state": "create_customer / try_create",
"workflow": "<string>"
}
],
"discarded": [
{
"item_index": 123,
"items_not_started": 123,
"message": "<string>",
"operation": "<string>",
"queued_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "create_customer / try_create",
"workflow": "<string>"
}
],
"ended_at": "2023-11-07T05:31:56Z",
"matches": [
{
"candidates": 123,
"candidates_total": 123,
"candidates_total_complete": true,
"index": "ready",
"item_index": 123,
"match": "exact",
"state": "<string>",
"workflow": "<string>"
}
],
"notifications": {
"failed": 123,
"sent": 123
},
"requests": [
{
"evidence": "of 2 candidates with reference number \"1044\", one carries the GUID sent (txn_id 2-1), so the add was applied",
"found_by": "look_for_invoice",
"identifiers": {
"full_name": "<string>",
"list_id": "<string>",
"ref_number": "<string>",
"txn_id": "<string>"
},
"item_index": 123,
"operation": "<string>",
"pages": 123,
"role": "prepare",
"settled": "found",
"state": "create_customer / try_create",
"status": "success",
"unconfirmed": true,
"workflow": "<string>"
}
],
"side_effects": [
{
"evidence": "<string>",
"identifiers": {
"full_name": "<string>",
"list_id": "<string>",
"ref_number": "<string>",
"txn_id": "<string>"
},
"item_index": 123,
"operation": "<string>",
"settled": "found",
"state": "create_customer / try_create",
"workflow": "<string>"
}
],
"stopped_at": "create_customer / resolve_conflict.ask_about_customer",
"unconfirmed": [
{
"item_index": 123,
"operation": "<string>",
"state": "add_invoice",
"workflow": "<string>"
}
]
},
"trace": [
{
"at": "2023-11-07T05:31:56Z",
"event": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"vars": {},
"workflow": "<string>"
}
}Workflows
Get a workflow run
GET
/
connections
/
{connection_id}
/
workflow-runs
/
{run_id}
Get a workflow run
curl --request GET \
--url https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}', 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://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}",
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: Basic <encoded-value>"
],
]);
$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://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://qubesync.com/api/v2/connections/{connection_id}/workflow-runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"data": {
"cancel_reason": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"current_state": "create_customer / resolve_conflict.find_holder",
"error": {
"code": 3100,
"hint": "<string>",
"message": "<string>",
"quickbooks_message": "<string>",
"type": "name_in_use"
},
"headline": "Created Riverbend Electric in QuickBooks.",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": {},
"links": {
"cancel": "<string>",
"decisions": "<string>",
"search": "<string>",
"self": "<string>",
"ui": "<string>"
},
"outcome": "<string>",
"output": {},
"prompt": {
"choices": [
{
"description": "Try the add again under a name you choose.",
"detail": "Customer · similar name",
"fields": [
{
"label": "New name",
"name": "name",
"required": true,
"type": "string",
"columns": [
{
"enum": [
{
"label": "Service",
"value": "item_service"
}
],
"kind": "account",
"label": "Income account",
"name": "income_account",
"required": true,
"type": "string",
"when": {
"action": [
"create"
]
}
}
],
"enum": [
{
"label": "Service",
"value": "item_service"
}
],
"kind": "customer",
"rows": [
{
"columns": [
"action",
"list_id",
"income_account"
],
"detail": "Item",
"key": "invoice_line_add.0.item_ref",
"kinds": {
"income_account": "account",
"list_id": "item"
},
"label": "Vinyl Banner",
"values": {
"item_type": "item_non_inventory"
}
}
]
}
],
"id": "rename",
"label": "Add it under another name"
}
],
"details": [
{
"label": "Customer",
"value": "Lone Star Supply Co"
}
],
"kind": "decision",
"token": "<string>"
},
"reference": "<string>",
"revision": 2,
"state": "running",
"summary": {
"calls": [
{
"item_index": 123,
"outcome": "<string>",
"state": "create_customer",
"status": "completed",
"workflow": "<string>"
}
],
"changes": [
{
"action": "create",
"kind": "customer",
"full_name": "<string>",
"item": 123,
"list_id": "<string>",
"ref_number": "<string>",
"settled": "found",
"txn_id": "<string>"
}
],
"decisions": [
{
"at": "2023-11-07T05:31:56Z",
"item_index": 123,
"option": "<string>",
"state": "create_customer / try_create",
"workflow": "<string>"
}
],
"discarded": [
{
"item_index": 123,
"items_not_started": 123,
"message": "<string>",
"operation": "<string>",
"queued_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "create_customer / try_create",
"workflow": "<string>"
}
],
"ended_at": "2023-11-07T05:31:56Z",
"matches": [
{
"candidates": 123,
"candidates_total": 123,
"candidates_total_complete": true,
"index": "ready",
"item_index": 123,
"match": "exact",
"state": "<string>",
"workflow": "<string>"
}
],
"notifications": {
"failed": 123,
"sent": 123
},
"requests": [
{
"evidence": "of 2 candidates with reference number \"1044\", one carries the GUID sent (txn_id 2-1), so the add was applied",
"found_by": "look_for_invoice",
"identifiers": {
"full_name": "<string>",
"list_id": "<string>",
"ref_number": "<string>",
"txn_id": "<string>"
},
"item_index": 123,
"operation": "<string>",
"pages": 123,
"role": "prepare",
"settled": "found",
"state": "create_customer / try_create",
"status": "success",
"unconfirmed": true,
"workflow": "<string>"
}
],
"side_effects": [
{
"evidence": "<string>",
"identifiers": {
"full_name": "<string>",
"list_id": "<string>",
"ref_number": "<string>",
"txn_id": "<string>"
},
"item_index": 123,
"operation": "<string>",
"settled": "found",
"state": "create_customer / try_create",
"workflow": "<string>"
}
],
"stopped_at": "create_customer / resolve_conflict.ask_about_customer",
"unconfirmed": [
{
"item_index": 123,
"operation": "<string>",
"state": "add_invoice",
"workflow": "<string>"
}
]
},
"trace": [
{
"at": "2023-11-07T05:31:56Z",
"event": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"vars": {},
"workflow": "<string>"
}
}
