Technical FAQ

Explore our Technical FAQ for quick answers to common questions about Amity products. Get troubleshooting tips, best practices, and insights to optimize your technical experience.

API

How do I create a large number of users in bulk on Amity?

To create a large number of users, it's advised to use the following endpoint: Register a session.

What should I use as the 'Authorization' token when I need to perform admin actions?

To obtain your admin token, please follow these steps on the Amity console:

  1. Navigate to "Settings" > "Admin Users"

  2. Locate your admin account and click on the three dots button (ellipsis) on the same line as your account.

  3. From the dropdown menu, select "Admin Token."

This will provide you with the necessary 'Bearer' token to use for authorization when performing admin actions.

How can I retrieve the next page of data from an API?

To retrieve the next page of data from an API, you should use the "next" page token provided at the end of the initial page's results. This token should be appended to the endpoint to fetch the values for the next page.

Here's an example:

{
  "paging": {
    "next": "eyJza2lwIjoyMCwibGltaXQiOjEwfQ=="
  },
}

To get the next page of data, append the "next" token to the endpoint like this:

Next Page API Request:

curl --location --globoff 'https://api.sg.amity.co/api/v3/communities?filter=all&sortBy=lastCreated&options[token]=eyJza2lwIjoxMCwibGltaXQiOjEwfQ%3D%3D' \
--header 'accept: application/json' \
--header 'Authorization: Bearer xxx'
How can I upload a bulk list of blocklisted words?

You can upload a bulk list of blocklisted words using an example like this:

curl --location 'https://api.sg.amity.co/api/v2/blacklist/records' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxx' \
--data '{
  "regexs": [
    "word1",
    "word2",
    "word3"
  ],
  "isMatchExactWord": true
}'

In this example, replace "word1," "word2," and "word3" with the blocklisted words you want to upload in bulk. The request includes the necessary headers and data to add the specified words to the blocklist.

Setting isMatchExactWord to true makes the blocklisting more strict and will only block exact matches, while setting it to false makes the blocklisting more permissive and will block any occurrence of the blocklisted word or expression within a larger text.

How can I modify my follow/unfollow settings?

You can adjust your follow/unfollow settings by making an API call to the following endpoint: https://api-docs.amity.co/#/Network%20Setting/put_api_v3_network_settings_social. Please refer to the example below to understand the structure:

curl --location --request PUT 'https://api.sg.amity.co/api/v3/network-settings/social' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxx' \
--data '{
  "isFollowWithRequestEnabled": false
}'
How can I obtain higher-quality images?

For higher-quality images, you can enhance the resolution by simply adding ?size=full to the end of the URL.

Example: https://api.amity.co/api/v3/files/{fileId}/download?size=full.

Additionally, you have the flexibility to specify the size as "small," "medium," "large," or "full" based on your preferences.

What is a refreshToken?

A refreshToken is primarily employed by SDKs to validate the accessToken's validity. When using the API, obtaining a new token can be achieved by making a "register session" API call, eliminating the need to directly manage or use a refreshToken.

How long does the authentication token last?

The authentication token has a duration of 10 minutes, and it must be used within that specific time frame. For further information on secure mode and authentication tokens, please refer to this section: https://docs.amity.co/analytics-and-moderation/console/settings/security#secure-mode


Social and Chat

What is the purpose of targetType and targetId?

The targetType and targetId parameters are essential in query options for fetching posts from a specific feed.

  • targetType specifies the type of feed, which can be either ‘user’ or ‘community’.

  • targetId is the identifier for the specific feed, such as a userId for a user feed or a communityId for a community feed.

For a comprehensive explanation of these parameters and their usage, you can refer to the Amity SDK documentation on querying posts: https://docs.amity.co/amity-sdk/social/posts/query-post

Is it possible to sort posts within a community by engagement, similar to the global feed?

Currently, posts within a community can’t be sorted by engagement like the global feed. The available sorting options for community posts are ‘lastCreated’ and ‘firstCreated’.

For more information on how to implement these sorting options, you can refer to the Amity SDK documentation on querying posts: https://docs.amity.co/amity-sdk/social/posts/query-post

How can I query communities while excluding the ones that have been deleted?

