How To: Create a Shipment Request and Decode the Base64
Creating a shipment API request for IShipper and receiving a response, decoding the Base64 to produce a label.
Instructions
- Open Postman and create a shipment request for API 1.6
- Be sure to change the shipment date to the current date - as this will cause an error.
An example request is listed:
<?xml version="1.0" encoding="UTF-8"?> <createShipmentRequest> <integrationHeader> <transactionId>1234-5678-9123</transactionId> <applicationId>INTERSOFT</applicationId> <userId>Intersoft1</userId> <password>Testing@1</password> </integrationHeader> <shipment> <shipper> <shipperCompanyName>pffft</shipperCompanyName> <shipperAddressLine1>Ebnal Bank Farm</shipperAddressLine1> <shipperCity>Malpas</shipperCity> <shipperCountryCode>GB</shipperCountryCode> <shipperPostCode>SY14 8JE</shipperPostCode> <shipperPhoneNumber>0123745657890</shipperPhoneNumber> <shipperReference>25</shipperReference> <shipperDeptCode>4 ITEMS</shipperDeptCode> <shipperContactName>CONTACT NAME</shipperContactName> <shipperVatNumber/> <shipperEmailAddress>SUPPORT@INTERSOFT.CO.UK</shipperEmailAddress> </shipper> <destination> <destinationAddressLine1>Manorfields</destinationAddressLine1> <destinationAddressLine2>Biggin</destinationAddressLine2> <destinationAddressLine3/> <destinationCity>Leeds</destinationCity> <destinationCounty>North Yorkshire</destinationCounty> <destinationCountryCode>GB</destinationCountryCode> <destinationPostCode>LS25 6HJ</destinationPostCode> <destinationContactName>Demo Contact</destinationContactName> <destinationPhoneNumber>079646281506</destinationPhoneNumber> <destinationVatNumber>977064778</destinationVatNumber> <destinationEmailAddress>daveallo47@ntlworld.com</destinationEmailAddress> </destination> <shipmentInformation> <shipmentDate>2019-09-13</shipmentDate> <serviceCode>CRL1</serviceCode> <serviceOptions> <postingLocation>9000257152</postingLocation> <serviceLevel>01</serviceLevel> <serviceFormat>P</serviceFormat> <safePlace/> </serviceOptions> <packages> <package> <packageId>1</packageId> <weight>2</weight> <length>2</length> <width>2</width> <height>2</height> </package> <package> <packageId>2</packageId> <weight>2</weight> <length>2</length> <width>2</width> <height>2</height> </package> </packages> <itemInformation> <itemDescription>quick little testabaroo</itemDescription> <itemQuantity>1</itemQuantity> <itemValue>0.01</itemValue> <itemNetWeight>1</itemNetWeight> </itemInformation> <itemInformation> <itemDescription>Oliver Test Single Variation</itemDescription> <itemQuantity>1</itemQuantity> <itemValue>0.01</itemValue> <itemNetWeight>1</itemNetWeight> </itemInformation> <itemInformation> <itemDescription>Test1</itemDescription> <itemQuantity>1</itemQuantity> <itemValue>0.01</itemValue> <itemNetWeight>1</itemNetWeight> </itemInformation> <itemInformation> <itemDescription>TEST PRODUCT - DO NOT BUY</itemDescription> <itemQuantity>1</itemQuantity> <itemValue>0.01</itemValue> <itemNetWeight>1</itemNetWeight> </itemInformation> <totalPackages>2</totalPackages> <totalWeight>4</totalWeight> <weightId>K</weightId> <product>NDX</product> <descriptionOfGoods>quick little testabaroo|Oliver Test Single VariationTest1|TEST PRODUCT</descriptionOfGoods> <declaredValue>0.04</declaredValue> <declaredCurrencyCode>GBP</declaredCurrencyCode> </shipmentInformation> </shipment> </createShipmentRequest>
4. Ensure a response is received
5. Within the label image section of the response there will be a Base64, this needs to be decoded.
6. Go to: https://www.motobit.com/util/base64-decoder-encoder.asp and paste in the label image Base64
7. Be sure to select decode the data from a base64 string and export as, change this to pdf
8. Click convert and a pdf will opt to open.
Related articles