Spedizioni e Dintorni Reprint Reprint labels on file
Utility endpoint to regenerate the print files of the labels of a shipping. This endpoint can be used if you have a Gsped Labeling Machine or if the file are retrieved via FTP.
Reprint the labels
GET
https://api.gsped.it/[INSTANCE]/reprint/[shipment_id]
Path Parameters
Copy {
"error": "ID Spedizione deve essere un intero"
}
Copy {
"status": false,
"error": "Invalid API key "
}
Copy {
"error": "Spedizione non trovata"
}
Example Snippets
Copy <?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gsped.it/sandbox/reprint/1234",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"x-api-key: YOUR-API-KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Copy import http.client
conn = http.client.HTTPSConnection("api.gsped.it")
payload = ""
headers = { 'x-api-key': "YOUR-API-KEY" }
conn.request("GET", "/sandbox/reprint/1234", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Copy package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.gsped.it/sandbox/reprint/1234"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "YOUR-API-KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Copy var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.gsped.it/sandbox/reprint/1234"),
Headers =
{
{ "x-api-key", "YOUR-API-KEY" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
Copy curl --request GET \
--url https://api.gsped.it/sandbox/reprint/1234 \
--header 'x-api-key: YOUR-API-KEY'