# Packages
# README
Go API client for sdk_go_whatsapp_web_multidevice
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: 4.2.0
- Package version: 1.0.0
- Generator version: 7.9.0-SNAPSHOT
- 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 sdk_go_whatsapp_web_multidevice "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 sdk_go_whatsapp_web_multidevice.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), sdk_go_whatsapp_web_multidevice.ContextServerIndex, 1)
Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value sdk_go_whatsapp_web_multidevice.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), sdk_go_whatsapp_web_multidevice.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 sdk_go_whatsapp_web_multidevice.ContextOperationServerIndices
and sdk_go_whatsapp_web_multidevice.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), sdk_go_whatsapp_web_multidevice.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sdk_go_whatsapp_web_multidevice.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 |
GroupAPI | AddParticipantToGroup | Post /group/participants | Adding more participants to group |
GroupAPI | CreateGroup | Post /group | Create group and add participant |
GroupAPI | DemoteParticipantToMember | Post /group/participants/demote | Demote participants to member |
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 | RemoveParticipantFromGroup | Post /group/participants/remove | Remove participants from group |
MessageAPI | DeleteMessage | Post /message/{message_id}/delete | Delete Message |
MessageAPI | ReactMessage | Post /message/{message_id}/reaction | Send reaction to message |
MessageAPI | RevokeMessage | Post /message/{message_id}/revoke | Revoke Message |
MessageAPI | UpdateMessage | Post /message/{message_id}/update | Edit message by message ID before 15 minutes |
SendAPI | SendAudio | Post /send/audio | Send Audio |
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 | SendVideo | Post /send/video | Send Video |
UserAPI | UserAvatar | Get /user/avatar | User Avatar |
UserAPI | UserInfo | Get /user/info | User Info |
UserAPI | UserMyGroups | Get /user/my/groups | User My List Groups |
UserAPI | UserMyPrivacy | Get /user/my/privacy | User My Privacy Setting |
Documentation For Models
- CreateGroupRequest
- CreateGroupResponse
- CreateGroupResponseResults
- DeviceResponse
- DeviceResponseResultsInner
- ErrorBadRequest
- ErrorInternalServer
- GenericResponse
- JoinGroupWithLinkRequest
- LeaveGroupRequest
- LoginResponse
- LoginResponseResults
- LoginWithCodeResponse
- LoginWithCodeResponseResults
- ManageParticipantRequest
- ManageParticipantResponse
- ManageParticipantResponseResultsInner
- ReactMessageRequest
- RevokeMessageRequest
- SendContactRequest
- SendLinkRequest
- SendLocationRequest
- SendMessageRequest
- SendPollRequest
- SendResponse
- SendResponseResults
- UpdateMessageRequest
- UserAvatarResponse
- UserAvatarResponseResults
- UserGroupResponse
- UserGroupResponseResults
- UserGroupResponseResultsDataInner
- UserGroupResponseResultsDataInnerParticipantsInner
- UserInfoResponse
- UserInfoResponseResults
- UserInfoResponseResultsDevicesInner
- UserPrivacyResponse
- UserPrivacyResponseResults
Documentation For Authorization
Endpoints do not require authorization.
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