Skip to content

Latest commit

 

History

History
1269 lines (823 loc) · 37 KB

MessageSendingApi.md

File metadata and controls

1269 lines (823 loc) · 37 KB

WhatsAPI\MessageSendingApi

All URIs are relative to /api

Method HTTP request Description
SendAudio Post /instances/{instance_key}/send/audio Send raw audio.
SendButtonMessage Post /instances/{instance_key}/send/buttons Send a button message.
SendButtonWithMedia Post /instances/{instance_key}/send/button-media Send a button message with a media header.
SendContact Post /instances/{instance_key}/send/contact Send a contact message.
SendDocument Post /instances/{instance_key}/send/document Send raw document.
SendGroupInvite Post /instances/{instance_key}/send/group-invite Send a group invite message
SendImage Post /instances/{instance_key}/send/image Send raw image.
SendListMessage Post /instances/{instance_key}/send/list Send a List message.
SendLocation Post /instances/{instance_key}/send/location Send a location message.
SendMediaMessage Post /instances/{instance_key}/send/media Send a media message.
SendPollMessage Post /instances/{instance_key}/send/poll Send a Poll message.
SendTemplate Post /instances/{instance_key}/send/template Send a template message.
SendTemplateWithMedia Post /instances/{instance_key}/send/template-media Send a template message with media.
SendTextMessage Post /instances/{instance_key}/send/text Send a text message.
SendVideo Post /instances/{instance_key}/send/video Send raw video.
UploadMedia Post /instances/{instance_key}/send/upload Upload media.
UploadMediaFromUrl Post /instances/{instance_key}/send/upload-url Upload media from url.

SendAudio

APIResponse SendAudio(ctx, instanceKey).To(to).SendAudioRequest(sendAudioRequest).Caption(caption).Execute()

Send raw audio.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    to := "to_example" // string | The recipient's number
    sendAudioRequest := *openapiclient.NewSendAudioRequest("TODO") // SendAudioRequest | 
    caption := "caption_example" // string | Attached caption (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendAudio(context.Background(), instanceKey).To(to).SendAudioRequest(sendAudioRequest).Caption(caption).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendAudio``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendAudio`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendAudio`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendAudioRequest struct via the builder pattern

Name Type Description Notes

to | string | The recipient's number | sendAudioRequest | SendAudioRequest | | caption | string | Attached caption |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendButtonMessage

APIResponse SendButtonMessage(ctx, instanceKey).Data(data).Execute()

Send a button message.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewButtonMessagePayload() // ButtonMessagePayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendButtonMessage(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendButtonMessage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendButtonMessage`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendButtonMessage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendButtonMessageRequest struct via the builder pattern

Name Type Description Notes

data | ButtonMessagePayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendButtonWithMedia

APIResponse SendButtonWithMedia(ctx, instanceKey).Data(data).Execute()

Send a button message with a media header.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewButtonMessageWithMediaPayload() // ButtonMessageWithMediaPayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendButtonWithMedia(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendButtonWithMedia``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendButtonWithMedia`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendButtonWithMedia`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendButtonWithMediaRequest struct via the builder pattern

Name Type Description Notes

data | ButtonMessageWithMediaPayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendContact

APIResponse SendContact(ctx, instanceKey).Data(data).Execute()

Send a contact message.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewContactMessagePayload("To_example", *openapiclient.NewContactMessagePayloadVcard()) // ContactMessagePayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendContact(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendContact``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendContact`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendContact`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendContactRequest struct via the builder pattern

Name Type Description Notes

data | ContactMessagePayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendDocument

APIResponse SendDocument(ctx, instanceKey).To(to).SendDocumentRequest(sendDocumentRequest).Caption(caption).Execute()

Send raw document.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    to := "to_example" // string | The recipient's number
    sendDocumentRequest := *openapiclient.NewSendDocumentRequest("TODO") // SendDocumentRequest | 
    caption := "caption_example" // string | Attached caption (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendDocument(context.Background(), instanceKey).To(to).SendDocumentRequest(sendDocumentRequest).Caption(caption).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendDocument``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendDocument`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendDocument`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendDocumentRequest struct via the builder pattern

Name Type Description Notes

to | string | The recipient's number | sendDocumentRequest | SendDocumentRequest | | caption | string | Attached caption |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendGroupInvite

APIResponse SendGroupInvite(ctx, instanceKey).Data(data).Execute()

Send a group invite message

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewGroupInviteMessagePayload() // GroupInviteMessagePayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendGroupInvite(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendGroupInvite``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendGroupInvite`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendGroupInvite`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendGroupInviteRequest struct via the builder pattern

Name Type Description Notes

data | GroupInviteMessagePayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendImage

APIResponse SendImage(ctx, instanceKey).To(to).UpdateProfilePicRequest(updateProfilePicRequest).Caption(caption).Execute()

Send raw image.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    to := "to_example" // string | The recipient's number
    updateProfilePicRequest := *openapiclient.NewUpdateProfilePicRequest("TODO") // UpdateProfilePicRequest | 
    caption := "caption_example" // string | Attached caption (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendImage(context.Background(), instanceKey).To(to).UpdateProfilePicRequest(updateProfilePicRequest).Caption(caption).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendImage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendImage`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendImage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendImageRequest struct via the builder pattern

Name Type Description Notes

to | string | The recipient's number | updateProfilePicRequest | UpdateProfilePicRequest | | caption | string | Attached caption |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendListMessage

APIResponse SendListMessage(ctx, instanceKey).Data(data).Execute()

