Dangerous Goods

Adding Dangerous Goods declarations to a consignment

Internally, items in a consignment are stored in "bundles" of 1 or more items. These correspond to each "line" in the web registration interface. When adding DGS declarations to a consignment, you must explicitly provide these bundles, as DGS declarations are associated with them. In each bundle, each item must be enumerated with an <item/> element. Each bundle can have one or more <dangerous_goods> elements attached to it.

Note that using the <bundles> elements overrides the <items> element, as each <item> is now described inside a <bundle>

Consignment XML with DGS declarations
<consignment>
  <!-- ... -->
  <bundles>
    <bundle type="package" weight="2" volume="1" description="Some items with DGS">
      <item/>
      <item/>
      <item/>
      <dangerous_goods un_number="1680" tunnel_code="-" gross_weight="2000" net_weight="1920" labels="6.1" packing_group="1" name="Potassium Cyanide" description="2l of KCN"/>
      <dangerous_goods un_number="1680" tunnel_code="-" gross_weight="1000" net_weight="960" labels="6.1" packing_group="II" name="Potassium Cyanide" description="1l of KCN"/>
    </bundle>
  </bundles>
  <!-- ... -->
</consignment>

Working with the Dangerous Goods items store

Cargonizer can store predefined Dangerous Goods items. Note that these items will never be used by the system as actual DGS declarations; they are only used as a look-up table when entering the declaration on registering a consignment.

