For at bruge disse kodeeksempler skal du ændre URL, Actor ID og Authorization Header
Trin 1.
Book forsendelsen
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 }
}"
Trin 2.
Overfør forsendelsen for at generere EDI-dataene (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\": {}
}"
Trin 3.
Hent listen over alle 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\": {}
}"
Trin 4.
Hent detaljer om den specifikke Batch (156)
curl -s -X GET "http://demo.shipmentserver.com:8080/ShipServer/64/Batches/156" -H "Authorization: Basic dW46cHc=" -H "Content-Type: application/json"
Trin 5.
Hent indholdet af EDI-filen i Batch-rapporten (314)
curl -s -X GET "http://demo.shipmentserver.com:8080/ShipServer/64/BatchReports/314" -H "Authorization: Basic dW46cHc=" -H "Content-Type: application/json"
Trin 6.
Base64-dekrypter Indholdet af svarobjektet