Retrieve a parcels report
curl --request GET \
--url https://panel.sendcloud.sc/api/v2/reporting/parcels/{report_id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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://panel.sendcloud.sc/api/v2/reporting/parcels/{report_id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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{
"filters": {
"direction": "outgoing",
"integration_id": 2,
"updated_after": "2023-11-07T05:31:56Z",
"updated_before": "2023-11-07T05:31:56Z",
"announced_after": "2023-11-07T05:31:56Z",
"announced_before": "2023-11-07T05:31:56Z"
},
"fields": [
"parcel_id"
],
"id": "419f3be0-2f49-434b-bee4-d8cff9cf7d01",
"user_id": 1,
"status": "ready",
"status_message": "The report is ready",
"url": "https://reporting-service.s3.eu-central-1.amazonaws.com/reports/report-type/2021-08-09/afc46bb9-95d3-4880-80f7-660da3e68b5c.csv",
"expires_at": "2022-07-14T08:38:10.226217Z",
"updated_at": "2022-07-14T08:23:10.226265Z",
"created_at": "2022-07-14T08:23:10.226265Z"
}{
"loc": [
"path"
],
"msg": "value is not a valid uuid",
"type": "type_error.uuid",
"ctx": {
"enum_values": [
"parcel_id"
]
}
}Reporting API
Retrieve a parcels report
Generate a URL to download a parcels report in CSV format.
GET
/
reporting
/
parcels
/
{report_id}
Retrieve a parcels report
curl --request GET \
--url https://panel.sendcloud.sc/api/v2/reporting/parcels/{report_id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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://panel.sendcloud.sc/api/v2/reporting/parcels/{report_id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v2/reporting/parcels/{report_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{
"filters": {
"direction": "outgoing",
"integration_id": 2,
"updated_after": "2023-11-07T05:31:56Z",
"updated_before": "2023-11-07T05:31:56Z",
"announced_after": "2023-11-07T05:31:56Z",
"announced_before": "2023-11-07T05:31:56Z"
},
"fields": [
"parcel_id"
],
"id": "419f3be0-2f49-434b-bee4-d8cff9cf7d01",
"user_id": 1,
"status": "ready",
"status_message": "The report is ready",
"url": "https://reporting-service.s3.eu-central-1.amazonaws.com/reports/report-type/2021-08-09/afc46bb9-95d3-4880-80f7-660da3e68b5c.csv",
"expires_at": "2022-07-14T08:38:10.226217Z",
"updated_at": "2022-07-14T08:23:10.226265Z",
"created_at": "2022-07-14T08:23:10.226265Z"
}{
"loc": [
"path"
],
"msg": "value is not a valid uuid",
"type": "type_error.uuid",
"ctx": {
"enum_values": [
"parcel_id"
]
}
}OAuth2 scopes required:
read:analytics. See Scopes for OAuth apps.id is the one you obtained via the Create a parcels report endpoint.
Depending on the size of the report, it may not be immediately available for download. The status of the report is indicated in the response body under the status_message field.
The report will expire after a certain amount of time, after which you will have to generate it again. The time of expiry is indicated in the response body under the expires_at field.Authorizations
HTTPBasicAuthOAuth2ClientCreds
Response
Successful Response
Report information
This model contains information about the creation of a report and the status of processing such report.
The parcel fields to include for the report
Available options:
parcel_id, direction, carrier_code, carrier_name, from_company_name, contract_id, contract_type, origin_city, origin_postal_code, origin_country_code, origin_country_name, destination_city, destination_postal_code, destination_country_code, destination_country_name, order_number, tracking_number, created_at, updated_at, announced_at, shipped_at, first_delivery_at, arrived_at, shipping_method, shipping_method_name, price, global_status_slug, carrier_status, integration_id, integration_type, weight