one_msg_waba_sdk_ts@2.39.2
OneMsgWabaSdk - TypeScript client for one_msg_waba_sdk_ts
1MSG.IO is the perfect WhatsApp management tool for your business. With us you get full access to the official Whatsapp API/webhooks.
Every API request must contain an Authorize HTTP header with a token.
This is your channel token, which can be found in your channel project on your profile page.
Please do not give the token to anyone or post it publicly.
The authorization token must be added to each request in the GET parameter 'token' and always passed to query string (?token={your_token}).
Parameters in GET queries pass query string. Parameters in POST requests — through the JSON-encoded request body.
All 'send' methods (except /sendTemplate) will only work when the dialog session with the user is open. Some of our solutions simplify and avoid such limitations, but we urge you to pay more attention to this detail
This SDK is automatically generated by the OpenAPI Generator project:
Environment
Language level
- ES5 - you must have a Promises/A+ library installed
- ES6
Module system
- CommonJS
- ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via package.json
. (Reference)
Building
To build and compile the typescript sources to javascript use:
npm install
npm run build
Installation
npm
install it via:
npm install one_msg_waba_sdk_ts --save
Getting Started
Please follow the installation instruction and execute the following code:
import * as OneMsgWabaSdk from 'one_msg_waba_sdk_ts'
OneMsgWabaSdk.DefaultConfig.config = {
basePath: 'https://api.1msg.io/YOUR_INSTANCE_NUMBER/',
apiKey: 'YOUR_TOKEN_KEY_FOR_INSTANCE'
}
let channelApi = new OneMsgWabaSdk.ChannelApi()
channelApi.getMe().then(function (data) {
console.log('API called successfully. Returned data: ', data);
}, function (error) {
console.error(error);
});
Documentation
For better understanding of parameters you can refer to our Documentation