Skip to content

Latest commit

 

History

History
414 lines (299 loc) · 9.94 KB

File metadata and controls

414 lines (299 loc) · 9.94 KB

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(instanceKey, data)

Change Webhook url.

Changes the webhook url of an instance.

Example

// Import classes:
//import WhatsAPI.infrastructure.*
//import models.*

val apiInstance = InstanceApi()
val instanceKey : kotlin.String = instanceKey_example // kotlin.String | Instance key
val `data` : WebhookPayload =  // WebhookPayload | Message data
try {
    val result : APIResponse = apiInstance.changeWebhookUrl(instanceKey, `data`)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling InstanceApi#changeWebhookUrl")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling InstanceApi#changeWebhookUrl")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
instanceKey kotlin.String Instance key
`data` WebhookPayload Message data

Return type

APIResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["Authorization"] = "" ApiClient.apiKeyPrefix["Authorization"] = ""

HTTP request headers

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

createInstance

APIResponse createInstance(data)

Creates a new instance key.

This endpoint is used to create a new WhatsApp Web instance.

Example

// Import classes:
//import WhatsAPI.infrastructure.*
//import models.*

val apiInstance = InstanceApi()
val `data` : CreateInstancePayload =  // CreateInstancePayload | Instance data
try {
    val result : APIResponse = apiInstance.createInstance(`data`)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling InstanceApi#createInstance")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling InstanceApi#createInstance")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
`data` CreateInstancePayload Instance data

Return type

APIResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["Authorization"] = "" ApiClient.apiKeyPrefix["Authorization"] = ""

HTTP request headers

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

deleteInstance

APIResponse deleteInstance(instanceKey)

Delete Instance.

Deletes the instance with the provided key.

Example

// Import classes:
//import WhatsAPI.infrastructure.*
//import models.*

val apiInstance = InstanceApi()
val instanceKey : kotlin.String = instanceKey_example // kotlin.String | Instance key
try {
    val result : APIResponse = apiInstance.deleteInstance(instanceKey)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling InstanceApi#deleteInstance")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling InstanceApi#deleteInstance")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
instanceKey kotlin.String Instance key

Return type

APIResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["Authorization"] = "" ApiClient.apiKeyPrefix["Authorization"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getContacts

APIResponse getContacts(instanceKey)

Get contacts.

Fetches the list of contacts in the instance.

Example

// Import classes:
//import WhatsAPI.infrastructure.*
//import models.*

val apiInstance = InstanceApi()
val instanceKey : kotlin.String = instanceKey_example // kotlin.String | Instance key
try {
    val result : APIResponse = apiInstance.getContacts(instanceKey)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling InstanceApi#getContacts")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling InstanceApi#getContacts")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
instanceKey kotlin.String Instance key

Return type

APIResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["Authorization"] = "" ApiClient.apiKeyPrefix["Authorization"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getInstance

APIResponse getInstance(instanceKey)

Get Instance.

Returns the instance data of single instance with connection status.

Example

// Import classes:
//import WhatsAPI.infrastructure.*
//import models.*

val apiInstance = InstanceApi()
val instanceKey : kotlin.String = instanceKey_example // kotlin.String | Instance key
try {
    val result : APIResponse = apiInstance.getInstance(instanceKey)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling InstanceApi#getInstance")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling InstanceApi#getInstance")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
instanceKey kotlin.String Instance key

Return type

APIResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["Authorization"] = "" ApiClient.apiKeyPrefix["Authorization"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getQrCode

APIResponse getQrCode(instanceKey)

Get QrCode.

Returns the qrcode in the base64 format.

Example

// Import classes:
//import WhatsAPI.infrastructure.*
//import models.*

val apiInstance = InstanceApi()
val instanceKey : kotlin.String = instanceKey_example // kotlin.String | Instance key
try {
    val result : APIResponse = apiInstance.getQrCode(instanceKey)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling InstanceApi#getQrCode")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling InstanceApi#getQrCode")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
instanceKey kotlin.String Instance key

Return type

APIResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["Authorization"] = "" ApiClient.apiKeyPrefix["Authorization"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

listInstances

APIResponse listInstances()

Get all instances.

Fetches the list of all Instances with login status.

Example

// Import classes:
//import WhatsAPI.infrastructure.*
//import models.*

val apiInstance = InstanceApi()
try {
    val result : APIResponse = apiInstance.listInstances()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling InstanceApi#listInstances")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling InstanceApi#listInstances")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

APIResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["Authorization"] = "" ApiClient.apiKeyPrefix["Authorization"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

logoutInstance

APIResponse logoutInstance(instanceKey)

Logout Instance.

Logouts of the instance with the provided key.

Example

// Import classes:
//import WhatsAPI.infrastructure.*
//import models.*

val apiInstance = InstanceApi()
val instanceKey : kotlin.String = instanceKey_example // kotlin.String | Instance key
try {
    val result : APIResponse = apiInstance.logoutInstance(instanceKey)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling InstanceApi#logoutInstance")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling InstanceApi#logoutInstance")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
instanceKey kotlin.String Instance key

Return type

APIResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["Authorization"] = "" ApiClient.apiKeyPrefix["Authorization"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined