API Endpoints
Ocean Tracking
Subscribe Container
2 min
{ "tab" "examples", "url" "https //tnt api rpalabs io/api/v1/track and trace/ocean/containers/subscribe", "name" "overview", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "kind" "required", "name" "authorization", "type" "string", "children" \[], "description" "bearer access token from login api" } ], "bodydataparameters" \[ { "kind" "required", "name" "carrier code", "type" "string", "description" "carrier code of the specific cargo" }, { "kind" "required", "name" "container number", "type" "string", "description" "container number" }, { "kind" "required", "name" "mbl number", "type" "string", "description" "mbl number of the specific container" } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "vblfofahn7 otbbducsad", "code" "{\n \\"message\\" \\"container was subscribed successfully\\"\n}", "language" "200", "customlabel" "" }, { "id" "0c wlircgni2egmtaqqtw", "code" "{\r\n \\"message\\" \\"we are sorry but we are not able to authenticate you please use access token from the login steps\\",\r\n \\"status\\" 401,\r\n \\"error code\\" 2\r\n}", "language" "401", "customlabel" "" } ], "selectedlanguageid" "vblfofahn7 otbbducsad" }, "examples" { "languages" \[ { "id" "c4mfshqqc7d8xkvd3li2v", "code" "curl location request post 'https //tnt api rpalabs io/api/v1/track and trace/ocean/containers/subscribe' \\\\\n header 'accept application/json' \\\\\n data raw '{\\"carrier code\\" \\"string\\",\\"container number\\" \\"string\\",\\"mbl number\\" \\"string\\"}'", "language" "curl", "customlabel" "" }, { "id" "a1ss3i8horojstaajbr6b", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //tnt api rpalabs io/api/v1/track and trace/ocean/containers/subscribe',\n 'headers' {\n 'accept' 'application/json'\n },\n body '{\\"carrier code\\" \\"string\\",\\"container number\\" \\"string\\",\\"mbl number\\" \\"string\\"}'\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "language" "nodejs", "customlabel" "" }, { "id" "jogxypzn1wzrp zqwvqtf", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\n\nvar raw = \\"{\\\\\\"carrier code\\\\\\" \\\\\\"string\\\\\\",\\\\\\"container number\\\\\\" \\\\\\"string\\\\\\",\\\\\\"mbl number\\\\\\" \\\\\\"string\\\\\\"}\\";\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //tnt api rpalabs io/api/v1/track and trace/ocean/containers/subscribe\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "language" "javascript", "customlabel" "" }, { "id" "xtyaunkfcibqvza1766m9", "code" "import http client\n\nconn = http client httpsconnection(\\"tnt api rpalabs io\\")\npayload = \\"{\\\\\\"carrier code\\\\\\" \\\\\\"string\\\\\\",\\\\\\"container number\\\\\\" \\\\\\"string\\\\\\",\\\\\\"mbl number\\\\\\" \\\\\\"string\\\\\\"}\\"\nheaders = {\n 'accept' 'application/json'\n}\nconn request(\\"post\\", \\"/api/v1/track and trace/ocean/containers/subscribe\\", payload, headers)\nres = conn getresponse()\ndata = res read()\nprint(data decode(\\"utf 8\\"))", "language" "python", "customlabel" "" }, { "id" "yhdmno5nf7lcgudxmloq ", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //tnt api rpalabs io/api/v1/track and trace/ocean/containers/subscribe\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\nrequest body = \\"{\\\\\\"carrier code\\\\\\" \\\\\\"string\\\\\\",\\\\\\"container number\\\\\\" \\\\\\"string\\\\\\",\\\\\\"mbl number\\\\\\" \\\\\\"string\\\\\\"}\\"\n\nresponse = https request(request)\nputs response read body\n", "language" "ruby", "customlabel" "" } ], "selectedlanguageid" "c4mfshqqc7d8xkvd3li2v" }, "description" "this endpoint lets users to subscribe container and allows the container information to be stored in the database ", "currentnewparameter" { "label" "header parameter", "value" "headerparameters" } } see the error handling page for troubleshooting any errors âī¸ need some help? if you encounter a problem or require assistance, please contact our support team with details regarding your request at support\@rippey ai a representative will connect with you soon đ

