Overview

The CometChat Data Import REST API provides an efficient way to import users, groups, group members, and messages from your previous chat system to CometChat. This API allows you to seamlessly transition from your previous chat system with minimal disruption to your users.

Key Features

  • Import Users: Create multiple users at once in your CometChat app by importing them from an existing data source.

  • Import Groups: Easily migrate all your existing groups into your CometChat app.

  • Import Members: Import members to join specific groups in your CometChat app.

  • Import Messages: Migrate your existing chat history, including one-on-one messages and group messages into your CometChat app.

Getting Started

To start using the CometChat Import REST API, you'll need your AppID, API Key and region, which can be obtained from your CometChat Dashboard. All API requests must be made over HTTPS.

The base URL for all CometChat Pro REST API requests is https://<appId>.api-<region>.cometchat.com/v3.0/data_import.

Be sure to replace 'appId' and 'region' with your actual App ID and region respectively in the API endpoint.

Authentication

Authentication is a crucial aspect of utilizing CometChat's REST API securely. All API requests must be accompanied by an API key to authenticate the incoming requests. CometChat employs industry-standard authentication mechanisms to ensure the security and integrity of your data.

Endpoints

CometChat's Data Import APIs are designed to be intuitive and easy to integrate into your application's backend infrastructure.
Example of a Import Users API request in curl command syntax:

curl -X POST \
-H "Content-Type: application/json" \
-H "apiKey: YOUR_APIKEY_HERE" \
-d '{
   "users": {
        "test_uid": {
            "uid": "test_uid",
            "name": "Atlas"
        },
        "test_uid2": {
            "uid": "test_uid2",
            "name": "Apollo"
        }
    }
}' "http://<appId>.api-<region>.cometchat.io/v3.0/data_import/users"

Replace appId, apiKey and region in the curl request.

Sample Code

To further assist you in integrating CometChat's Data Import API into your application, we provide sample code snippets in popular programming languages such as JavaScript, Python, NodeJS, and PHP. These snippets demonstrate how to make API requests and handle responses, helping you kickstart your development process.`


Support

If you encounter any issues or have questions regarding CometChat's REST API, our dedicated support team is here to assist you. Feel free to create a support ticket or seek real-time support via the CometChat Dashboard. we'll be more than happy to help you resolve any issues promptly.