{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "Open-IM-Server API server document, all requests in the document have an OperationId field for link tracking", "title": "open-IM-Server API", "contact": {}, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "host": "localhost:10002", "basePath": "/", "paths": { "/auth/user_token": { "post": { "description": "Get the user token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "User login", "operationId": "UserToken", "parameters": [ { "type": "string", "description": "OperationId", "name": "OperationId", "in": "header", "required": true }, { "description": "Secret is the Openim key. For details, see the server Config.yaml Secret field \u003cbr\u003e Platform is the platform ID", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.UserTokenReq" } } ], "responses": { "0": { "description": "", "schema": { "$ref": "#/definitions/auth.UserTokenResp" } }, "400": { "description": "Errcode is 400, which is generally a parameter input error.", "schema": {} }, "500": { "description": "ERRCODE is 500 generally an internal error of the server", "schema": {} } } } }, "/user/get_users_info": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Obtain user information in batches according to the user list", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Get user information", "operationId": "GetUsersInfo", "parameters": [ { "type": "string", "description": "Operation Id", "name": "OperationId", "in": "header", "required": true }, { "description": "Request", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.GetDesignateUsersReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/user.GetDesignateUsersResp" } }, "400": { "description": "errcode is 400 一Input errors in the parameter, token is not brought up", "schema": {} }, "500": { "description": "Errcode is 500 一For the internal error of the server", "schema": {} } } } }, "/user/get_users_online_status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get user online status", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Get user online status", "operationId": "GetUsersOnlineStatus", "parameters": [ { "type": "string", "description": "Operation Id", "name": "OperationId", "in": "header", "required": true }, { "description": "Request", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/msggateway.GetUsersOnlineStatusReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/apiresp.ApiResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/msggateway.GetUsersOnlineStatusResp_SuccessResult" } } } } ] } }, "400": { "description": "Errcode is 400, which is generally a parameter input error.", "schema": {} }, "500": { "description": "ERRCODE is 500 generally an internal error of the server", "schema": {} } } } }, "/user/set_global_msg_recv_opt": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Set the overall disturbance", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Set the overall disturbance", "operationId": "SetGlobalRecvMessageOpt", "parameters": [ { "type": "string", "description": "Operation Id", "name": "OperationId", "in": "header", "required": true }, { "description": "GlobalRecvmsGopt is the global disturbance setting 0 to turn off 1 to open", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.SetGlobalRecvMessageOptReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/user.SetGlobalRecvMessageOptResp" } }, "400": { "description": "Errcode is 400, which is generally a parameter input error.", "schema": {} }, "500": { "description": "ERRCODE is 500 generally an internal error of the server", "schema": {} } } } }, "/user/update_user_info": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Modify user information Userid Faceurl, etc.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Modify user information", "operationId": "UpdateUserInfo", "parameters": [ { "type": "string", "description": "Operation Id", "name": "OperationId", "in": "header", "required": true }, { "description": "Request", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UpdateUserInfoReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/user.UpdateUserInfoResp" } }, "400": { "description": "Errcode is 400, which is generally a parameter input error.", "schema": {} }, "500": { "description": "ERRCODE is 500 generally an internal error of the server", "schema": {} } } } }, "/user/user_register": { "post": { "description": "User registration", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "User registration", "operationId": "UserRegister", "parameters": [ { "type": "string", "description": "Operation Id", "name": "OperationId", "in": "header", "required": true }, { "description": "Secret is the Openim key. For details, see the server Config.yaml Secret field.", "name": "UserInfo", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UserRegisterReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/user.UserRegisterResp" } }, "400": { "description": "Errcode is 400, which is generally a parameter input error.", "schema": {} }, "500": { "description": "ERRCODE is 500 generally an internal error of the server", "schema": {} } } } } }, "definitions": { "apiresp.ApiResponse": { "type": "object", "properties": { "data": {}, "errCode": { "type": "integer" }, "errDlt": { "type": "string" }, "errMsg": { "type": "string" } } }, "auth.UserTokenReq": { "type": "object", "properties": { "platformID": { "type": "integer" }, "secret": { "type": "string" }, "userID": { "type": "string" } } }, "auth.UserTokenResp": { "type": "object", "properties": { "expireTimeSeconds": { "type": "integer" }, "token": { "type": "string" } } }, "msggateway.GetUsersOnlineStatusReq": { "type": "object", "properties": { "userIDs": { "type": "array", "items": { "type": "string" } } } }, "msggateway.GetUsersOnlineStatusResp_SuccessDetail": { "type": "object", "properties": { "connID": { "type": "string" }, "isBackground": { "type": "boolean" }, "platform": { "type": "string" }, "status": { "type": "string" }, "token": { "type": "string" } } }, "msggateway.GetUsersOnlineStatusResp_SuccessResult": { "type": "object", "properties": { "detailPlatformStatus": { "type": "array", "items": { "$ref": "#/definitions/msggateway.GetUsersOnlineStatusResp_SuccessDetail" } }, "status": { "type": "string" }, "userID": { "type": "string" } } }, "sdkws.UserInfo": { "type": "object", "properties": { "appMangerLevel": { "type": "integer" }, "createTime": { "type": "integer" }, "ex": { "type": "string" }, "faceURL": { "type": "string" }, "globalRecvMsgOpt": { "type": "integer" }, "nickname": { "type": "string" }, "userID": { "type": "string" } } }, "user.GetDesignateUsersReq": { "type": "object", "properties": { "userIDs": { "type": "array", "items": { "type": "string" } } } }, "user.GetDesignateUsersResp": { "type": "object", "properties": { "usersInfo": { "type": "array", "items": { "$ref": "#/definitions/sdkws.UserInfo" } } } }, "user.SetGlobalRecvMessageOptReq": { "type": "object", "properties": { "globalRecvMsgOpt": { "type": "integer" }, "userID": { "type": "string" } } }, "user.SetGlobalRecvMessageOptResp": { "type": "object" }, "user.UpdateUserInfoReq": { "type": "object", "properties": { "userInfo": { "$ref": "#/definitions/sdkws.UserInfo" } } }, "user.UpdateUserInfoResp": { "type": "object" }, "user.UserRegisterReq": { "type": "object", "properties": { "secret": { "type": "string" }, "users": { "type": "array", "items": { "$ref": "#/definitions/sdkws.UserInfo" } } } }, "user.UserRegisterResp": { "type": "object" } }, "securityDefinitions": { "ApiKeyAuth": { "description": "Description for what is this security definition being used", "type": "apiKey", "name": "token", "in": "header" } } }