Skip to main content

Community Metadata

Método#

/communities-metadata/{communityId}#

GET https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/communities-metadata/{communityId}

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

This method returns the metadata of the community, such as its name, description, and the groups linked to it.


Attributes#

Mandatory#

AttributeTypeDescription

Optional#

AttributeTypeDescription

Request Params#

URL#

GET https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/communities-metadata/{communityId}


Response#

200#

AttributesTypeDescription
namestringName of the community
idstringID of the community
descriptionstringCommunity description
subGroupsarray subgroupList of linked groups

Array (subGroups)

AttributesTypeDescription
namestringSubgroup name
phonestringSubgroup phone number
isGroupAnnouncementbooleanIndicates whether it is an announcement group or regular group

Example

{
"name": "My First Community",
"id": "98372465382764532938",
"description": "A community description",
"subGroups": [
{
"name": "My First Community",
"phone": "342532456234453-group",
"isGroupAnnouncement": true
},
{
"name": "Another group",
"phone": "1203634230225498-group",
"isGroupAnnouncement": false
}
]
}

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#