Skip to main content

OpenIM Server APIs

🚀 REST API​

OpenIM Server provides a REST API, allowing you to make requests to the IM system with superuser privileges, enhancing business functionality. For example:

  • 🛠 Create a Group
  • đŸ“Ŧ Send Messages

Use case: Automatically sending a welcome message to newly registered users.

Protocol Details​

  • Protocol: Uses the standard HTTP protocol
  • Data Format: Both requests and responses are in JSON format

Important Notes​

API URL:

The {API_ADDRESS} in the request URL is the API address of your OpenIM Server, e.g., http://{your_im_server_ip}:10002.

Permission Requirements:

To call the REST API, you must use an APP Administrator account, which has superuser privileges. OpenIM Server has a built-in APP Administrator with the userID of imAdmin.

Parameter Limits:

All array type parameters in API requests have a maximum length limit of 1000.

API Call Process​

  1. Obtain APP Administrator Token:

    Use the user_token API to obtain the administrator token.

  2. Call Other APIs:

    Add the obtained APP administrator token to the HTTP request header, and then call other REST APIs.