nomad_pilot v1.31.1
nomad_pilot
NomadPilot - JavaScript client for nomadpilot
This is the API descriptor for the Nomad Pilot API, responsible for shipping and logistics processing.
Developed by Samarkand Global <https://samarkand.global>
in partnership with SF Express <https://www.sf- express.com/cn/sc/>
, eSinotrans <http://www.esinotrans.com/haitao.html>
.
Read the documentation online at Nomad API Suite <https://api.samarkand.io/>
and Check out the detailed changelog <https://gitlab.com/samarkand-nomad/nomad_readme/-/raw/master/history/nomad_pilot.md>
.
Install for node with
npm install nomad_pilot_cli
- Install for python withpip install nomad-pilot-cli
This SDK is automatically generated by the OpenAPI Generator project:API version: 1.31.1
- Package version: 1.31.1
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install nomad_pilot --save
Finally, you need to build the module:
npm run build
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
To use the link you just defined in your project, switch to the directory you want to use your nomad_pilot from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
Finally, you need to build the module:
npm run build
git
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var NomadPilot = require('nomad_pilot');
var defaultClient = NomadPilot.ApiClient.instance;
// Configure API key authorization: ca_key
var ca_key = defaultClient.authentications['ca_key'];
ca_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_key.apiKeyPrefix['x-ca-key'] = "Token"
var api = new NomadPilot.FreightForwardApi()
var carrier = "carrier_example"; // {String} Carrier to ship with
var status = "'UNPROCESSED'"; // {String} package status, 5 available options: UNPROCESSED, PACKED, PROCESSED, SHIPPED, CANCEL
var pageNo = 1; // {Number} Page number, between 1 and 1000
var pageSize = 10; // {Number} Page size, options: [1, 10, 50, 100, 1000]
var opts = {
'trackingRefs': ["null"], // {[String]} String name of tracking reference by Express Company. One or more tracking references: [SF1026045099931, SF1025950147480]
'createdRange': "createdRange_example" // {String} the time range of package update, use ISO_8601 format here, e.g. 2020-07-10T13:00:00Z/2020-07-11T15:30:00Z
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.queryFreightForward(carrier, status, pageNo, pageSize, opts, callback);
Documentation for API Endpoints
All URIs are relative to https://nomad.samarkand-global.cn/pilot
Class | Method | HTTP request | Description |
---|---|---|---|
NomadPilot.FreightForwardApi | queryFreightForward | GET /freight-forward/{carrier} | queryFreightForward |
NomadPilot.QuickShipApi | quickShip | POST /quick-ship/{carrier} | quickShip |
NomadPilot.ShipApi | cancelShip | DELETE /ship/{carrier}/order/{order_ref} | cancelShip |
NomadPilot.ShipApi | putShip | PUT /ship/{carrier} | ship |
NomadPilot.ShipApi | queryShip | GET /ship/{carrier}/order/{order_ref} | queryShip |
NomadPilot.ShipApi | ship | POST /ship/{carrier} | ship |
NomadPilot.ShipConfirmApi | shipConfirm | POST /ship/{carrier}/confirm | shipConfirm |
Documentation for Models
- NomadPilot.Address
- NomadPilot.AddressRequired
- NomadPilot.AddressShip
- NomadPilot.ApiResponse
- NomadPilot.ApiResponseConnectorResponse
- NomadPilot.ApiResponseData
- NomadPilot.ApiResponseGeneral
- NomadPilot.Dimension
- NomadPilot.Goldjet
- NomadPilot.ModelPackage
- NomadPilot.Pack
- NomadPilot.PackBased
- NomadPilot.PackageItem
- NomadPilot.PackageItemQuick
- NomadPilot.PackageItems
- NomadPilot.PackageItemsQuick
- NomadPilot.PackagePut
- NomadPilot.PackagePutRequired
- NomadPilot.PackageQuick
- NomadPilot.PackageRequired
- NomadPilot.PackageUpdate
- NomadPilot.PackageUpdateRequired
Documentation for Authorization
ca_key
- Type: API key
- API key parameter name: x-ca-key
- Location: HTTP header
ca_stage
- Type: API key
- API key parameter name: x-ca-stage
- Location: HTTP header