För att använda dessa kodsnuttar behöver du ändra URL, Actor ID och Authorization Header
Steg 1.
Boka sändningen
curl -s -X POST "http://demo.shipmentserver.com:8080/ShipServer/64/Shipments"
-H "Authorization: Basic dW46cHc="
-H "Content-Type: application/json"
--data-raw "{
\"data\": {
\"ProdConceptID\": 1782,
\"OrderNo\": \"Test Shipment 1\",
\"Addresses\": [{
\"Kind\": 1,
\"Name1\": \"Test Receiver Name1\",
\"Street1\": \"Test Road 1\",
\"PostCode\": 7400,
\"City\": \"Herning\",
\"CountryCode\": \"DK\",
\"Phone\": \"12341234\",
\"Mobile\": \"12341234\",
\"Email\": \"noreply@nshift.com\",
\"Attention\": \"Test Attention\"
}],
\"Lines\":[{
\"Number\": 1,
\"PkgWeight\": 10000,
\"Height\": 100,
\"Length\": 100,
\"Width\": 100,
\"GoodsTypeID\": 13,
\"References\": [{
\"Kind\": 23,
\"Value\": \"Test Shipment - Do not process !\"
}]
}]
},
\"options\": { \"Labels\": \"ZPLGK\", \"ReturnShipment\": 1 }
}"
Steg 2.
Skicka sändningen för att generera EDI-data (160786)
curl -s -X PUT "http://demo.shipmentserver.com:8080/ShipServer/64/Shipments/Manifest"
-H "Authorization: Basic dW46cHc="
-H "Content-Type: application/json"
--data-raw "{
\"data\": {
\"ShipmentCSIDs\": [160786]
},
\"options\": {}
}"
Steg 3.
Hämta listan över alla Transmitted Batches
curl -s -X POST "http://demo.shipmentserver.com:8080/ShipServer/64/Batches"
-H "Authorization: Basic dW46cHc="
-H "Content-Type: application/json"
--data-raw "{
\"data\": {
\"StartIndex\": \"0\",
\"Count\": 5,
\"SortField\": \"TransmitDt\",
\"SortDirection\": 1
},
\"options\": {}
}"
Steg 4.
Hämta detaljerna för den specifika batchen (156)
curl -s -X GET "http://demo.shipmentserver.com:8080/ShipServer/64/Batches/156" -H "Authorization: Basic dW46cHc=" -H "Content-Type: application/json"
Steg 5.
Hämta innehållet i EDI-filen i Batchrapporten (314)
curl -s -X GET "http://demo.shipmentserver.com:8080/ShipServer/64/BatchReports/314" -H "Authorization: Basic dW46cHc=" -H "Content-Type: application/json"
Steg 6.
Base64-avkoda Content i svarobjektet