OpenIM is an open source IM project, which publishes a message push api to support deep integration between applications and IM.

Take the office scene as an example, such as employee employment notice, holiday notice and other business notices. The oa system handles specific business logic, and then calls the message push api to reach the target users.

Effect example

Taking collaborative office as an example, employees receive the work notice pushed by the system and have new tasks to deal with. ?

Employees can click on the work notice to see the specific details, and each notice has a different sender nickname and avatar. This notification type is a new session type, all aggregated in the same session.

Introduction to OpenIM

OpenIM: the overall solution of open source instant messaging from server to client SDK. Developers can easily replace third-party IM cloud services, create applications with chat and social functions, and integrate SDK into their own applications to provide instant messaging functions. The value of open source IM lies in "everything is controllable" and "my information is my master", whether it is technology or information security.

As the leader of open source IM, OpenIM continues to add new functions, including message push api and group chat. Both the server and sdk are Apache-2.0 licensing agreements and can be used for free. Products with UI need commercial authorization, and interested customers can contact us for in-depth communication.

5X8 hours vip exclusive service, including:

(1) One-on-one technical consultation, WeChat telephone, etc.

(2)sdk use counseling;

(3) Answer questions about server architecture and deployment;

(4) Give priority to the new requirements of information management;

(5)bug priority repair;

(6) System maintenance and fault response;

Network experience:/

Android experience:/#/

Brief description

The administrator sends a notification message through the background interface.

Request URL

",?

" senderNickname ":? "System Notification 2"?

"Content": {

"Notification name":? "Document management"?

" notificationFaceURL ":? "",?

"Notification Type":? 1,?

"text": Hello, everyone, today is ...?

" externalUrl ":" ",

“mixType”:0,?

" pictureElem": {

"Source path":? "",?

"Original picture": {

" uuid ":? "",?

"Type": ""?

[size]:? 0,?

Width: 0,?

"height": 0,?

"Website": ""

},?

"Big picture": {

" uuid ":? "",?

"Type": ""?

[size]:? 0,?

Width: 0,?

"height": 0,?

"Website": ""

},?

"Snapshot picture": {

" uuid ":? "",?

"Type": ""?

[size]:? 0,?

Width: 0,?

"height": 0,?

"Website": ""

? }

},?

" soundElem": {

" uuid ":? "",?

"sound path": "",?

" sourceUrl ":? "",?

" dataSize ":? 0,?

Duration: 0

},?

" videoElem": {

"Video path": "",?

" videoUUID ":? "",?

“videoUrl”:"",?

"Video Type": "",?

"Video size": 0,

"Duration": 0,

"snapshot path": "",?

“snapshotUUID”:"",?

"Snapshot size":? 0,?

“snapshotUrl”:"",?

"Snapshot width":? 0,?

“snapshotHeight”:0

},?

" fileElem": {

"File path":? "",?

" uuid ":? "",?

" sourceUrl ":? "",?

"file name": "",?

"File size":? 0

},?

" ex ":? ""

},?

"Content type":? 1400,?

"Session Type":? 4,?

" isOnlineOnly ":? Fake?

" offlinePushInfo": {

[Title]:? "Administrator revoked your message"?

《desc》:? "",?

" ex ":? "",?

" iOSPushSound ":? "Default"?

" iOSBadgeCount ":? wrong

? }

} copy? Where to? Clipboard or copy

Request parameter

Required description of parameter name type.

OperationIDstring is the operation ID, which remains unique. The background link tracking problem suggests using the current time microsecond+random number.

SendIDstring is the administrator ID, which is one of the administrator IDs configured in the background configuration file. The default is openIM 123456.

RecvIDstring is the recipient user ID.

SenderPlatformIDintNo。 Sender's platform, which is filled in when simulating users to send.1-> IOS,2-& gt; Android,3-& gt; Windows,4-& gt; OSX,5->; Web,5->; MiniWeb,7-& gt; Linux operating system

SenderFaceURLstring does not have the sender's avatar, which is used by the client to inform the session generation.

SenderNicknamestring has no sender nickname and is used by the client to inform the session generation.

Contentobject is the specific content of the message, which contains a json object.

Notifications naming string is the notification title.

NotificationFaceURLstring is the notification avatar.

NotificationTypeint is a notification type, for example, 1 stands for employment notice, and 2 stands for resignation notice.

Textstring is the notification body e.

ExternalUrlstring does not inform the address link to jump to after clicking (if it is not filled in, there is no need to jump).

MixTypeint is notification mixed type 0: plain text notification 1: text+picture notification 2: text+video notification 3: text+file notification.

No picture element object

SourcePictureobject has no original picture.

The big picture object has no big picture.

Snapshot picture object has no thumbnail.

SoundElemobject sound element object

VideoElemobject has no video element object.

FileElemobject has no file element object.

UuIDstring does not have an object unique id for caching.

Type/Video Type/String No Picture Type/Video Type.

Size/datasize/videosize/snapshot size/filesize int No multimedia file size, in bytes.

Width/snapshotWidthint, the width of the picture/video thumbnail.

Height/snapshot height No picture/video thumbnail height

Url/sourceUrl/videoUrlstring has no URL for pictures/files/videos.

Sourcepath/soundpath/videopath/filepathstring has no file path and is not needed.

File name string has no file name

Exstring no extension field

ContentTypeint is a message type fixed at 1400.

SessionTypeint is a notification session type fixed at 4.

When the isOnlineOnlybool no change field is set to true, the sending message server will not store it, and the receiver will receive it online. If it is not online, the message will be lost.

OfflinePushInfoobjectNo。 For the specific content of offline push, if it is not filled in, the default push title of the server will be used.

Title string has no push title.

Description string no push

Exstring no extension field

IOSPushSoundstring no IOS push sound.

IOSBadgeCountbool No, is the IOS push message contained in the desktop icon and not read?

Return to example

{

"Error code": 0,?

" errMsg ":? "",?

"Data": {

" serverMsgID ":? "",?

" clientMsgID ":? "",?

"sending time": 1645697804432

}

} copy? Where to? Clipboard or copy

Return parameter

Parameter name type description

Error code int 0 succeeded, but non-zero failed.

ErrMsgstring error message

The specific time to send the sendTimeint message, especially the millisecond timestamp.

Unique ID of the message generated by the serverMsgIDstring server.

The unique ID of the message generated by the clientMsgIDstring client, which is used as the primary key by default.

Message type format description

Brief description

The message type description supported by the administrator message sending field contentType and the specific field description of the message content.

Content Type Message Type Description

ContentType value type description

10 1 SMS

102 picture message

103 audio message

104 video message

105 file message

@ Type a message in 106 group chat

107 merge forwarding type messages

108 business card information

109 Geographic Location Type Message

1 10 custom message

1 1 1 Withdraw class message

1 12 Read the receipt type message.

1 14 reference type message

Content specific content

The content is a concrete json object, and different message types are different json objects.

Text message

{

...,

"Content": {

"text": Ni Hao.

},

....

} copy? Where to? Clipboard or copy

The required type description of the parameter name.

Text is the specific content of a string text message.

Custom message

{

...,

"Content": {

"data": ""?

[description]:? "",?

"extension": ""

},

....

} copy? Where to? Clipboard or copy

Required description of parameter name type.

Datajson string is a user-defined message converted from json object.

Descriptionjson string No, the extended description information is the converted string of json object, which can be omitted.

Extensionjson string has no extension field, so it is not used for the time being.