Difference between revisions of "SNIPER IMDG API"

From SNIPER Systems
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 48: Line 48:
 
cache-control: no-cache
 
cache-control: no-cache
 
{
 
{
     "op" : "ser",
+
     "op" : "unno",
 
     "unno" : "0015"
 
     "unno" : "0015"
}<nowiki>
+
}</nowiki>
  
  
Line 93: Line 93:
 
         }
 
         }
 
     ]
 
     ]
}
+
}</nowiki>
 +
 
 +
 
 +
 
 +
=== GET IMDG Data by Class ===
 +
 
 +
In a few simple steps, we will explain how to get IMDG Data by Class using SNIPER IMDG API.
 +
 
 +
Firstly, you'll need a valid SNIPER IMDG account. inside your account, you can find your token.
 +
 
 +
The request should like:
 +
 
 +
<nowiki>
 +
POST /api.php HTTP/1.1
 +
Host: imdg.domain.com
 +
Content-Type: application/json
 +
Authorization: Bearer VUNH0lBAc2N6MHJk
 +
cache-control: no-cache
 +
{
 +
    "op" : "class",
 +
    "unno" : "1.1"
 +
}</nowiki>
 +
 
 +
 
 +
==== GET IMDG Data by Class Response ====
 +
 
 +
After the "Search" HTTP request was submitted to the SNIPER IMDG APII, you will get a response containing all information. If everything went well, it should provide a 200 OK response with requested information in the response body.
 +
 
 +
Here is an example of the Response:
 +
<nowiki>
 +
{
 +
    "records": [
 +
        {
 +
            "unno": "0005",
 +
            "variant": "",
 +
            "cvl": null,
 +
            "variation": null,
 +
            "class": "1.1F",
 +
            "sublabel1": "",
 +
            "sublabel2": "",
 +
            "psn": "CARTRIDGES FOR WEAPONS\nwith bursting charge",
 +
            "pg": "",
 +
            "ems": "F-B, S-X",
 +
            "mp": "",
 +
            "fp": "",
 +
            "lq": "0",
 +
            "eq": "E0",
 +
            "techname": "",
 +
            "treatas": "",
 +
            "dglphrase": "",
 +
            "seg": "",
 +
            "specprov": "",
 +
            "packins": "P130",
 +
            "packprov": "",
 +
            "ibcins": "",
 +
            "ibcprov": "",
 +
            "untankins": "",
 +
            "tankprov": "",
 +
            "stowcat": "05",
 +
            "explim": "",
 +
            "ulineems": "3",
 +
            "labels": "1.1F "
 +
        }
 +
    ]
 +
}</nowiki>
 +
 
 +
 
 +
=== GET IMDG Data by Subsidiary Risk(s) ===
 +
 
 +
In a few simple steps, we will explain how to get IMDG Data by Subsidiary Risk(s) using SNIPER IMDG API.
 +
 
 +
Firstly, you'll need a valid SNIPER IMDG account. inside your account, you can find your token.
 +
 
 +
The request should like:
 +
 
 +
<nowiki>
 +
POST /api.php HTTP/1.1
 +
Host: imdg.domain.com
 +
Content-Type: application/json
 +
Authorization: Bearer VUNH0lBAc2N6MHJk
 +
cache-control: no-cache
 +
{
 +
    "op" : "subrisk",
 +
    "unno" : "6.1"
 +
}</nowiki>
 +
 
 +
 
 +
==== GET IMDG Data by Subsidiary Risk(s) Response ====
 +
 
 +
After the "Search" HTTP request was submitted to the SNIPER IMDG APII, you will get a response containing all information. If everything went well, it should provide a 200 OK response with requested information in the response body.
 +
 
 +
Here is an example of the Response:
 +
<nowiki>
 +
{
 +
    "records": [
 +
        {
 +
            "unno": "0018",
 +
            "variant": "",
 +
            "cvl": "",
 +
            "variation": "",
 +
            "class": "1.2G",
 +
            "sublabel1": "6.1",
 +
            "sublabel2": "8",
 +
            "psn": "AMMUNITION, TEAR- PRODUCING with burster, expelling charge or propelling charge",
 +
            "pg": "",
 +
            "ems": "F-B, S-Z",
 +
            "mp": "",
 +
            "fp": "",
 +
            "lq": "0",
 +
            "eq": "E0",
 +
            "techname": "",
 +
            "treatas": "",
 +
            "dglphrase": "",
 +
            "seg": "SG2",
 +
            "specprov": "",
 +
            "packins": "P130\nLP101",
 +
            "packprov": "PP67\nL1",
 +
            "ibcins": "",
 +
            "ibcprov": "",
 +
            "untankins": "",
 +
            "tankprov": "",
 +
            "stowcat": "03",
 +
            "explim": "",
 +
            "ulineems": "3",
 +
            "labels": "1.2G 6.1 8 "
 +
        },
 +
        {
 +
            "unno": "0019",
 +
            "variant": "",
 +
            "cvl": "0002",
 +
            "variation": "All other types.",
 +
            "class": "1.3G",
 +
            "sublabel1": "6.1",
 +
            "sublabel2": "8",
 +
            "psn": "AMMUNITION,\nTEAR-PRODUCING with burster, expelling charge or propelling charge",
 +
            "pg": "",
 +
            "ems": "F-B, S-Z",
 +
            "mp": "",
 +
            "fp": "",
 +
            "lq": "0",
 +
            "eq": "E0",
 +
            "techname": "",
 +
            "treatas": "",
 +
            "dglphrase": "",
 +
            "seg": "SG3",
 +
            "specprov": "",
 +
            "packins": "P130\nLP101",
 +
            "packprov": "PP67\nL1",
 +
            "ibcins": "",
 +
            "ibcprov": "",
 +
            "untankins": "",
 +
            "tankprov": "",
 +
            "stowcat": "03",
 +
            "explim": "",
 +
            "ulineems": "3",
 +
            "labels": "1.3G 6.1 8 "
 +
        }
 +
    ]
 +
}</nowiki>

Latest revision as of 18:48, 7 January 2019

Introduction

This wiki will provide instruction and examples on how to use SNIPER IMDG API.

What is International Maritime Dangerous Goods Code (IMDG)?

The International Maritime Dangerous Goods or IMDG Code was adopted in 1965 as per the SOLAS (Safety for Life at Sea) Convention of 1960 under the IMO. The IMDG Code was formed to prevent all types of pollutions at sea.

The IMDG code also ensures that the goods transported through seaways are packaged in such a way that they can be safely transported. The dangerous goods code is a uniform code. This means that the code is applicable to all cargo-carrying ships around the world.

SNIPER IMDG API

The HTTP application programming interface (HTTP API) is the easiest way to integrate with IMDG API using standardized REST interface.

Base URL

Submit all requests to the base URL. All the requests are submitted through the HTTP POST method. We strongly recommend you to submit all requests to SNIPER IMDG API over HTTPS so the traffic is encrypted and the privacy is ensured.

Base URL: http://sampledomain.com/api.php

Content-Type & Accept header

SNIPER IMDG API supports JSON Content-Types and Accept criteria that should be specified in the header. If the Content-Type is not specified you will receive a General error. Depending which Accept type is chosen in the deader for the request, the same one will be applied in the response.

Content-Type: application/json Accept header: application/json

Authorization

We support Bearer Authentication that involves security tokens called bearer tokens.

Example: Authorization header: Bearer VUNH0lBAc2N6MHJk


GET IMDG Data by UN No.

In a few simple steps, we will explain how to get IMDG Data by UN No. using SNIPER IMDG API.

Firstly, you'll need a valid SNIPER IMDG account. inside your account, you can find your token.

The request should like:

POST /api.php HTTP/1.1
Host: imdg.domain.com
Content-Type: application/json
Authorization: Bearer VUNH0lBAc2N6MHJk
cache-control: no-cache
{
    "op" : "unno",
    "unno" : "0015"
}


GET IMDG Data by UN No. Response

After the "Search" HTTP request was submitted to the SNIPER IMDG APII, you will get a response containing all information. If everything went well, it should provide a 200 OK response with requested information in the response body.

Here is an example of the Response:

{
    "records": [
        {
            "unno": "0005",
            "variant": "",
            "cvl": null,
            "variation": null,
            "class": "1.1F",
            "sublabel1": "",
            "sublabel2": "",
            "psn": "CARTRIDGES FOR WEAPONS\nwith bursting charge",
            "pg": "",
            "ems": "F-B, S-X",
            "mp": "",
            "fp": "",
            "lq": "0",
            "eq": "E0",
            "techname": "",
            "treatas": "",
            "dglphrase": "",
            "seg": "",
            "specprov": "",
            "packins": "P130",
            "packprov": "",
            "ibcins": "",
            "ibcprov": "",
            "untankins": "",
            "tankprov": "",
            "stowcat": "05",
            "explim": "",
            "ulineems": "3",
            "labels": "1.1F "
        }
    ]
}


