TwinJet ATC Client
JavaScript client for TwinJet ATC service (https://twinjet.co/)
For more information about the TwinJet ATC API: https://twinjet.co/developer/
Installation
npm install --save twinjet-atc-client
Usage
New client
Before making requests, you need to instantiate a new client:
const TwinJetATC = ; const options = api_token: 'Ahngohsieb5aijooghugheF6iel0AeGh';const client = options;
More options
You can use more options in client constructor:
const options = api_token: 'Ahngohsieb5aijooghugheF6iel0AeGh' // Required base_url: 'https://api.other.io/v1' // Override API base URL. Default: 'https://www.twinjet.co/api/v1' timeout: 2000 // Requests timeout, in milliseconds. 0 to disable. Default: 10000 live: false // Live or test mode. Default: true
Create a job
const requestId = await client; // requestId = 'A1B2C3D4E5'
Cancel a job
const response = await client; // response example: https://twinjet.co/developer/#statusjson
You can also use external_id
or job_id
to identify the job.
Update a job
const response = await client; // response example: https://twinjet.co/developer/#statusjson
You can also use external_id
or job_id
to identify the job.
Job status
const response = await clientstatus request_id: 'A1B2C3D4E5'; // response example: https://twinjet.co/developer/#statusjson
You can also use external_id
or job_id
to identify the job.
Address validation
const response = await client; // response example: https://twinjet.co/developer/#verifyjson
TypeScript
This package includes TypeScript definitions.
; ;