API Documentation
Italiano
Search
K

Shipment Confirm By Ddt Num

Come la shipmentConfirm, questo endpoint è dedicato per confermare le spedizioni senza utilizzare l'id della spedizione (riferimento interno Gsped) ma utilizzando il riferimento numerico dato alla spedizione.
IMPORTANTE : Il riferimento numerico deve essere univoco (non deve esserci più di una spedizione con lo stesso riferimento).
post
https://api.gsped.it
/[ISTANZA]/ShipmentConfirmByDdtdum
Conferma spedizione utilizzando riferimento numerico

Snippets codice di esempio :

PHP
Python
GO
C#
cURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.gsped.it/sandbox/ShipmentConfirmByDdtnum',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"ddt_num": [
"123",
"124"
]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'x-api-key: YOUR-API-KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import json
conn = http.client.HTTPSConnection("api.gsped.it")
payload = json.dumps({
"ddt_num": [
"123",
"124"
]
})
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR-API-KEY'
}
conn.request("POST", "/sandbox/ShipmentConfirmByDdtnum", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.gsped.it/sandbox/ShipmentConfirmByDdtnum"
method := "POST"
payload := strings.NewReader(`{
"ddt_num": [
"123",
"124"
]
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-api-key", "YOUR-API-KEY")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new RestClient("https://api.gsped.it/sandbox/ShipmentConfirmByDdtnum");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("x-api-key", "YOUR-API-KEY");
var body = @"{" + "\n" +
@" ""ddt_num"": [" + "\n" +
@" ""123""," + "\n" +
@" ""124""" + "\n" +
@" ]" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.gsped.it/sandbox/ShipmentConfirmByDdtnum' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR-API-KEY' \
--data-raw '{
"ddt_num": [
"123",
"124"
]
}'