To exclude deleted communities from your query results, you can use different methods depending on whether you’re using the API or SDK:

  1. Using the API: When querying communities through the API at: Query communities API, include the parameter isDeleted: false in your request. This will filter out any deleted communities from the results.

curl --location 'https://api.sg.amity.co/api/v3/communities?filter=all&isDeleted=false'
--header 'accept: application/json'
--header 'Authorization: Bearer xxx'
  1. Using the SDK: If you’re utilizing the SDK, you can set the includeDelete: false parameter. This option allows you to control whether deleted communities are included in the query results. For more information on how to use this, visit Amity SDK - Query Communities https://docs.amity.co/amity-sdk/social/communities/query-communities and adjust the includeDelete parameter as needed.

Is there a way to check which communities a user is part of?

Due to privacy and design considerations, it’s not possible to query communities joined by other users, even if you are an admin. However, the current user can query the communities they have joined themselves. This can be done through the API, as detailed at: Query communities API, by filtering for membership.

curl --location 'https://api.sg.amity.co/api/v3/communities?filter=member' \
--header 'accept: application/json' \
--header 'Authorization: Bearer xxx'

Alternatively, you can use the SDK, as explained in Amity SDK - Query Communities https://docs.amity.co/amity-sdk/social/communities/query-communities.

Why does querying a list of objects only return 20 items in the response?

This behaviour is due to pagination implemented in our API endpoints and functions, which default to returning 20 items per page. To access more items, you need to use the next page token (Please refer to the API section above) or the nextPage() function, depending on the SDK you’re utilizing.

For detailed information on how pagination works for different SDKs, please refer to the Live Objects/Collections section in our documentation here: https://docs.amity.co/amity-sdk/core-concepts/live-objects-collections

How can I update a community user’s role?

To update a user’s role in a community, you have two options:

  1. Using API: Add roles to community users API with the following cURL command:

curl --location 'https://api.sg.amity.co/api/v4/communities/657306a3189cef362ea99923/users/roles' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxx' \
--data '{
  "roles": [
    "community-moderator"
  ],
  "userIds": [
    "test"
  ]
}'
  1. For Admin Users Using the Console: You can modify a user's role directly within the console. Follow these steps:

    1. Go to the specific community you wish to manage.

    2. Navigate to the 'Members' tab.

    3. Locate the user whose role you want to change.

    4. Click on the three dots button on the right-hand side.

    5. Select 'Change user role' from the options.

How can I remove members from a community?

Members can be removed either through the SDK, as detailed here: https://docs.amity.co/amity-sdk/social/communities/community-moderation#remove-members, or by using the API, found at: Delete community users API.

How can I delete a community?

You can delete a community using the API provided here: Delete Community API Alternatively, for admin users, you can also close a community directly from the Amity console.

Here's how:

  • Navigate to the Community tab in the console.

  • Select "Communities."

  • Click on the name of the community you want to close.

  • Go to "Settings" page.

  • Scroll to the bottom where you will find the "Close Community" option.

Does the JavaScript SDK support Unread Count?

Yes, the JavaScript SDK includes support for a legacy unread count. You can find more information here: https://docs.amity.co/amity-sdk/chat/channels/read-status-and-unread-count-legacy.

Note: The unread count in the JavaScript SDK only supports the channel unread count from the default subchannel. Since the JS SDK does not support subchannels, all unread counts from subchannels will not be included.

Please refer to this section for more information related to channels and subchannels: https://docs.amity.co/amity-sdk/chat/channels#channel-and-subchannel-structure

I don't want the global feed to be empty for new users. How can I add some posts there?

You can implement an auto-join function, which can be called after a new user is created. To achieve this, use the join community API, which you can find here: Join community API. By doing this, existing posts in those particular communities will be displayed as the initial content in the global feed for new users.

What is metadata and its intended use?

Metadata consists of additional properties designed for custom fields. It serves to store supplementary data related to specific objects, like a user object, but isn't suitable for large amounts of data or information.

Please note that metadata has a size limit and it is recommended to keep it below 1000 bytes.

Why is my global feed empty?

The global feed aggregates posts from communities you have joined and from users you are following. If you haven’t joined any communities or followed any users, there will be no posts for the global feed to display.

