List works
curl --request GET \
--url https://{host}/api/public/v1/works \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/public/v1/works"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/public/v1/works', 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://{host}/api/public/v1/works",
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://{host}/api/public/v1/works"
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://{host}/api/public/v1/works")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/public/v1/works")
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{
"data": [
{
"id": 123,
"work_number": "<string>",
"work_date": "<string>",
"time_window_from": "<string>",
"time_window_to": "<string>",
"status": "new",
"status_name": "<string>",
"service_type": "service",
"contact_id": 123,
"vehicle_id": 123,
"vehicle_name": "<string>",
"zone_id": 123,
"zone_name": "<string>",
"attention": "<string>",
"email": "<string>",
"company_name": "<string>",
"mobile_no": "<string>",
"office_no": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"instructions": "<string>",
"work_price": "<string>",
"items": [
{
"id": 123,
"name": "<string>",
"sku": "<string>",
"description": "<string>",
"quantity": 123,
"unit_of_measure": "<string>",
"unit_price": 123
}
],
"created_at": "<string>",
"updated_at": "<string>"
}
],
"links": {
"first": "<string>",
"last": "<string>",
"prev": "<string>",
"next": "<string>"
},
"meta": {
"current_page": 123,
"last_page": 123,
"per_page": 123,
"from": 123,
"to": 123,
"total": 123
}
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid, revoked, or expired."
}
}{
"error": {
"code": "insufficient_scope",
"message": "This API key does not have the required scope."
}
}Works
List works
Returns the works your key can see, newest first. Requires the works:read scope.
GET
/
works
List works
curl --request GET \
--url https://{host}/api/public/v1/works \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/public/v1/works"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/public/v1/works', 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://{host}/api/public/v1/works",
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://{host}/api/public/v1/works"
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://{host}/api/public/v1/works")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/public/v1/works")
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{
"data": [
{
"id": 123,
"work_number": "<string>",
"work_date": "<string>",
"time_window_from": "<string>",
"time_window_to": "<string>",
"status": "new",
"status_name": "<string>",
"service_type": "service",
"contact_id": 123,
"vehicle_id": 123,
"vehicle_name": "<string>",
"zone_id": 123,
"zone_name": "<string>",
"attention": "<string>",
"email": "<string>",
"company_name": "<string>",
"mobile_no": "<string>",
"office_no": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"instructions": "<string>",
"work_price": "<string>",
"items": [
{
"id": 123,
"name": "<string>",
"sku": "<string>",
"description": "<string>",
"quantity": 123,
"unit_of_measure": "<string>",
"unit_price": 123
}
],
"created_at": "<string>",
"updated_at": "<string>"
}
],
"links": {
"first": "<string>",
"last": "<string>",
"prev": "<string>",
"next": "<string>"
},
"meta": {
"current_page": 123,
"last_page": 123,
"per_page": 123,
"from": 123,
"to": 123,
"total": 123
}
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid, revoked, or expired."
}
}{
"error": {
"code": "insufficient_scope",
"message": "This API key does not have the required scope."
}
}Authorizations
An API key created in BeanRails, for example brk_live_....
Query Parameters
Records per page. Defaults to 10, capped at 100.
Required range:
1 <= x <= 100Page number, starting at 1.
Required range:
x >= 1Free-text search across the record's main fields, such as its number, name or email.
Filter by work status.
Available options:
new, vehicle_assigned, in_progress, failed, cancelled, completed Filter by contact ID.
Filter by assigned vehicle ID.
Filter by zone ID.
Works on or after this date (YYYY-MM-DD, workspace timezone).
Works on or before this date (YYYY-MM-DD, workspace timezone).
