Create integration exception logs
curl --request POST \
--url https://panel.sendcloud.sc/api/v3/integrations/{id}/logs \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"base_url": "https://example.com",
"full_url": "https://example.com/order-note.json",
"method": "POST",
"response_code": 495,
"response": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"body": "<!doctype html>\n<html>\n <head>\n <title>SSL Certificate Error</title>\n </head>\n </html>\n"
},
"request": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"payload": {
"order_note": {
"note": "Success"
}
}
},
"created_at": "2023-03-01T02:02:00+01:00",
"exception_type": "requests.exceptions.SSLError",
"exception": "An SSL error occurred"
}
'import requests
url = "https://panel.sendcloud.sc/api/v3/integrations/{id}/logs"
payload = {
"base_url": "https://example.com",
"full_url": "https://example.com/order-note.json",
"method": "POST",
"response_code": 495,
"response": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"body": "<!doctype html>
<html>
<head>
<title>SSL Certificate Error</title>
</head>
</html>
"
},
"request": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"payload": { "order_note": { "note": "Success" } }
},
"created_at": "2023-03-01T02:02:00+01:00",
"exception_type": "requests.exceptions.SSLError",
"exception": "An SSL error occurred"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_url: 'https://example.com',
full_url: 'https://example.com/order-note.json',
method: 'POST',
response_code: 495,
response: {
headers: {
'Cache-Control': 'max-age=3600',
'Content-Type': 'text/html; charset=utf-8',
Connection: 'keep-alive'
},
body: JSON.stringify('<!doctype html>\n<html>\n <head>\n <title>SSL Certificate Error</title>\n </head>\n </html>\n')
},
request: {
headers: {
'Cache-Control': 'max-age=3600',
'Content-Type': 'text/html; charset=utf-8',
Connection: 'keep-alive'
},
payload: {order_note: {note: 'Success'}}
},
created_at: '2023-03-01T02:02:00+01:00',
exception_type: 'requests.exceptions.SSLError',
exception: 'An SSL error occurred'
})
};
fetch('https://panel.sendcloud.sc/api/v3/integrations/{id}/logs', 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://panel.sendcloud.sc/api/v3/integrations/{id}/logs",
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([
'base_url' => 'https://example.com',
'full_url' => 'https://example.com/order-note.json',
'method' => 'POST',
'response_code' => 495,
'response' => [
'headers' => [
'Cache-Control' => 'max-age=3600',
'Content-Type' => 'text/html; charset=utf-8',
'Connection' => 'keep-alive'
],
'body' => '<!doctype html>
<html>
<head>
<title>SSL Certificate Error</title>
</head>
</html>
'
],
'request' => [
'headers' => [
'Cache-Control' => 'max-age=3600',
'Content-Type' => 'text/html; charset=utf-8',
'Connection' => 'keep-alive'
],
'payload' => [
'order_note' => [
'note' => 'Success'
]
]
],
'created_at' => '2023-03-01T02:02:00+01:00',
'exception_type' => 'requests.exceptions.SSLError',
'exception' => 'An SSL error occurred'
]),
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://panel.sendcloud.sc/api/v3/integrations/{id}/logs"
payload := strings.NewReader("{\n \"base_url\": \"https://example.com\",\n \"full_url\": \"https://example.com/order-note.json\",\n \"method\": \"POST\",\n \"response_code\": 495,\n \"response\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"body\": \"<!doctype html>\\n<html>\\n <head>\\n <title>SSL Certificate Error</title>\\n </head>\\n </html>\\n\"\n },\n \"request\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"payload\": {\n \"order_note\": {\n \"note\": \"Success\"\n }\n }\n },\n \"created_at\": \"2023-03-01T02:02:00+01:00\",\n \"exception_type\": \"requests.exceptions.SSLError\",\n \"exception\": \"An SSL error occurred\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://panel.sendcloud.sc/api/v3/integrations/{id}/logs")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"base_url\": \"https://example.com\",\n \"full_url\": \"https://example.com/order-note.json\",\n \"method\": \"POST\",\n \"response_code\": 495,\n \"response\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"body\": \"<!doctype html>\\n<html>\\n <head>\\n <title>SSL Certificate Error</title>\\n </head>\\n </html>\\n\"\n },\n \"request\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"payload\": {\n \"order_note\": {\n \"note\": \"Success\"\n }\n }\n },\n \"created_at\": \"2023-03-01T02:02:00+01:00\",\n \"exception_type\": \"requests.exceptions.SSLError\",\n \"exception\": \"An SSL error occurred\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v3/integrations/{id}/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_url\": \"https://example.com\",\n \"full_url\": \"https://example.com/order-note.json\",\n \"method\": \"POST\",\n \"response_code\": 495,\n \"response\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"body\": \"<!doctype html>\\n<html>\\n <head>\\n <title>SSL Certificate Error</title>\\n </head>\\n </html>\\n\"\n },\n \"request\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"payload\": {\n \"order_note\": {\n \"note\": \"Success\"\n }\n }\n },\n \"created_at\": \"2023-03-01T02:02:00+01:00\",\n \"exception_type\": \"requests.exceptions.SSLError\",\n \"exception\": \"An SSL error occurred\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"integration_id": 123,
"base_url": "https://example.com",
"full_url": "https://example.com/order-note.json",
"method": "POST",
"response_code": 495,
"response": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"body": "<!doctype html>\n<html>\n <head>\n <title>SSL Certificate Error</title>\n </head>\n </html>\n"
},
"request": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"payload": {
"order_note": {
"note": "Success"
}
}
},
"created_at": "2023-03-01T02:02:00+01:00",
"exception_type": "requests.exceptions.SSLError",
"exception": "An SSL error occurred",
"protected": false,
"additional_data": ""
}
}Exception logs
Create integration exception logs
Create integration exception logs, which will appear in the connection issue log screen of the user’s integration.
POST
/
integrations
/
{id}
/
logs
Create integration exception logs
curl --request POST \
--url https://panel.sendcloud.sc/api/v3/integrations/{id}/logs \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"base_url": "https://example.com",
"full_url": "https://example.com/order-note.json",
"method": "POST",
"response_code": 495,
"response": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"body": "<!doctype html>\n<html>\n <head>\n <title>SSL Certificate Error</title>\n </head>\n </html>\n"
},
"request": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"payload": {
"order_note": {
"note": "Success"
}
}
},
"created_at": "2023-03-01T02:02:00+01:00",
"exception_type": "requests.exceptions.SSLError",
"exception": "An SSL error occurred"
}
'import requests
url = "https://panel.sendcloud.sc/api/v3/integrations/{id}/logs"
payload = {
"base_url": "https://example.com",
"full_url": "https://example.com/order-note.json",
"method": "POST",
"response_code": 495,
"response": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"body": "<!doctype html>
<html>
<head>
<title>SSL Certificate Error</title>
</head>
</html>
"
},
"request": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"payload": { "order_note": { "note": "Success" } }
},
"created_at": "2023-03-01T02:02:00+01:00",
"exception_type": "requests.exceptions.SSLError",
"exception": "An SSL error occurred"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_url: 'https://example.com',
full_url: 'https://example.com/order-note.json',
method: 'POST',
response_code: 495,
response: {
headers: {
'Cache-Control': 'max-age=3600',
'Content-Type': 'text/html; charset=utf-8',
Connection: 'keep-alive'
},
body: JSON.stringify('<!doctype html>\n<html>\n <head>\n <title>SSL Certificate Error</title>\n </head>\n </html>\n')
},
request: {
headers: {
'Cache-Control': 'max-age=3600',
'Content-Type': 'text/html; charset=utf-8',
Connection: 'keep-alive'
},
payload: {order_note: {note: 'Success'}}
},
created_at: '2023-03-01T02:02:00+01:00',
exception_type: 'requests.exceptions.SSLError',
exception: 'An SSL error occurred'
})
};
fetch('https://panel.sendcloud.sc/api/v3/integrations/{id}/logs', 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://panel.sendcloud.sc/api/v3/integrations/{id}/logs",
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([
'base_url' => 'https://example.com',
'full_url' => 'https://example.com/order-note.json',
'method' => 'POST',
'response_code' => 495,
'response' => [
'headers' => [
'Cache-Control' => 'max-age=3600',
'Content-Type' => 'text/html; charset=utf-8',
'Connection' => 'keep-alive'
],
'body' => '<!doctype html>
<html>
<head>
<title>SSL Certificate Error</title>
</head>
</html>
'
],
'request' => [
'headers' => [
'Cache-Control' => 'max-age=3600',
'Content-Type' => 'text/html; charset=utf-8',
'Connection' => 'keep-alive'
],
'payload' => [
'order_note' => [
'note' => 'Success'
]
]
],
'created_at' => '2023-03-01T02:02:00+01:00',
'exception_type' => 'requests.exceptions.SSLError',
'exception' => 'An SSL error occurred'
]),
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://panel.sendcloud.sc/api/v3/integrations/{id}/logs"
payload := strings.NewReader("{\n \"base_url\": \"https://example.com\",\n \"full_url\": \"https://example.com/order-note.json\",\n \"method\": \"POST\",\n \"response_code\": 495,\n \"response\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"body\": \"<!doctype html>\\n<html>\\n <head>\\n <title>SSL Certificate Error</title>\\n </head>\\n </html>\\n\"\n },\n \"request\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"payload\": {\n \"order_note\": {\n \"note\": \"Success\"\n }\n }\n },\n \"created_at\": \"2023-03-01T02:02:00+01:00\",\n \"exception_type\": \"requests.exceptions.SSLError\",\n \"exception\": \"An SSL error occurred\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://panel.sendcloud.sc/api/v3/integrations/{id}/logs")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"base_url\": \"https://example.com\",\n \"full_url\": \"https://example.com/order-note.json\",\n \"method\": \"POST\",\n \"response_code\": 495,\n \"response\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"body\": \"<!doctype html>\\n<html>\\n <head>\\n <title>SSL Certificate Error</title>\\n </head>\\n </html>\\n\"\n },\n \"request\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"payload\": {\n \"order_note\": {\n \"note\": \"Success\"\n }\n }\n },\n \"created_at\": \"2023-03-01T02:02:00+01:00\",\n \"exception_type\": \"requests.exceptions.SSLError\",\n \"exception\": \"An SSL error occurred\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v3/integrations/{id}/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_url\": \"https://example.com\",\n \"full_url\": \"https://example.com/order-note.json\",\n \"method\": \"POST\",\n \"response_code\": 495,\n \"response\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"body\": \"<!doctype html>\\n<html>\\n <head>\\n <title>SSL Certificate Error</title>\\n </head>\\n </html>\\n\"\n },\n \"request\": {\n \"headers\": {\n \"Cache-Control\": \"max-age=3600\",\n \"Content-Type\": \"text/html; charset=utf-8\",\n \"Connection\": \"keep-alive\"\n },\n \"payload\": {\n \"order_note\": {\n \"note\": \"Success\"\n }\n }\n },\n \"created_at\": \"2023-03-01T02:02:00+01:00\",\n \"exception_type\": \"requests.exceptions.SSLError\",\n \"exception\": \"An SSL error occurred\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"integration_id": 123,
"base_url": "https://example.com",
"full_url": "https://example.com/order-note.json",
"method": "POST",
"response_code": 495,
"response": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"body": "<!doctype html>\n<html>\n <head>\n <title>SSL Certificate Error</title>\n </head>\n </html>\n"
},
"request": {
"headers": {
"Cache-Control": "max-age=3600",
"Content-Type": "text/html; charset=utf-8",
"Connection": "keep-alive"
},
"payload": {
"order_note": {
"note": "Success"
}
}
},
"created_at": "2023-03-01T02:02:00+01:00",
"exception_type": "requests.exceptions.SSLError",
"exception": "An SSL error occurred",
"protected": false,
"additional_data": ""
}
}OAuth2 scopes required:
write:integration. See Scopes for OAuth apps.Authorizations
HTTPBasicAuthOAuth2ClientCreds
Body
application/json
Request body for creating an integration exception log.