Skip to content

CallsGetStateInstance#

ืžื’ื‘ืœื•ืช ื–ืžื ื™ื•ืช

ื ื™ืชืŸ ืœื—ื‘ืจ ืืช ื”ืชื•ื›ื ื™ืช Ultra, ืœืฉื™ื—ื•ืช ืœืœื ื”ื’ื‘ืœื”, ืจืง ืขื‘ื•ืจ instances ื—ื“ืฉื™ื. ืœืฉืืœื•ืช ื‘ื ื•ื’ืข ืœื—ื™ื‘ื•ืจ ืœืชื•ื›ื ื™ืช ื•ืœืชื ืื™ื ื ื•ืกืคื™ื, ืื ื ืคื ื• ืœืชืžื™ื›ื” ื”ื˜ื›ื ื™ืช ืฉืœ GREEN-API ืื• ืœืฆืณืื˜ ื‘ืืชืจ.
ื›ืจื’ืข ื–ืžื™ื ื•ืช ืจืง ืฉื™ื—ื•ืช ืื™ืฉื™ื•ืช.

ื”ืฉื™ื˜ื” ืžื™ื•ืขื“ืช ืœืงื‘ืœืช ื”ื™ืกื˜ื•ืจื™ื™ืช ื”ืžืฆื‘ื™ื ืฉืœ ืžื•ืคืข ื‘ืชืขืจื™ืฃ "ืฉื™ื—ื•ืช".

ื‘ืงืฉื”#

ื›ื“ื™ ืœืงื‘ืœ ืืช ืžืฆื‘ ืกืฉืŸ ื”ืฉื™ื—ื•ืช, ื™ืฉ ืœื‘ืฆืข ื‘ืงืฉื” ืœื›ืชื•ื‘ืช:

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

ืœืงื‘ืœืช ืคืจืžื˜ืจื™ ื”ื‘ืงืฉื” apiUrl, idInstance ื•-apiTokenInstance, ืขื™ื™ื ื• ื‘ืกืขื™ืฃ ืœืคื ื™ ืฉืžืชื—ื™ืœื™ื.

ืคืจืžื˜ืจื™ ื”ื‘ืงืฉื”#

ื ื™ืชืŸ ืœืฆื™ื™ืŸ ืืช ื”ืคืจืžื˜ืจื™ื ื‘ืื•ืคืŸ ืกืœืงื˜ื™ื‘ื™.

ืคืจืžื˜ืจ ืกื•ื’ ื—ื•ื‘ื” ืชื™ืื•ืจ
count integer ืœื ืžืกืคืจ ืจืฉื•ืžื•ืช ื”ื”ืจืฉืื” ื‘ืžื•ืคืข ื‘ืกื“ืจ ื›ืจื•ื ื•ืœื•ื’ื™. ื‘ืจื™ืจืช ืžื—ื“ืœ: count = 100

ื“ื•ื’ืžื” ืœื’ื•ืฃ ื”ื‘ืงืฉื”#

{
    "count": 200
}

ืชื’ื•ื‘ื”#

ืฉื“ื•ืช ื”ืชื’ื•ื‘ื”#

ืฉื“ื” ืกื•ื’ ืชื™ืื•ืจ
stateInstance string ืžืฆื‘ ื”ืžื•ืคืข ื‘ืชืขืจื™ืฃ "ืฉื™ื—ื•ืช". ืžืงื‘ืœ ืืช ื”ืขืจื›ื™ื:
notAuthorized - ื”ืžื•ืคืข ืื™ื ื• ืžื•ืจืฉื”
authorized - ื”ืžื•ืคืข ืžื•ืจืฉื”
blocked - ื”ืžื•ืคืข ื ื—ืกื
timestamp integer ื–ืžืŸ ื”ืื™ืจื•ืข ื‘ืคื•ืจืžื˜ UNIX
phoneNumber integer ืžืกืคืจ ื˜ืœืคื•ืŸ

ื“ื•ื’ืžื” ืœื’ื•ืฃ ื”ืชื’ื•ื‘ื”#

{
    "callsStateInstance": "authorized"
}

ืฉื’ื™ืื•ืช#

ืœืจืฉื™ืžืช ื”ืฉื’ื™ืื•ืช ื”ืžืฉื•ืชืคื•ืช ืœื›ืœ ื”ืฉื™ื˜ื•ืช, ืขื™ื™ื ื• ื‘ืกืขื™ืฃ ืฉื’ื™ืื•ืช ื ืคื•ืฆื•ืช

ืงื•ื“ HTTP ืชื™ืื•ืจ
404 ื”ืžื•ืคืข ืœื ื ืžืฆื

ื“ื•ื’ืžืื•ืช ืงื•ื“#

import requests

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

payload = {}
headers = {}

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

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/callsGetStateInstance/{{apiTokenInstance}}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/callsGetStateInstance/")
    .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("/callsGetStateInstance/")
    .append({{apiTokenInstance}});

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

System.out.println(response);