What are the image requirements for uploading?

The supported image formats for upload are JPG and PNG. Each image must not exceed 1GB in size. A post can contain up to ten images. Additionally, on the iOS platform, any uploaded images or videos in unsupported formats, like HEIC or HEVC, will be automatically converted to PNG.

What are the videos requirements for uploading?

The supported video formats include 3gp, avi, f4v, flv, m4v, mov, mp4, ogv, 3g2, wmv, vob, webm, and mkv. Videos must not exceed 1 GB in size and should have a maximum duration of 2 hours. Each post can contain up to ten videos.

Please note that uploading HDR video format is not supported on iOS.

After enabling secure mode and obtaining the auth token, do I need to generate an access token? What should I do with the auth token if I’m using the SDK?

When using the SDK, you only need the auth token, which should be provided when a user logs in or creates an account. The SDK will manage the process thereafter. For more information, you can refer to the Amity SDK documentation on user creation: https://docs.amity.co/amity-sdk/core-concepts/user/create-user

Why are the posts on my global feed not sorted by the most recently created?

Our global feed offers multiple sorting options, including sorting by factors such as Engagement Rate, Time of Posting, and Updates. It's possible that your feed is currently sorted by other factors, if you wish to update or adjust the feed configuration, please reach out to our support team at support.asc@amity.co

For more detailed information on custom post ranking, you can also refer to our documentation at: Custom post ranking


iOS

What should I do if push notifications on iOS are not working?

If you already followed our docs here:

and it still does't work. Ensure you’ve covered all bases in this checklist:

• Verify that you’re using a production certificate.

• Check if the app_id matches the issued push certificate.

• Confirm the certificate hasn’t expired or been revoked.

• Make sure the app enables the “push notification” capability.

• Ensure the app is running in a production build (TestFlight/App Store).

• Run the app on a real device.

• Verify that the user hasn’t disabled push notifications for the app.

• Check if the user’s “Do Not Disturb” mode is activated.

Can I use my own realm in an iOS project?

No, we would recommend you use our realm which is included in the iOS SDK and UIkit. You can check the compatible version between the iOS SDK and Realm on our changelog page in compatibility section and adjust the version accordingly.

For more information on the iOS SDK and UIKit, you can visit:

What type of certificate do I need to register push notification on iOS?

To register push notifications on iOS, you'll require a .p12 certificate. During the process, make sure to select "Apple Push Notification Service SSL (Sandbox & Production)"

For detailed instructions on setting up an iOS push certificate, please consult this documentation: iOS Push Notification Certificate Setup.


Poll

What is the method for obtaining the list of voters for a specific answer in a poll?

To get the voters for a specific answer in a poll, you can utilize the API endpoint provided: Get poll answer. This API will return the user IDs of the voters along with their answers in the response.

Console

Where can I get my admin token?

To obtain your admin token, please follow these steps on the Amity console:

  1. Navigate to "Settings" > "Admin Users"

  2. Locate your admin account and click on the three dots button (ellipsis) on the same line as your account.

  3. From the dropdown menu, select "Admin Token."

How do I grant console access to my team members?

First, your portal owner/head of admins needs to create the initial admin user on the console. Subsequent admin users can then create or grant access to additional team members. To do this, navigate to ‘Settings’ > ‘Admin Users’ and click on the ‘Create New Admin’ button located at the top right of the page. Fill in the username and password; team members can use these credentials to access the console.

Who can upload a PNS Certificate file to the Push Notification section and how is it done?

Initially, only the portal owner has the capability to upload the PNS Certificate. They will find the option to do so by clicking on the “+ Add new certificate” button, which is exclusively available to them for the first upload.

Why can't I retrieve posts from communities that a user has posted in when I use the 'User' option in the Post Management on Amity console?

The 'User' option, found under the 'Posts' section with 'User' selected in the dropdown menu, is specifically meant for fetching posts from a user's feed. Please note that it is not intended to retrieve posts from communities where a user has posted, based solely on the user's ID.

How can I obtain my API key and application region (endpoint)?

Please log in to your console, and you will find your API key and app region (endpoint) in the "Settings" > "Security" tab.


