To use these snippets you need to change the URL, Actor ID, and the Authorization Header
Step 1.
Book the shipment
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 } }"
Step 2.
Transmit the shipment to generate the 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\": {} }"
Step 3.
Get the list of all 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\": {} }"
Step 4.
Get the details of the specific Batch (156)
curl -s -X GET "http://demo.shipmentserver.com:8080/ShipServer/64/Batches/156" -H "Authorization: Basic dW46cHc=" -H "Content-Type: application/json"
Step 5.
Get the content of the EDI file in the Batch Report (314)
curl -s -X GET "http://demo.shipmentserver.com:8080/ShipServer/64/BatchReports/314" -H "Authorization: Basic dW46cHc=" -H "Content-Type: application/json"
Step 6.
Base64decode the Content of the response object