Community created

How can create community as official as I got every time to try to create community

{
  "status": "error",
  "message": "Only administrator can config about being official",
  "code": 400300,
  "data": {
    "detail": null
  }
}

Based on the error message shown, it appears you’re attempting to make it official using a normal user token. Please try using an admin token instead.

How to get admin token: Technical FAQ - Amity Docs

when do it I got

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

but I already doesn’t make the post official I send it false

@hossam Could you please provide your full curl requests?

curl --location ‘https://apix.eu.amity.co/api/v3/communities
–header ‘Accept: application/json’
–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer’
–data ‘{
“displayName”: “GlobalFeed”,
“isPublic”: true,
“isOfficial”: false,
“onlyAdminCanPost”: false,
“description”: “GlobalFeed”,
“tags”: [
“GlobalFeed”
],
“metadata”: {},
“avatarFileId”: “string”,
“userIds”: [
],
“categoryIds”: [
“string”
],
“isUniqueDisplayName”: true,
“needApprovalOnPostCreation”: false,
“allowCommentInStory”: true,
“notificationMode”: “default”
}’

@hossam Based on the Curl command you provided, we recommend that if there are no avatarfileid or category as strings, you should remove them.

Hello I try to make it but I got
{
“status”: “error”,
“message”: “Invalid admin token”,
“data”: {
“httpStatus”: 400,
“appStatus”: 400002
}
}
So what is the error and I send the valid token For admin

Hello, please ensure that you get the admin token from Amity console directly and use it as "Authorization : Bearer "

cURLs sample:

curl --location ‘https://api.eu.amity.co/api/v3/communities
–header ‘accept: application/json’
–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer xxx’
–data ‘{
“displayName”: “test create community”,
“isPublic”: true,
“isOfficial”: true,
“onlyAdminCanPost”: false,
“description”: “test create community”,
“tags”: [
“test”
],
“isUniqueDisplayName”: false,
“needApprovalOnPostCreation”: false
}’

I already make that and get the token form the Amity console

Hello , and I already make this with any token even if it is users or admin I got
Access Token is invalid but the token is valid
and this is the cURL

curl --location 'https://apix.us.amity.co/api/v3/communities' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ' \
--data '{
  "displayName": "Global Feed",
  "isPublic": true,
  "isOfficial": false,
  "onlyAdminCanPost": false,
  "description": "Global Feed",
  "tags": [
    "Global Feed"
  ],
  "metadata": {},
  "isUniqueDisplayName": true,
  "needApprovalOnPostCreation": false,
  "allowCommentInStory": true,
  "notificationMode": "default"
}'

Hello, could you please clarify how you verified the validity of the token? Additionally, could you confirm if your application region is EU or US? Previously, your endpoint was EU.

Additionally, kindly ensure that the user ID, API key, and region are correct when generating tokens.

1 Like