GET IMDG Data by Class

In a few simple steps, we will explain how to get IMDG Data by Class using SNIPER IMDG API.

Firstly, you'll need a valid SNIPER IMDG account. inside your account, you can find your token.

The request should like:

POST /api.php HTTP/1.1
Host: imdg.domain.com
Content-Type: application/json
Authorization: Bearer VUNH0lBAc2N6MHJk
cache-control: no-cache
{
    "op" : "class",
    "unno" : "1.1"
}


GET IMDG Data by Class Response

After the "Search" HTTP request was submitted to the SNIPER IMDG APII, you will get a response containing all information. If everything went well, it should provide a 200 OK response with requested information in the response body.

Here is an example of the Response:

{
    "records": [
        {
            "unno": "0005",
            "variant": "",
            "cvl": null,
            "variation": null,
            "class": "1.1F",
            "sublabel1": "",
            "sublabel2": "",
            "psn": "CARTRIDGES FOR WEAPONS\nwith bursting charge",
            "pg": "",
            "ems": "F-B, S-X",
            "mp": "",
            "fp": "",
            "lq": "0",
            "eq": "E0",
            "techname": "",
            "treatas": "",
            "dglphrase": "",
            "seg": "",
            "specprov": "",
            "packins": "P130",
            "packprov": "",
            "ibcins": "",
            "ibcprov": "",
            "untankins": "",
            "tankprov": "",
            "stowcat": "05",
            "explim": "",
            "ulineems": "3",
            "labels": "1.1F "
        }
    ]
}


GET IMDG Data by Subsidiary Risk(s)

In a few simple steps, we will explain how to get IMDG Data by Subsidiary Risk(s) using SNIPER IMDG API.

Firstly, you'll need a valid SNIPER IMDG account. inside your account, you can find your token.

The request should like:

POST /api.php HTTP/1.1
Host: imdg.domain.com
Content-Type: application/json
Authorization: Bearer VUNH0lBAc2N6MHJk
cache-control: no-cache
{
    "op" : "subrisk",
    "unno" : "6.1"
}


GET IMDG Data by Subsidiary Risk(s) Response

After the "Search" HTTP request was submitted to the SNIPER IMDG APII, you will get a response containing all information. If everything went well, it should provide a 200 OK response with requested information in the response body.

Here is an example of the Response:

{
    "records": [
        {
            "unno": "0018",
            "variant": "",
            "cvl": "",
            "variation": "",
            "class": "1.2G",
            "sublabel1": "6.1",
            "sublabel2": "8",
            "psn": "AMMUNITION, TEAR- PRODUCING with burster, expelling charge or propelling charge",
            "pg": "",
            "ems": "F-B, S-Z",
            "mp": "",
            "fp": "",
            "lq": "0",
            "eq": "E0",
            "techname": "",
            "treatas": "",
            "dglphrase": "",
            "seg": "SG2",
            "specprov": "",
            "packins": "P130\nLP101",
            "packprov": "PP67\nL1",
            "ibcins": "",
            "ibcprov": "",
            "untankins": "",
            "tankprov": "",
            "stowcat": "03",
            "explim": "",
            "ulineems": "3",
            "labels": "1.2G 6.1 8 "
        },
        {
            "unno": "0019",
            "variant": "",
            "cvl": "0002",
            "variation": "All other types.",
            "class": "1.3G",
            "sublabel1": "6.1",
            "sublabel2": "8",
            "psn": "AMMUNITION,\nTEAR-PRODUCING with burster, expelling charge or propelling charge",
            "pg": "",
            "ems": "F-B, S-Z",
            "mp": "",
            "fp": "",
            "lq": "0",
            "eq": "E0",
            "techname": "",
            "treatas": "",
            "dglphrase": "",
            "seg": "SG3",
            "specprov": "",
            "packins": "P130\nLP101",
            "packprov": "PP67\nL1",
            "ibcins": "",
            "ibcprov": "",
            "untankins": "",
            "tankprov": "",
            "stowcat": "03",
            "explim": "",
            "ulineems": "3",
            "labels": "1.3G 6.1 8 "
        }
    ]
}