Skip to content

aldinokemal/sdk-go-whatsapp-web-multidevice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for SdkWhatsappWebMultiDevice

This API is used for sending whatsapp via API

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 6.9.0
  • Package version: 1.0.0
  • Generator version: 7.14.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import SdkWhatsappWebMultiDevice "github.com/aldinokemal/sdk-go-whatsapp-web-multidevice"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value SdkWhatsappWebMultiDevice.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), SdkWhatsappWebMultiDevice.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value SdkWhatsappWebMultiDevice.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), SdkWhatsappWebMultiDevice.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using SdkWhatsappWebMultiDevice.ContextOperationServerIndices and SdkWhatsappWebMultiDevice.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), SdkWhatsappWebMultiDevice.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), SdkWhatsappWebMultiDevice.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost:3000

Class Method HTTP request Description
AppAPI AppDevices Get /app/devices Get list connected devices
AppAPI AppLogin Get /app/login Login to whatsapp server
AppAPI AppLoginWithCode Get /app/login-with-code Login with pairing code
AppAPI AppLogout Get /app/logout Remove database and logout
AppAPI AppReconnect Get /app/reconnect Reconnecting to whatsapp server
ChatAPI GetChatMessages Get /chat/{chat_jid}/messages Get messages from a specific chat
ChatAPI LabelChat Post /chat/{chat_jid}/label Label or unlabel a chat
ChatAPI ListChats Get /chats Get list of chats
ChatAPI PinChat Post /chat/{chat_jid}/pin Pin or unpin a chat
GroupAPI AddParticipantToGroup Post /group/participants Adding more participants to group
GroupAPI ApproveGroupParticipantRequest Post /group/participant-requests/approve Approve participant request to join group
GroupAPI CreateGroup Post /group Create group and add participant
GroupAPI DemoteParticipantToMember Post /group/participants/demote Demote participants to member
GroupAPI GetGroupInfoFromLink Get /group/info-from-link Get group information from invitation link
GroupAPI GetGroupParticipantRequests Get /group/participant-requests Get list of participant requests to join group
GroupAPI GroupInfo Get /group/info Group Info
GroupAPI JoinGroupWithLink Post /group/join-with-link Join group with link
GroupAPI LeaveGroup Post /group/leave Leave group
GroupAPI PromoteParticipantToAdmin Post /group/participants/promote Promote participants to admin
GroupAPI RejectGroupParticipantRequest Post /group/participant-requests/reject Reject participant request to join group
GroupAPI RemoveParticipantFromGroup Post /group/participants/remove Remove participants from group
GroupAPI SetGroupAnnounce Post /group/announce Set group announce mode
GroupAPI SetGroupLocked Post /group/locked Set group locked status
GroupAPI SetGroupName Post /group/name Set group name
GroupAPI SetGroupPhoto Post /group/photo Set group photo
GroupAPI SetGroupTopic Post /group/topic Set group topic
MessageAPI DeleteMessage Post /message/{message_id}/delete Delete Message
MessageAPI ReactMessage Post /message/{message_id}/reaction Send reaction to message
MessageAPI ReadMessage Post /message/{message_id}/read Mark as read message
MessageAPI RevokeMessage Post /message/{message_id}/revoke Revoke Message
MessageAPI StarMessage Post /message/{message_id}/star Star message
MessageAPI UnstarMessage Post /message/{message_id}/unstar Unstar message
MessageAPI UpdateMessage Post /message/{message_id}/update Edit message by message ID before 15 minutes
NewsletterAPI UnfollowNewsletter Post /newsletter/unfollow Unfollow newsletter
SendAPI SendAudio Post /send/audio Send Audio
SendAPI SendChatPresence Post /send/chat-presence Send chat presence (typing indicator)
SendAPI SendContact Post /send/contact Send Contact
SendAPI SendFile Post /send/file Send File
SendAPI SendImage Post /send/image Send Image
SendAPI SendLink Post /send/link Send Link
SendAPI SendLocation Post /send/location Send Location
SendAPI SendMessage Post /send/message Send Message
SendAPI SendPoll Post /send/poll Send Poll / Vote
SendAPI SendPresence Post /send/presence Send presence status
SendAPI SendVideo Post /send/video Send Video
UserAPI UserAvatar Get /user/avatar User Avatar
UserAPI UserBusinessProfile Get /user/business-profile Get Business Profile Information
UserAPI UserChangeAvatar Post /user/avatar User Change Avatar
UserAPI UserChangePushName Post /user/pushname User Change Push Name
UserAPI UserCheck Get /user/check Check if user is on WhatsApp
UserAPI UserInfo Get /user/info User Info
UserAPI UserMyContacts Get /user/my/contacts Get list of user contacts
UserAPI UserMyGroups Get /user/my/groups User My List Groups
UserAPI UserMyNewsletter Get /user/my/newsletters User My List Groups
UserAPI UserMyPrivacy Get /user/my/privacy User My Privacy Setting

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), SdkWhatsappWebMultiDevice.ContextBasicAuth, SdkWhatsappWebMultiDevice.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages