Skip to content

Latest commit

 

History

History
565 lines (357 loc) · 13.9 KB

InstanceApi.md

File metadata and controls

565 lines (357 loc) · 13.9 KB

WhatsAPI\InstanceApi

All URIs are relative to /api

Method HTTP request Description
ChangeWebhookUrl Put /instances/{instance_key}/webhook Change Webhook url.
CreateInstance Post /instances/create Creates a new instance key.
DeleteInstance Delete /instances/{instance_key}/delete Delete Instance.
GetContacts Get /instances/{instance_key}/contacts Get contacts.
GetInstance Get /instances/{instance_key}/ Get Instance.
GetQrCode Get /instances/{instance_key}/qrcode Get QrCode.
ListInstances Get /instances/list Get all instances.
LogoutInstance Delete /instances/{instance_key}/logout Logout Instance.

ChangeWebhookUrl

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

Change Webhook url.

Example

package main

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

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

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.InstanceApi.ChangeWebhookUrl(context.Background(), instanceKey).Data(data).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `InstanceApi.ChangeWebhookUrl``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ChangeWebhookUrl`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `InstanceApi.ChangeWebhookUrl`: %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 apiChangeWebhookUrlRequest struct via the builder pattern

Name Type Description Notes

data | WebhookPayload | 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]

CreateInstance

APIResponse CreateInstance(ctx).Data(data).Execute()

Creates a new instance key.

Example

package main

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

func main() {
    data := *openapiclient.NewCreateInstancePayload() // CreateInstancePayload | Instance data

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

Path Parameters

Other Parameters

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

Name Type Description Notes
data CreateInstancePayload Instance 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]

DeleteInstance

APIResponse DeleteInstance(ctx, instanceKey).Execute()

Delete Instance.

Example

package main

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

func main() {
    instanceKey := "instanceKey_example" // string | Instance key

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.InstanceApi.DeleteInstance(context.Background(), instanceKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `InstanceApi.DeleteInstance``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeleteInstance`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `InstanceApi.DeleteInstance`: %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 apiDeleteInstanceRequest struct via the builder pattern

Name Type Description Notes

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GetContacts

APIResponse GetContacts(ctx, instanceKey).Execute()

Get contacts.

Example

package main

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

func main() {
    instanceKey := "instanceKey_example" // string | Instance key

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.InstanceApi.GetContacts(context.Background(), instanceKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `InstanceApi.GetContacts``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetContacts`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `InstanceApi.GetContacts`: %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 apiGetContactsRequest struct via the builder pattern

Name Type Description Notes

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GetInstance

APIResponse GetInstance(ctx, instanceKey).Execute()

Get Instance.

Example

package main

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

func main() {
    instanceKey := "instanceKey_example" // string | Instance key

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.InstanceApi.GetInstance(context.Background(), instanceKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `InstanceApi.GetInstance``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetInstance`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `InstanceApi.GetInstance`: %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 apiGetInstanceRequest struct via the builder pattern

Name Type Description Notes

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GetQrCode

APIResponse GetQrCode(ctx, instanceKey).Execute()

Get QrCode.

Example

package main

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

func main() {
    instanceKey := "instanceKey_example" // string | Instance key

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.InstanceApi.GetQrCode(context.Background(), instanceKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `InstanceApi.GetQrCode``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetQrCode`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `InstanceApi.GetQrCode`: %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 apiGetQrCodeRequest struct via the builder pattern

Name Type Description Notes

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

ListInstances

APIResponse ListInstances(ctx).Execute()

Get all instances.

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

LogoutInstance

APIResponse LogoutInstance(ctx, instanceKey).Execute()

Logout Instance.

Example

package main

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

func main() {
    instanceKey := "instanceKey_example" // string | Instance key

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.InstanceApi.LogoutInstance(context.Background(), instanceKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `InstanceApi.LogoutInstance``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `LogoutInstance`: APIResponse
    fmt.Fprintf(os.Stdout, "Response from `InstanceApi.LogoutInstance`: %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 apiLogoutInstanceRequest struct via the builder pattern

Name Type Description Notes

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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