Portal

How do I create new app environments for different purposes, such as testing and production?

To create new app environments for various purposes, like testing or production, follow these steps:

  1. Log in to your Amity portal.

  2. In the upper right corner you'll find a "Create Application" button.

We recommend creating a separate application for each environment based on its specific purpose. This helps keep your testing and production environments organized and distinct.

How do I upgrade my application pricing plan?

To upgrade your application's pricing plan, follow these steps:

  1. Create a new application in the portal and select the desired plan, such as "ASC Advance."

Next, provide us with the following information:

  1. Your customer ID, which is an 8-digit number located on the left sidebar of the portal.

  2. Specify the application ID that you intend to upgrade from. This should be your first application with the Basic plan.

Once you have gathered all the necessary information, please reach out to our support team at support.asc@amity.co

How can I access the portal, it says my email is invalid?


Alternative solutions for unsupported features

How can I implement a feature that allows users to save their favourite posts?

For this use case, you can use our user's object metadata field to store the postId of the posts the user wants to save so that they can be extracted and fetched later. The saved content can be accessed from the user's profile or a dedicated section within the user interface. The exact implementation and design of this feature can vary depending on the specific requirements and design of your application.

How can I add a Verified badge (blue tick) for users?

To add a Verified badge to a user’s profile, you need to update their user object’s metadata by including a ‘verified’ label. Once this label is in place, the frontend system can retrieve this information and display the Verified badge, styled as a blue tick or as per your custom design preferences. The verification process, governed by your frontend logic, ensures that the account meets your criteria for verification. After the account is verified according to these standards, you can then insert the ‘verified’ label into the metadata of the user’s profile.

Is there an option for users to accept or decline invitations to join a community?

While our product does not directly provide this feature, you can implement it on your end by updating the metadata of users. Invited users’ metadata can include an ‘invitedCommunity’ list. You can extract this list to query community details and display them. Once a user accepts or declines the invitation, the CommunityID will be removed from their metadata.

How can I retrieve community posts by a specific user ID?

Unfortunately, you cannot achieve this directly via the SDK or API, as community feed and user feed are separate. You can choose to fetch posts from either the community feed or the user feed individually. However, you can meet this requirement by using content search. For more details, please refer to the content search section.

If you're interested in trying this feature, please note that you'll need to enable it first. To do so, please get in touch with our support team at support.asc@amity.co. They will assist you further with enabling content search for your application.

How to implement post sharing feature?
  1. To share a post, create a new post and specify the destination target for the shared content.

  2. In the metadata of the newly created post, include the original post's ID, for instance: "originalPostID": "abc".

  3. When retrieving the shared post, implement frontend logic to check for the presence of the "originalPostID" field in the metadata. If found, fetch the original post using the provided ID (e.g., by calling "get post") and display it on the frontend.

This approach enables you to maintain a reference to the original post, ensuring consistency in content, reactions, and comments.

How can I set up email notifications for specific actions in my community, such as when a post is flagged?

For email notifications, you can leverage our webhook events triggered when a post is flagged. You can find more details in the documentation here:

To receive email notifications based on this webhook event, you may need to implement this functionality using a third-party tool that can send email notifications when the webhook event is triggered, such as when a post is flagged.


Beta features

How do you implement push notifications in Web React and React Native?

To implement push notifications in Web React JS and React Native, you can utilize our webhook events. These events provide real-time updates on new posts and comments, including sender and receiver information. You can use this data to customize your push notifications with specific labels, details, and payload.

For a complete list of available webhook events, please visit: https://api-docs.amity.co/#/WebhookEvent

Why does content search return fewer posts than the user has?

Content search will only return posts that were created after the content search feature was enabled. Posts created before the enablement will not be included in the content search response.

Please be aware that only posts created after the feature was enabled will be part of the search results.


Frequent error types: Definition

Why am I encountering this error “Error: Connect client first”?

This error typically arises when an SDK function is called before successfully establishing a connection to the Amity session. To resolve this, ensure that you call UserRepository related functions only after the session state is set to ‘established’. You can monitor the session state using the following code snippet:

const [sessionState, setSessionState] = useState('');