Send a List message.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewListMessagePayload([]openapiclient.ListSection{*openapiclient.NewListSection([]openapiclient.ListItem{*openapiclient.NewListItem("Title_example")}, "Title_example")}, "To_example") // ListMessagePayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendListMessage(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendListMessage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendListMessage`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendListMessage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendListMessageRequest struct via the builder pattern

Name Type Description Notes

data | ListMessagePayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendLocation

APIResponse SendLocation(ctx, instanceKey).Data(data).Execute()

Send a location message.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewLocationMessagePayload(*openapiclient.NewLocationMessagePayloadLocation(float32(123), float32(123), "Name_example"), "To_example") // LocationMessagePayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendLocation(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendLocation``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendLocation`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendLocation`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendLocationRequest struct via the builder pattern

Name Type Description Notes

data | LocationMessagePayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendMediaMessage

APIResponse SendMediaMessage(ctx, instanceKey).Data(data).Execute()

Send a media message.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewSendMediaPayload(*openapiclient.NewFileUpload("DirectPath_example", []int32{int32(123)}, int32(123), []int32{int32(123)}, []int32{int32(123)}, "MimeType_example", "Url_example"), "MediaType_example", "To_example") // SendMediaPayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendMediaMessage(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendMediaMessage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendMediaMessage`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendMediaMessage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendMediaMessageRequest struct via the builder pattern

Name Type Description Notes

data | SendMediaPayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendPollMessage

APIResponse SendPollMessage(ctx, instanceKey).Data(data).Execute()

Send a Poll message.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewPollMessagePayload([]string{"Options_example"}, int32(123), "Title_example", "To_example") // PollMessagePayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendPollMessage(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendPollMessage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendPollMessage`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendPollMessage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendPollMessageRequest struct via the builder pattern

Name Type Description Notes

data | PollMessagePayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendTemplate

APIResponse SendTemplate(ctx, instanceKey).Data(data).Execute()

Send a template message.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewTemplateButtonPayload([]openapiclient.TemplateButton{*openapiclient.NewTemplateButton("Title_example", "Type_example")}, "To_example") // TemplateButtonPayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendTemplate(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendTemplate``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendTemplate`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendTemplate`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendTemplateRequest struct via the builder pattern

Name Type Description Notes

data | TemplateButtonPayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendTemplateWithMedia

APIResponse SendTemplateWithMedia(ctx, instanceKey).Data(data).Execute()

Send a template message with media.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewTemplateButtonWithMediaPayload([]openapiclient.TemplateButton{*openapiclient.NewTemplateButton("Title_example", "Type_example")}, *openapiclient.NewFileUpload("DirectPath_example", []int32{int32(123)}, int32(123), []int32{int32(123)}, []int32{int32(123)}, "MimeType_example", "Url_example"), "To_example") // TemplateButtonWithMediaPayload | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendTemplateWithMedia(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendTemplateWithMedia``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendTemplateWithMedia`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendTemplateWithMedia`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendTemplateWithMediaRequest struct via the builder pattern

Name Type Description Notes

data | TemplateButtonWithMediaPayload | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendTextMessage

APIResponse SendTextMessage(ctx, instanceKey).Data(data).Execute()

Send a text message.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    data := *openapiclient.NewTextMessage("Text_example", "To_example") // TextMessage | Message data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendTextMessage(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendTextMessage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendTextMessage`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendTextMessage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendTextMessageRequest struct via the builder pattern

Name Type Description Notes

data | TextMessage | Message data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendVideo

APIResponse SendVideo(ctx, instanceKey).To(to).SendVideoRequest(sendVideoRequest).Caption(caption).Execute()

Send raw video.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    to := "to_example" // string | The recipient's number
    sendVideoRequest := *openapiclient.NewSendVideoRequest("TODO") // SendVideoRequest | 
    caption := "caption_example" // string | Attached caption (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.SendVideo(context.Background(), instanceKey).To(to).SendVideoRequest(sendVideoRequest).Caption(caption).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.SendVideo``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendVideo`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.SendVideo`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiSendVideoRequest struct via the builder pattern

Name Type Description Notes

to | string | The recipient's number | sendVideoRequest | SendVideoRequest | | caption | string | Attached caption |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UploadMedia

APIResponse UploadMedia(ctx, instanceKey).Type_(type_).UploadMediaRequest(uploadMediaRequest).Execute()

Upload media.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    type_ := "type__example" // string | Media type
    uploadMediaRequest := *openapiclient.NewUploadMediaRequest("TODO") // UploadMediaRequest | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.UploadMedia(context.Background(), instanceKey).Type_(type_).UploadMediaRequest(uploadMediaRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.UploadMedia``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UploadMedia`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.UploadMedia`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiUploadMediaRequest struct via the builder pattern

Name Type Description Notes

type_ | string | Media type | uploadMediaRequest | UploadMediaRequest | |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UploadMediaFromUrl

APIResponse UploadMediaFromUrl(ctx, instanceKey).Type_(type_).Data(data).Execute()

Upload media from url.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    instanceKey := "instanceKey_example" // string | Instance key
    type_ := "type__example" // string | Media type
    data := *openapiclient.NewUrlMediaUploadPayload() // UrlMediaUploadPayload | Media data

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessageSendingApi.UploadMediaFromUrl(context.Background(), instanceKey).Type_(type_).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessageSendingApi.UploadMediaFromUrl``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UploadMediaFromUrl`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `MessageSendingApi.UploadMediaFromUrl`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instanceKey string Instance key

Other Parameters

Other parameters are passed through a pointer to a apiUploadMediaFromUrlRequest struct via the builder pattern

Name Type Description Notes

type_ | string | Media type | data | UrlMediaUploadPayload | Media data |

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]