500000 Error in Creating a community using API

I integrated the amity api very well and use it with some functionalities like posting , creating user. But I’m having problem right now in creating a community. I checked the error code and it seems like 500000 is for “Uncategorized internal system errors not related to any user input.Uncategorized internal system errors not related to any user input.” . Any advice on how can I proceed with it or troubleshoot this problem?

the actual api response is this and I’m using /api/v3/communities POST to create a community.

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

Hey @rewards,

Thanks for reaching out. I’ll need some more info to find out what’s causing the issue.
Could you send me the params, SDK Version (if applicable), please.

Also, if you are using the web sdk could I know if it’s the JS/TS one too.

If there’s any other info based on your judgement that could prove useful. That is welcome too.

Ta,
Cijin :slight_smile:

Hello @cijin ,

I think the sdk and versioning is irrelevant because I tried doing the create community in the api documentation Amity API .

{
  "displayName": "string",
  "isPublic": true,
  "isOfficial": false,
  "onlyAdminCanPost": false,
  "description": "string",
  "tags": [
    "string"
  ],
  "metadata": {},
  "avatarFileId": "string",
  "userIds": [
    "string"
  ],
  "categoryIds": [
    "string"
  ],
  "isUniqueDisplayName": false,
  "needApprovalOnPostCreation": false
}

Hey @rewards,

I work on the web SDK. But I’ll send this to our support team and they’ll keep you updated on this. I’m sorry I can’t be of further help.

Cijin

1 Like

Hello @rewards we are able to create a community using the API you mentioned, please refer to the sample curls below:

curl --location 'https://api.amity.co/api/v3/communities' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ' \
--data '{
  "displayName": "community name",
  "isPublic": true,
  "isOfficial": false,
  "onlyAdminCanPost": false,
  "description": "string",
  "categoryIds": [
    "string"
  ],
  "isUniqueDisplayName": false,
  "needApprovalOnPostCreation": false
}'

If you’re still facing the issue, please help share your full curls with us and we will assist you in identifying and resolving the problem. Thank you.

Hi Guys,

I’m still facing issue on creating community.

“Only administrator can config about being official”

it seems like I need to use an administrator but it’s not specify how to use the admin-user account. Do i still need to call the session to generate the bearer.

@rewards For the "Authorization: Bearer " please refer to this section: Admin Token Management - Amity Docs