useEffect(() => {
  return Client.onSessionStateChange((state: Amity.SessionStates) => {
    setSessionState(state);
  });
}, []);

This code tracks the session state, and you should proceed with calling SDK functions once the state confirms the session is established.

I received the error “Query Token is invalid” What should I pass as the query token in Swagger?

The error indicates a problem with the pagination token. In the result response, a pagination token is provided at the end of the first page. You should use this token to fetch subsequent pages. The response typically includes a "paging" section with "next" and "previous" strings, like this:

"paging": {
    "next": "string",
    "previous": "string"
}

Use the value from the ‘next’ or ‘previous’ string as your query token to access additional pages.

What does the error "Unable to use SDK while the SDK is logging in" mean?

This error occurs when the SDK login process is in progress while other actions are attempted. To resolve this, you should ensure that other actions are initiated only after the login process has successfully completed.

What does the error "RateLimit Exceed" mean?

Our API/function is subject to a limit of 10 calls per second per user. To avoid encountering this error, it is important to carefully monitor and control the number of calls made to ensure they do not exceed this defined limit.

What should I do when I encounter error code 400314 while attempting to post content with an image?

If you've encountered error code 400314 while trying to post content containing an image, it is likely related to our image moderation settings. To address this issue, follow these steps:

  1. Confirm whether you have enabled image moderation in your console settings. You can do this by accessing the console and checking the image moderation settings under Settings > Image Moderation tab.

  2. Adjust the confidence level in the console to an appropriate setting. For detailed instructions, please refer to this link: Image Moderation Settings.

  3. If you are curious about how the confidence level functions and have questions, you can find answers in our FAQ section: Image Moderation FAQ.

Please be cautious not to set the confidence level too low, as it may result in the blocking of all images.

Why am I unable to post a link and receiving error 400309?

This error occurs because we have link moderation in place. You can manage this feature in the console by going to "Moderation" > "Allow list" tab. If the feature is enabled, links that have not been added to the allow list will not be permitted to be posted in the community or chat.


General

Can a user be restored after deletion?

Once a user is deleted using the API : Delete user API, it is not possible to undo this action. The user is permanently removed.

How can I delete inactive users?

To delete inactive users, you can make use of the following API call:

Here's an example:

curl --location --request DELETE 'https://api.sg.amity.co/api/v4/users/test2?deleteAll=true&markMessageDeleted=false&hardDeletePost=false&hardDeleteComment=false' \
--header 'accept: application/json' \
--header 'Authorization: Bearer xxx'

After the user is deleted, their display name will be automatically changed to 'Deleted user'. Please be aware that once users are deleted, there is no way to restore them.

What are the consequences for a user who is globally banned?

When a user is globally banned by an admin, they lose the ability to authenticate with ASC and are automatically removed from all their existing channels. Additionally, all of the banned user’s messages are deleted, although if these messages are already cached in the SDK, they will only disappear upon refreshing.

However, the user’s social content, including posts, comments, and community memberships, remains intact.

The globally banned user will be unable to authenticate with Amity’s network again until the global ban is lifted.

How are concurrent connections counted when a user opens multiple tabs?

Concurrent connections are counted on a per-device basis, rather than by the number of browsers or tabs. For instance, if a user connects from two different devices, it counts as two concurrent connections.

Is there a dark theme option available in Amity?

Amity does not fully support a dark theme at the moment. However, you can customize the UI to create a dark theme using our open-source UIKit, which offers flexible UI customization options.

How do I delete an unused application?

To delete an unused application, please contact our support team at support.asc@amity.co, and they will assist you in fulfilling your request.

What defines an inactive user?

Inactive users are defined as the total unique users, identified by their user IDs, who have registered within the Amity Social Cloud system but have not established any connection to any Amity Social Cloud network during the specific month for which the Monthly Active User (MAU) count is being calculated. This includes users who may have registered at any time in the past, such as someone who signed up in January but has been inactive since then, and are still considered inactive in the subsequent months like May.

Where can I download Figma files?

You can download Figma files from the following links:

For further assistance or if you have any questions, or require clarification on any technical matters, please do not hesitate to reach out to our dedicated support team at support.asc@amity.co

Last updated

Change request #3026: New Content: Technical FAQ