General Instructions:
- The authentication mechanism for these APIs follows the same authentication as all public CometChat REST APIs. Please use your app REST API Key in the header.
- The Base URL for the APIs is
https://<appId>.api-<region>.cometchat.io/v3/data_import/
- The HTTP request data will be in JSON format.
- The HTTP response from CometChat will also be in JSON format.
Import Messages API Usage
To import messages send post requests to the import api with bulk arrays of message records in chronological. To process large set of records multiple requests can be made. Each record in the array must contain a single messagedata
record that conform with the restrictions as specified by the Send Message APIs.
The total message count of all imported messages must be within the limit shared in the import support ticket. Each record contains a unique message id referred to as muid
. The array key and the muid
value must be the same.
The return status for each muid
will be documented in the response messages under data.<muid>.success
. The value of this parameter can be:
true
: indicating import execution success for thatmuid
.false
: indicating import execution failure for thatmuid
.
data.<muid>.error
.
Please note that the request can have many messages to be imported, each with a separate muid
. It is possible that a message may not be imported due to incorrect data supplied or a runtime error. In this case, its error code will be documented under its muid
structure in the response.
In case of such an error, correct the data being supplied in the API as per the error code indicated and resend the failed message data in a new API call. It is not expected to include the messages which were successfully imported in the preceding API call which resulted in the error for certain messages.
Visit Message Import API to start with your imports.
Request Format
Response Format
Import Users API Usage
To import users send post requests to the import api with bulk arrays of user records. To process large set of records multiple requests can be made. Each record in the array must contain a single user record. The array key and theuid
value must be the same.
The return status for each uid
will be documented in the response messages under data.<uid>.success
. The value of this parameter can be:
true
-> indicating import execution success for thatuid
.false
-> indicating import execution failure for thatuid
.
data.<uid>.error
.
Please note that the request can have many users to be imported, each with a separate uid
. It is possible that a user may not be imported due to incorrect data supplied or a runtime error. In this case, its error code will be documented under its uid
structure in the response.
In case of such an error, correct the data being supplied in the API as per the error code indicated and resend the failed user data in a new API call. It is not expected to include the users which were successfully imported in the preceding API call which resulted in the error for certain users.
Visit User Import API to start with your imports.