Set simulator faults
curl --request PUT \
--url https://qubesync.com/api/v2/connections/{connection_id}/simulator \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"faults": {
"latency_ms": 123,
"next_lost_response": true,
"next_response_error": "xml_error",
"next_response_too_large": true,
"next_status": {
"code": 3100,
"message": "<string>"
}
}
}
'import requests
url = "https://qubesync.com/api/v2/connections/{connection_id}/simulator"
payload = { "faults": {
"latency_ms": 123,
"next_lost_response": True,
"next_response_error": "xml_error",
"next_response_too_large": True,
"next_status": {
"code": 3100,
"message": "<string>"
}
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
faults: {
latency_ms: 123,
next_lost_response: true,
next_response_error: 'xml_error',
next_response_too_large: true,
next_status: {code: 3100, message: '<string>'}
}
})
};
fetch('https://qubesync.com/api/v2/connections/{connection_id}/simulator', 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}/simulator",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'faults' => [
'latency_ms' => 123,
'next_lost_response' => true,
'next_response_error' => 'xml_error',
'next_response_too_large' => true,
'next_status' => [
'code' => 3100,
'message' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://qubesync.com/api/v2/connections/{connection_id}/simulator"
payload := strings.NewReader("{\n \"faults\": {\n \"latency_ms\": 123,\n \"next_lost_response\": true,\n \"next_response_error\": \"xml_error\",\n \"next_response_too_large\": true,\n \"next_status\": {\n \"code\": 3100,\n \"message\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.put("https://qubesync.com/api/v2/connections/{connection_id}/simulator")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"faults\": {\n \"latency_ms\": 123,\n \"next_lost_response\": true,\n \"next_response_error\": \"xml_error\",\n \"next_response_too_large\": true,\n \"next_status\": {\n \"code\": 3100,\n \"message\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qubesync.com/api/v2/connections/{connection_id}/simulator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"faults\": {\n \"latency_ms\": 123,\n \"next_lost_response\": true,\n \"next_response_error\": \"xml_error\",\n \"next_response_too_large\": true,\n \"next_status\": {\n \"code\": 3100,\n \"message\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"company": {
"company_name": "<string>",
"lists": {},
"open_iterators": 123,
"transactions": {}
},
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"faults": {},
"links": {
"connection": "<string>",
"ui": "<string>"
}
}
}{
"errors": "unknown parameter: \"emial\""
}Unauthorized{
"errors": {
"detail": "Not Found"
}
}{
"errors": "unknown parameter: \"emial\""
}Connections
Set simulator faults
Beta: simulated connections don’t match real QuickBooks in every case yet. Make the next sync (or every sync, for connection_error) fail in a specific way — 404s for a real (non-simulated) connection.
PUT
/
connections
/
{connection_id}
/
simulator
Set simulator faults
curl --request PUT \
--url https://qubesync.com/api/v2/connections/{connection_id}/simulator \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"faults": {
"latency_ms": 123,
"next_lost_response": true,
"next_response_error": "xml_error",
"next_response_too_large": true,
"next_status": {
"code": 3100,
"message": "<string>"
}
}
}
'import requests
url = "https://qubesync.com/api/v2/connections/{connection_id}/simulator"
payload = { "faults": {
"latency_ms": 123,
"next_lost_response": True,
"next_response_error": "xml_error",
"next_response_too_large": True,
"next_status": {
"code": 3100,
"message": "<string>"
}
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
faults: {
latency_ms: 123,
next_lost_response: true,
next_response_error: 'xml_error',
next_response_too_large: true,
next_status: {code: 3100, message: '<string>'}
}
})
};
fetch('https://qubesync.com/api/v2/connections/{connection_id}/simulator', 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}/simulator",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'faults' => [
'latency_ms' => 123,
'next_lost_response' => true,
'next_response_error' => 'xml_error',
'next_response_too_large' => true,
'next_status' => [
'code' => 3100,
'message' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://qubesync.com/api/v2/connections/{connection_id}/simulator"
payload := strings.NewReader("{\n \"faults\": {\n \"latency_ms\": 123,\n \"next_lost_response\": true,\n \"next_response_error\": \"xml_error\",\n \"next_response_too_large\": true,\n \"next_status\": {\n \"code\": 3100,\n \"message\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.put("https://qubesync.com/api/v2/connections/{connection_id}/simulator")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"faults\": {\n \"latency_ms\": 123,\n \"next_lost_response\": true,\n \"next_response_error\": \"xml_error\",\n \"next_response_too_large\": true,\n \"next_status\": {\n \"code\": 3100,\n \"message\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qubesync.com/api/v2/connections/{connection_id}/simulator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"faults\": {\n \"latency_ms\": 123,\n \"next_lost_response\": true,\n \"next_response_error\": \"xml_error\",\n \"next_response_too_large\": true,\n \"next_status\": {\n \"code\": 3100,\n \"message\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"company": {
"company_name": "<string>",
"lists": {},
"open_iterators": 123,
"transactions": {}
},
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"faults": {},
"links": {
"connection": "<string>",
"ui": "<string>"
}
}
}{
"errors": "unknown parameter: \"emial\""
}Unauthorized{
"errors": {
"detail": "Not Found"
}
}{
"errors": "unknown parameter: \"emial\""
}
