Skip to content

GetSettings#

The method is aimed for getting the current account settings.

Request#

To get the current account settings you have to execute a request at:

GET {{apiUrl}}/waInstance{{idInstance}}/getSettings/{{apiTokenInstance}}

For idInstance, apiTokenInstance and apiUrl request parameters, please refer to Before you start section.

Response#

Response parameters#

Parameter Type Description
wid string Account ID in WhatsApp
countryInstance string Deprecated
typeAccount string Deprecated
webhookUrl string URL to receive incoming notifications. When receiving notifications with HTTP API technology, the field must be empty. Description of how the field works.
webhookUrlToken string Token for connecting to your webhook server. Description of how the field works.
delaySendMessagesMilliseconds integer Deprecated
markIncomingMessagesReaded string Deprecated
markIncomingMessagesReadedOnReply string Deprecated
sharedSession string Deprecated
outgoingWebhook string Get notifications about outgoing messages sending / delivering / reading status, possible variants: yes, no
outgoingMessageWebhook string Deprecated
outgoingAPIMessageWebhook string Get notifications about messages sent from API, possible variants: yes,no. When sending a message to a non-existing WhatsApp account, the notification will not come.
incomingWebhook string Get notifications about incoming messages and files, possible variants: yes, no
deviceWebhook string Deprecated
statusInstanceWebhook string Deprecated
stateWebhook string Deprecated
enableMessagesHistory string Deprecated
keepOnlineStatus string Deprecated
pollMessageWebhook string Deprecated
incomingBlockWebhook string Deprecated
incomingCallWebhook string Deprecated

Response body example#

{
    "wid": "11001234567@c.us",
    "countryInstance": "",
    "typeAccount": "",
    "webhookUrl": "https://mysite.com/webhook/GreenWaba/",
    "webhookUrlToken": "",
    "delaySendMessagesMilliseconds": 0,
    "markIncomingMessagesReaded": "no",
    "markIncomingMessagesReadedOnReply": "no",
    "sharedSession": "no",
    "outgoingWebhook": "yes",
    "outgoingMessageWebhook": "no",
    "outgoingAPIMessageWebhook": "yes",
    "incomingWebhook": "yes",
    "deviceWebhook": "no",
    "statusInstanceWebhook": "no",
    "stateWebhook": "no",
    "enableMessagesHistory": "no",
    "keepOnlineStatus": "no",
    "pollMessageWebhook": "no",
    "incomingBlockWebhook": "no",
    "incomingCallWebhook": "no"
}

Errors GetSettings#

For a list of errors common to all methods, refer to Common errors section

Request examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/getSettings/{{apiTokenInstance}}"

payload = {}
headers= {}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
//The idInstance and apiTokenInstance values are available in your account, double brackets must be removed
$url = "{{apiUrl}}/waInstance{{idInstance}}/getSettings/{{apiTokenInstance}}";

$options = array(
    'http' => array(
        'header' => "Content-Type: application/json\r\n",
        'method' => 'GET'
    )
);

$context = stream_context_create($options);

$response = file_get_contents($url, false, $context);

echo $response;
?>
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getSettings/{{apiTokenInstance}}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/getSettings/")
    .append({{apiTokenInstance}});

var response = restTemplate.exchange(requestUrl.toString(), HttpMethod.GET, null, String.class);
System.out.println(response);
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/getSettings/")
    .append({{apiTokenInstance}});

var response = Unirest.get(requestUrl.toString())
    .header("Content-Type", "application/json")
    .asString();

System.out.println(response);
Sub GetSettings()
    Dim url As String
    Dim http As Object
    Dim response As String

    ' The idInstance and apiTokenInstance values are available in your account, double brackets must be removed
    url = "{{apiUrl}}/waInstance{{idInstance}}/getSettings/{{apiTokenInstance}}"

    Set http = CreateObject("WinHttp.WinHttpRequest.5.1")

    http.Open "GET", url, False
    http.Send

    response = http.responseText

    Debug.Print response

    ' Outputting the answer to the desired cell
    ' Range("A1").Value = response

    Set http = Nothing
End Sub
program GetSettings;

{$APPTYPE CONSOLE}

uses
System.SysUtils,
System.Classes, System.Net.HttpClient, System.Net.URLClient, System.Net.HttpClientComponent;

var
HttpClient: TNetHTTPClient;
RequestHeaders: TNetHeaders;
Response: IHTTPResponse;
EndpointURL, ID_INSTANCE, API_TOKEN_INSTANCE: string;

begin
ID_INSTANCE := '110100001';
API_TOKEN_INSTANCE := 'd75b3a66374942c5b3c019c698abc2067e151558acbd451234';

EndpointURL := `apiUrl` + '/waInstance' + ID_INSTANCE + '/getSettings/' + API_TOKEN_INSTANCE;

HttpClient := TNetHTTPClient.Create(nil);
RequestHeaders := [
    TNetHeader.Create('Content-Type', 'application/json')
];

try
    Response := HTTPClient.Get(EndpointURL, nil, RequestHeaders);

    if Response.StatusCode = 200 then
    Writeln('[Response]: ' + Response.ContentAsString)
    else
    Writeln('[ERROR ' + IntToStr(Response.StatusCode) + ']:' + Response.StatusText + '' + Response.ContentAsString);

    readln;
except
    on E: Exception do
    Writeln(E.ClassName, ': ', E.Message);
end;

HttpClient.Free;

end.