curl --request POST \
--url https://api.ionworks.com/cyclers/{cycler_id}/service_events \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.ionworks.com/cyclers/{cycler_id}/service_events"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.ionworks.com/cyclers/{cycler_id}/service_events', 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://api.ionworks.com/cyclers/{cycler_id}/service_events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ionworks.com/cyclers/{cycler_id}/service_events"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ionworks.com/cyclers/{cycler_id}/service_events")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionworks.com/cyclers/{cycler_id}/service_events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organization_id": "<string>",
"project_id": "<string>",
"cycler_id": "<string>",
"event_type": "calibration",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"scheduled_for": "2023-11-07T05:31:56Z",
"scheduled_until": "2023-11-07T05:31:56Z",
"performed_at": "2023-11-07T05:31:56Z",
"notes": "<string>",
"created_by": "<string>",
"performed_by": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Take a cycler out of service for planned work
Open a service event, taking every channel on the cycler out of service.
One call replaces taking each channel out individually: calibration is performed on the instrument, so the whole cycler goes down as one event and comes back as one. Channels already out of service keep their existing incident (a broken relay is more specific than “being serviced”).
Rejected with 409 if the cycler already has an open event, or if any channel still has a running measurement.
curl --request POST \
--url https://api.ionworks.com/cyclers/{cycler_id}/service_events \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.ionworks.com/cyclers/{cycler_id}/service_events"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.ionworks.com/cyclers/{cycler_id}/service_events', 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://api.ionworks.com/cyclers/{cycler_id}/service_events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ionworks.com/cyclers/{cycler_id}/service_events"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ionworks.com/cyclers/{cycler_id}/service_events")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionworks.com/cyclers/{cycler_id}/service_events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organization_id": "<string>",
"project_id": "<string>",
"cycler_id": "<string>",
"event_type": "calibration",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"scheduled_for": "2023-11-07T05:31:56Z",
"scheduled_until": "2023-11-07T05:31:56Z",
"performed_at": "2023-11-07T05:31:56Z",
"notes": "<string>",
"created_by": "<string>",
"performed_by": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
The body is of type Raw Data · object.
Response
Successful Response
One instrument-level service on a cycler.
A service event is the thing a channel incident belongs to when the whole
cycler is down. Calibration is performed on the instrument, so a
40-channel cycler going in for its annual calibration is one event, not 40
unrelated outages that happen to share a category. Channel incidents opened
for the event carry its id in service_event_id, which is what lets one
action close them together.
At most one event per cycler may be open (performed_at null) — a unique
partial index enforces it, so "the current service" is a single unambiguous
row and the open-event write path is safe to retry.
Was this page helpful?