Getting list of DGS items as XML
cURL
curl -g -XGET -H'X-Cargonizer-Key: 12345' -H'X-Cargonizer-Sender: 678' 'https://cargonizer.no/dangerous_goods_items.xml'
HTTP
GET /dangerous_goods_items.xml HTTP/1.1 Host: cargonizer.no X-Cargonizer-Key: 12345 X-Cargonizer-Sender: 678
Pseudocode
http = new HTTPRequest(); http.method = 'GET'; http.url = 'https://cargonizer.no/dangerous_goods_items.xml'; http.headers.add('X-Cargonizer-Key', '12345'); http.headers.add('X-Cargonizer-Sender', '678'); response = http.execute();
Returned XML example
<?xml version="1.0" encoding="UTF-8"?> <dangerous-goods-items type="array"> <dangerous-goods-item> <name>2-Ethylbutyraldehyde</name> <description>2-Ethylbutyraldehyde</description> <gross-weight type="integer">10</gross-weight> <net-weight type="integer">10</net-weight> <labels>3B</labels> <un-number>1178</un-number> <packing-group type="integer">2</packing-group> <tunnel-code>-</tunnel-code> </dangerous-goods-item> <dangerous-goods-item> <name>2-Ethylbutyraldehyde</name> <description>2-Ethylbutyraldehyde</description> <gross-weight type="integer">10</gross-weight> <net-weight type="integer">10</net-weight> <labels>3B</labels> <un-number>1178</un-number> <packing-group type="integer">2</packing-group> <tunnel-code>-</tunnel-code> </dangerous-goods-item> </dangerous-goods-items>
Getting list of DGS items as JSON
cURL
curl -g -XGET -H'X-Cargonizer-Key: 12345' -H'X-Cargonizer-Sender: 678' 'https://cargonizer.no/dangerous_goods_items.json'
HTTP
GET /dangerous_goods_items.json HTTP/1.1 Host: cargonizer.no X-Cargonizer-Key: 12345 X-Cargonizer-Sender: 678
Pseudocode
http = new HTTPRequest(); http.method = 'GET'; http.url = 'https://cargonizer.no/dangerous_goods_items.json'; http.headers.add('X-Cargonizer-Key', '12345'); http.headers.add('X-Cargonizer-Sender', '678'); response = http.execute();
Returned JSON example
[ { "un_number": "1178", "tunnel_code": "-", "packing_group": 2, "net_weight": 10, "name": "2-Ethylbutyraldehyde", "labels": "3B", "gross_weight": 10, "description": "2-Ethylbutyraldehyde" }, { "un_number": "1178", "tunnel_code": "-", "packing_group": 2, "net_weight": 10, "name": "2-Ethylbutyraldehyde", "labels": "3B", "gross_weight": 10, "description": "2-Ethylbutyraldehyde" } ]
Getting a single DGS item as XML
cURL
curl -g -XGET -H'X-Cargonizer-Key: 12345' -H'X-Cargonizer-Sender: 678' 'https://cargonizer.no/dangerous_goods_items/1.xml'
HTTP
GET /dangerous_goods_items/1.xml HTTP/1.1 Host: cargonizer.no X-Cargonizer-Key: 12345 X-Cargonizer-Sender: 678
Pseudocode
http = new HTTPRequest(); http.method = 'GET'; http.url = 'https://cargonizer.no/dangerous_goods_items/1.xml'; http.headers.add('X-Cargonizer-Key', '12345'); http.headers.add('X-Cargonizer-Sender', '678'); response = http.execute();
Returned XML example
<?xml version="1.0" encoding="UTF-8"?> <dangerous-goods-item> <name>2-Ethylbutyraldehyde</name> <description>2-Ethylbutyraldehyde</description> <gross-weight type="integer">10</gross-weight> <net-weight type="integer">10</net-weight> <labels>3B</labels> <un-number>1178</un-number> <packing-group type="integer">2</packing-group> <tunnel-code>-</tunnel-code> </dangerous-goods-item>
Getting a single DGS item as JSON
cURL
curl -g -XGET -H'X-Cargonizer-Key: 12345' -H'X-Cargonizer-Sender: 678' 'https://cargonizer.no/dangerous_goods_items/1.json'
HTTP
GET /dangerous_goods_items/1.json HTTP/1.1 Host: cargonizer.no X-Cargonizer-Key: 12345 X-Cargonizer-Sender: 678
Pseudocode
http = new HTTPRequest(); http.method = 'GET'; http.url = 'https://cargonizer.no/dangerous_goods_items/1.json'; http.headers.add('X-Cargonizer-Key', '12345'); http.headers.add('X-Cargonizer-Sender', '678'); response = http.execute();
Returned JSON example
{ "un_number": "1178", "tunnel_code": "-", "packing_group": 2, "net_weight": 10, "name": "2-Ethylbutyraldehyde", "labels": "3B", "gross_weight": 10, "description": "2-Ethylbutyraldehyde" },
Creating a DGS item using XML
cURL
curl -g -XPOST Denne e-postadressen er beskyttet mot programmer som samler e-postadresser. Du må aktivere javaskript for å kunne se den. -H'Content-Type: application/xml' -H'X-Cargonizer-Key: 12345' -H'X-Cargonizer-Sender: 678' 'https://cargonizer.no/dangerous_goods_items.xml'
HTTP
POST /dangerous_goods_items.xml HTTP/1.1 Host: cargonizer.no Content-Type: application/xml X-Cargonizer-Key: 12345 X-Cargonizer-Sender: 678 <contents of file "dgs.xml">
Pseudocode
http = new HTTPRequest(); http.method = 'POST'; http.url = 'https://cargonizer.no/dangerous_goods_items.xml'; http.headers.add('Content-Type', 'application/xml'); http.headers.add('X-Cargonizer-Key', '12345'); http.headers.add('X-Cargonizer-Sender', '678'); http.body = new File('dgs.xml').read(); response = http.execute();
dgs.xml
<dangerous-goods-item> <name>2-Ethylbutyraldehyde</name> <description>2-Ethylbutyraldehyde</description> <gross-weight type="integer">10</gross-weight> <net-weight type="integer">10</net-weight> <labels>3B</labels> <un-number>1178</un-number> <packing-group type="integer">2</packing-group> <tunnel-code>-</tunnel-code> </dangerous-goods-item>
Creating a DGS item using JSON
cURL
curl -g -XPOST Denne e-postadressen er beskyttet mot programmer som samler e-postadresser. Du må aktivere javaskript for å kunne se den. -H'Content-Type: application/json' -H'X-Cargonizer-Key: 12345' -H'X-Cargonizer-Sender: 678' 'https://cargonizer.no/dangerous_goods_items.json'
HTTP
POST /dangerous_goods_items.json HTTP/1.1 Host: cargonizer.no Content-Type: application/json X-Cargonizer-Key: 12345 X-Cargonizer-Sender: 678 <contents of file "dgs.json">
Pseudocode
http = new HTTPRequest(); http.method = 'POST'; http.url = 'https://cargonizer.no/dangerous_goods_items.json'; http.headers.add('Content-Type', 'application/json'); http.headers.add('X-Cargonizer-Key', '12345'); http.headers.add('X-Cargonizer-Sender', '678'); http.body = new File('dgs.json').read(); response = http.execute();
dgs.json
{ "un_number": "1178", "tunnel_code": "-", "packing_group": 2, "net_weight": 10, "name": "2-Ethylbutyraldehyde", "labels": "3B", "gross_weight": 10, "description": "2-Ethylbutyraldehyde" }
Deleting a DGS item
This will return HTTP status 204 when successful
cURL
curl -g -XDELETE -H'X-Cargonizer-Key: 12345' -H'X-Cargonizer-Sender: 678' 'https://cargonizer.no/dangerous_goods_items/1'
HTTP
DELETE /dangerous_goods_items/1 HTTP/1.1 Host: cargonizer.no X-Cargonizer-Key: 12345 X-Cargonizer-Sender: 678
Pseudocode
http = new HTTPRequest(); http.method = 'DELETE'; http.url = 'https://cargonizer.no/dangerous_goods_items/1'; http.headers.add('X-Cargonizer-Key', '12345'); http.headers.add('X-Cargonizer-Sender', '678'); response = http.execute();

 

 

 

Developer: Cargonizer API Documentation © Logistra AS   Øran Vest, 6300 Åndalsnes   Denne e-postadressen er beskyttet mot programmer som samler e-postadresser. Du må aktivere javaskript for å kunne se den.logistra facebook icon logistra twitter icon

Vi bruker informasjonskapsler (cookies) for å forbedre bruksopplevelsen og for å kunne føre statistikk over våre besøkende.