Skip to main content

List communities

Method#

/create-group#

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/communities

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

This method is responsible for returning all the communities you are a part of.


Attributes#

Required#

AttributeTypeDescription

Optional#

AttributeTypeDescription
pageintegerUsed for pagination; you can specify the page of communities you want to retrieve
pageSizeintegerSpecifies the size of the community return per page

Request Params#

Example URL#

Method

GET https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/communities


Response#

200#

AttributeTypeDescription
namestringName of the community
idstringCommunity identifier

Example

[
{
"name": "my first community",
"id": "98372465382764532938"
}
]

405#

In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or GET as specified at the beginning of this topic.

415#

In case you receive 415 error, make sure to add the “Content-Type” of the object you are sending in the request headers, mostly “application/json”


Code#