About Communities

Hello when try to create community I got

{
    "status": "error",
    "message": "Fail to create community.",
    "code": 500000,
    "data": {
        "detail": {}
    }
}

this is the cURL

curl --location 'https://apix.eu.amity.co/api/v3/communities' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkwtTl9wMEpQWTlpQWFtczlITllBNnN6TEhSV3JzLUdFSDduQklQOVRaUjgifQ.eyJ1c2VyIjp7InVzZXJJZCI6IjY1YTNiM2MyMWE1ZWFjYjJiOWZiYjhhZCIsInB1YmxpY1VzZXJJZCI6IjEzIiwiZGV2aWNlSW5mbyI6eyJraW5kIjoiaW9zIiwibW9kZWwiOiJzdHJpbmciLCJzZGtWZXJzaW9uIjoic3RyaW5nIn0sIm5ldHdvcmtJZCI6IjY1NDc0NjUxYzUwZjdjMDYyNTdiNTA0ZiIsImRpc3BsYXlOYW1lIjoiSG9zc2FtIEFwaSBTZWV2ZXoiLCJyZWZyZXNoVG9rZW4iOiJlMGM5M2M5NzZjNjUxNjA0NzkzNTUyMWU5ZGJhYTE2YjllMjI4MWIzZjRhZjI0MDA2ZjdlZmVmNjBiZmM3NzZiNjNmMTI0MDFjMzRiYjM2ZCJ9LCJzdWIiOiI2NWEzYjNjMjFhNWVhY2IyYjlmYmI4YWQiLCJpc3MiOiJodHRwczovL2FwaS5ldS5hbWl0eS5jbyIsImlhdCI6MTcxMzE3NjAzNCwiZXhwIjoxNzE1NzY4MDM0fQ.g2r2tUQWzD_-aqm9vrisTy9lFykZgjdw7BunYsPjpA2zZF6qYM7xFDmBeZDv4-7fJySHueHuaGm7GFUfNJBE1j9NBxJvlUn5z3DxCe84tQlJk_w_AJcKX_saLLPuHeCKW20vRhPlXKqarWqtk2R5E4wg0SulevWVeZLb7uwNrhDVFpu3HWvUAPCB4vt8Y7r8pUS_ezkRyildQi03nqZYv8qU0wb6lU4Qby7huchpqfhltFPiX4SktbZ8xTTlH5CwCu8yux1lO9hNh61DRuHDZNMTpOI59f_WzhNP52e9iHswXvVp5e2CYJ7CIHw7liBZ_Lihk7yLlvMon5_zbBvo3w' \
--data '{
  "displayName": "new community",
  "isPublic": false,
  "onlyAdminCanPost": false,
  "description": "GlobalFeed",
  "tags": [
    "GlobalFeed"
  ],
  "metadata": {},
  "avatarFileId": "string",
  "userIds": [
  ],
  "categoryIds": [
    "string"
  ],
  "isUniqueDisplayName": true,
  "needApprovalOnPostCreation": false,
  "allowCommentInStory": true,
  "notificationMode": "default"
}'

Please avoid using the ‘string’ value as it requires a proper value. Kindly create these values first and assign them accordingly.

"avatarFileId": "string",
----
"categoryIds": [
    "string"
  ]

Thank you for that ,I have another question I want to get all my communities that I create them or joined them ?
and How can Know that I already admin or moderator in this community or not and How can know if I joined this community or Not ?

To verify whether you created the community, you can utilize this API: Amity API. From its response, you can determine if you’re an admin or a moderator based on the permissions.

To check if you’re a member or have joined, you can use this query to fetch communities based on available filters: Amity API. Apply ‘filter=member’ to do so.

is there any api to get all my communities ?

You can adjust the filter here:

So How can know the file for every community and the users for every community ?
I see that the API give me every users for the all communities and every files for all communities so how can specify it

Hello and we delete the community and when call the api that get the community it return the community to me so what is this ?

and I want when I create community to invite users , so the users is already added or not and how can make it and send to this user that he added? @SocialPlus_Support

Unfortunately, there isn’t a comprehensive API to fetch all files across all communities. Files within posts can only be accessed by querying posts using this API: Amity API, where you can filter for files with dataTypes = file . Therefore, you may need to query files per community and then aggregate them later.

Communities undergo soft deletion. When querying communities here, you can filter out the deleted ones using the isDeleted filter.

To verify a user’s membership status, you need to query the community’s members and cross-reference with their user ID in the list.

So How can make when I create community to add invite member when I create the community?

and I make query community by id and when i call the Api I got it ! . But I already delete it

The invitation feature is currently unavailable in our product. However, to add users to communities, you can utilize this API: Community Users API.

Regarding deleted communities, as previously mentioned, the delete action is soft-deleted, meaning all data remains accessible. You can use filters to exclude it, ensuring it doesn’t affect operations.

When creating group when make join to the group it needs to be approved by admin if the community private

@hossam For joining a community or adding a member, we recommend utilizing this API and employing an admin token for authorization in this case.

You can check the API details from this link: Add Community Members API