1.0.118 • Published 3 years ago

th3-chat-sdk v1.0.118

Weekly downloads
-
License
Unlicense
Repository
-
Last release
3 years ago

chat_api_sdk

ChatApiSdk - JavaScript client for chat_api_sdk The SDK allows you to receive and send messages through your WhatsApp account. Sign up now The Chat API is based on the WhatsApp WEB protocol and excludes the ban both when using libraries from mgp25 and the like. Despite this, your account can be banned by anti-spam system WhatsApp after several clicking the \"block\" button. This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • 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 th3-chat-sdk--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 th3-chat-sdkfrom, 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/YOUR_USERNAME/chat_api_sdk then install it via:

    npm install YOUR_USERNAME/th3-chat-sdk--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 ChatApiSdk = require('chat_api_sdk');

var defaultClient = ChatApiSdk.ApiClient.instance;
// Configure API key authorization: instanceId
var instanceId = defaultClient.authentications['instanceId'];
instanceId.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//instanceId.apiKeyPrefix['instanceId'] = "Token"
// Configure API key authorization: token
var token = defaultClient.authentications['token'];
token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//token.apiKeyPrefix['token'] = "Token"

var api = new ChatApiSdk.Class1InstanceApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.expiry(callback);

Documentation for API Endpoints

All URIs are relative to https://api.chat-api.com

ClassMethodHTTP requestDescription
ChatApiSdk.Class1InstanceApiexpiryPOST /expiryUpdates the QR code after its expired
ChatApiSdk.Class1InstanceApigetQRCodeGET /qr_codeDirect link to QR-code in the form of an image, not base64.
ChatApiSdk.Class1InstanceApigetSettingsGET /settingsGet settings
ChatApiSdk.Class1InstanceApigetStatusGET /statusGet the account status and QR code for authorization.
ChatApiSdk.Class1InstanceApilogoutPOST /logoutLogout from WhatsApp Web to get new QR code.
ChatApiSdk.Class1InstanceApirebootPOST /rebootReboot your whatsapp instance.
ChatApiSdk.Class1InstanceApiretryPOST /retryRepeat the manual synchronization attempt with the device
ChatApiSdk.Class1InstanceApisetSettingsPOST /settingsSet settings
ChatApiSdk.Class1InstanceApitakeoverPOST /takeoverReturns the active session if the device has connected another instance of Web WhatsApp
ChatApiSdk.Class2MessagesApiforwardMessagePOST /forwardMessageForwarding messages to a new or existing chat.
ChatApiSdk.Class2MessagesApigetMessagesGET /messagesGet a list of messages.
ChatApiSdk.Class2MessagesApisendContactPOST /sendContactSending a contact or contact list to a new or existing chat.
ChatApiSdk.Class2MessagesApisendFilePOST /sendFileSend a file to a new or existing chat.
ChatApiSdk.Class2MessagesApisendLinkPOST /sendLinkSend text with link and link's preview to a new or existing chat.
ChatApiSdk.Class2MessagesApisendLocationPOST /sendLocationSending a location to a new or existing chat.
ChatApiSdk.Class2MessagesApisendMessagePOST /sendMessageSend a message to a new or existing chat.
ChatApiSdk.Class2MessagesApisendPTTPOST /sendPTTSend a ptt-audio to a new or existing chat.
ChatApiSdk.Class2MessagesApisendVCardPOST /sendVCardSending a vcard to a new or existing chat.
ChatApiSdk.Class3ChatsApiaddGroupParticipantPOST /addGroupParticipantAdding participant to a group
ChatApiSdk.Class3ChatsApidemoteGroupParticipantPOST /demoteGroupParticipantDemote group participant
ChatApiSdk.Class3ChatsApigetChatsGET /dialogsGet the chat list.
ChatApiSdk.Class3ChatsApigroupPOST /groupCreates a group and sends the message to the created group.
ChatApiSdk.Class3ChatsApipromoteGroupParticipantPOST /promoteGroupParticipantMake participant in the group an administrator
ChatApiSdk.Class3ChatsApireadChatPOST /readChatOpen chat for reading messages
ChatApiSdk.Class3ChatsApiremoveGroupParticipantPOST /removeGroupParticipantRemove participant from a group
ChatApiSdk.Class4WebhooksApisetWebhookPOST /webhookSets the URL for receiving webhook
ChatApiSdk.Class5QueuesApiclearActionsQueuePOST /clearActionsQueueClear outbound actions queue.
ChatApiSdk.Class5QueuesApiclearMessagesQueuePOST /clearMessagesQueueClear outbound messages queue.
ChatApiSdk.Class5QueuesApishowActionsQueueGET /showActionsQueueGet outbound messages queue.
ChatApiSdk.Class5QueuesApishowMessagesQueueGET /showMessagesQueueGet outbound messages queue.
ChatApiSdk.Class6BanApibanTestPOST /banTestTest ban settings
ChatApiSdk.Class6BanApigetBanSettingsGET /banSettingsGet settings
ChatApiSdk.Class6BanApisetBanSettingsPOST /banSettingsSet settings
ChatApiSdk.Class7TestingApiinstanceStatusesGET /instanceStatusesReturns instance status changes history.
ChatApiSdk.Class7TestingApiwebhookStatusesGET /webhookStatusReturns webhook status for message.

Documentation for Models

Documentation for Authorization

instanceId

  • Type: API key
  • API key parameter name: instanceId
  • Location: URL query string

token

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

3 years ago

1.0.117

3 years ago

1.0.114

3 years ago

1.0.115

3 years ago

1.0.110

3 years ago

1.0.112

3 years ago

1.0.111

3 years ago

1.0.113

3 years ago

1.0.77

3 years ago

1.0.76

3 years ago

1.0.79

3 years ago

1.0.78

3 years ago

1.0.101

3 years ago

1.0.100

3 years ago

1.0.107

3 years ago

1.0.106

3 years ago

1.0.109

3 years ago

1.0.108

3 years ago

1.0.103

3 years ago

1.0.102

3 years ago

1.0.105

3 years ago

1.0.104

3 years ago

1.0.80

3 years ago

1.0.84

3 years ago

1.0.83

3 years ago

1.0.82

3 years ago

1.0.81

3 years ago

1.0.88

3 years ago

1.0.87

3 years ago

1.0.86

3 years ago

1.0.85

3 years ago

1.0.89

3 years ago

1.0.91

3 years ago

1.0.90

3 years ago

1.0.95

3 years ago

1.0.94

3 years ago

1.0.93

3 years ago

1.0.92

3 years ago

1.0.99

3 years ago

1.0.98

3 years ago

1.0.97

3 years ago

1.0.96

3 years ago

1.0.75

3 years ago

1.0.74

3 years ago

1.0.73

3 years ago

1.0.64

3 years ago

1.0.68

3 years ago

1.0.67

3 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.70

3 years ago

1.0.62

3 years ago

1.0.66

3 years ago

1.0.65

3 years ago

1.0.63

3 years ago

1.0.61

3 years ago

1.0.60

3 years ago

1.0.19

3 years ago

1.0.2

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.29

3 years ago

1.0.27

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.37

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.46

3 years ago

1.0.45

3 years ago

1.0.49

3 years ago

1.0.51

3 years ago

1.0.55

3 years ago

1.0.11

3 years ago

1.0.54

3 years ago

1.0.10

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.59

3 years ago

1.0.15

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.13

3 years ago

1.0.56

3 years ago

1.0.12

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago