2.39.5 • Published 7 months ago

one_msg_waba_sdk v2.39.5

Weekly downloads
-
License
Unlicense
Repository
-
Last release
7 months ago

one_msg_waba_sdk

OneMsgWabaSdk - JavaScript client for one_msg_waba_sdk 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:

  • API version: 2.39.5
  • Package version: 2.39.5
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

npm

install it via:

npm install one_msg_waba_sdk --save
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 one_msg_waba_sdk from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

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
      }
    }
  ]
}

Vite Configuration

Using Vite you may encounter errors. You might need to add a babel plugin to your vite.config.js

import babel from 'vite-plugin-babel';

export default defineConfig({
  plugins: [babel()],
})

Getting Started

Please follow the installation instruction and execute the following JS code:

import * as OneMsgWabaSdk from 'one_msg_waba_sdk'
let defaultClient = OneMsgWabaSdk.ApiClient.instance;
// Configure path to your instance
defaultClient.basePath = "https://api.1msg.io/YOUR_INSTANCE_NUMBER/";

// Configure API key authorization: token
let token = defaultClient.authentications['token'];
token.apiKey = "YOUR_TOKEN_KEY_FOR_INSTANCE"

let api = new OneMsgWabaSdk.ChannelApi()
api.getMe().then(data=>{
  console.log(data)
},err=>{
  console.error(err)})

Documentation for API Endpoints

All URIs are relative to https://api.1msg.io/YOUR_INSTANCE_NUMBER

ClassMethodHTTP requestDescription
OneMsgWabaSdk.ChannelApigetCommerceGET /commerceGet Commerce Settings
OneMsgWabaSdk.ChannelApigetExtendedStatisticsGET /extendedStatisticsGet Extended Channel statistics
OneMsgWabaSdk.ChannelApigetMeGET /meGet Profile Info
OneMsgWabaSdk.ChannelApigetSettingsGET /settingsGet Settings
OneMsgWabaSdk.ChannelApigetStatisticsGET /statisticsGet Channel statistics
OneMsgWabaSdk.ChannelApigetStatusGET /statusGet Status
OneMsgWabaSdk.ChannelApioutputIPGET /outputIPGet channel server IP
OneMsgWabaSdk.ChannelApisetMePOST /meChange user info
OneMsgWabaSdk.ChannelApisetSettingsPOST /settingsSet settings
OneMsgWabaSdk.MediaApiuploadMediaPOST /uploadMediaUpload media & get mediaId
OneMsgWabaSdk.MessagingApimessagesListGET /messagesGet messages list
OneMsgWabaSdk.MessagingApireadMessagePOST /readMessageMark message as read
OneMsgWabaSdk.MessagingApisendContactPOST /sendContactSend a Contact
OneMsgWabaSdk.MessagingApisendFilePOST /sendFileSend a File
OneMsgWabaSdk.MessagingApisendListPOST /sendListSend List Message
OneMsgWabaSdk.MessagingApisendLocationPOST /sendLocationSend a Location
OneMsgWabaSdk.MessagingApisendMessagePOST /sendMessageSend a Message
OneMsgWabaSdk.ProductsCatalogsApisendProductPOST /sendProductSend a Product
OneMsgWabaSdk.ProductsCatalogsApisetCommercePOST /commerceSet Commerce Settings
OneMsgWabaSdk.TemplatesApiaddTemplatePOST /addTemplateCreate template
OneMsgWabaSdk.TemplatesApiremoveTemplatePOST /removeTemplateRemove template
OneMsgWabaSdk.TemplatesApisendTemplatePOST /sendTemplateSend Template Message
OneMsgWabaSdk.TemplatesApitemplatesListGET /templatesGet templates list
OneMsgWabaSdk.WebhooksApiackHookInfoGET /hookInfoCheck ACKs
OneMsgWabaSdk.WebhooksApisetWebhookPOST /webhookSet webhook

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

token

  • Type: API key
  • API key parameter name: token
  • Location: URL query string
2.39.5

7 months ago

2.39.4

7 months ago

2.39.3

7 months ago

2.39.2

7 months ago

2.39.1

7 months ago

2.39.0

7 months ago