-
Notifications
You must be signed in to change notification settings - Fork 77
Message Formats
The following message formats are known but not necessarily parsed (implemented) yet. This page is useful when you want to support a type of event which is not implemented yet by the API, or if you just want to have an idea of what certain events look like in XMPP.
Events added by maritaria:
When your bot gets added to a group (the bot has chatted with the inviter, so it gets added immediately)
<message from="[NUMBERS][email protected]" to="[email protected]" type="groupchat" id="[GUID]" xmlns="jabber:client">
<kik qos="true" app="all" hop="true" timestamp="1510865418472" push="false"/>
<request d="false" r="false" xmlns="kik:message:receipt"/>
<roster/>
<g is-public="true" jid="[NUMBERS][email protected]"><!-- NUMBERS same as message.from -->
<code>#[PUBLIC_GROUP_HASH]</code>
<n>Bot testing ground</n>
<pic ts="1505911808105">http://profilepics.cf.kik.com/[REDACTED]</pic>
<m>[JID]@talk.kik.com</m><!-- The jid of the bot is also in the list -->
<m>[JID]@talk.kik.com</m><!-- Some other member -->
<m s="1" a="1">[JID]@talk.kik.com</m><!-- Owner account, S=owner A=admin -->
</g>
<sysmsg xmlns="kik:msg:info">[FIRSTNAME] [LASTNAME] has added you to the chat</sysmsg>
</message>
When someone leaves a (public) group your bot is a member of.
<message type="groupchat" xmlns="jabber:client" id="[GUID]" from="[NUMBERS][email protected]" to="[BOT_JID]@talk.kik.com"><!-- JID of group -->
<kik timestamp="1510911460608" push="false" app="all" qos="true" hop="true"/>
<request d="false" r="false" xmlns="kik:message:receipt"/>
<roster/>
<g jid="[NUMBERS][email protected]"> <!-- JID of group -->
<l>[USER_JID]@talk.kik.com</l><!-- JID of user that left -->
</g>
<status jid="[USER_JID]@talk.kik.com">[FIRSTNAME] [LASTNAME] has left the chat</status>
</message>
When someone starts or is typing:
<message id="[GUID]" type="groupchat" xmlns="kik:groups" from="[TYPING_USER_JID]@talk.kik.com" to="[BOT_JID]@talk.kik.com">
<pb/>
<kik timestamp="1510911793198" push="false" app="chat" qos="false" hop="true"/>
<is-typing val="true"/>
<g jid="[GROUP_JID]@groups.kik.com"/><!-- the group the user is typing in -->
</message>
When someone stops typing:
<message id="[GUID]" type="groupchat" xmlns="kik:groups" from="[TYPING_USER_JID]@talk.kik.com" to="[BOT_JID]@talk.kik.com">
<pb/>
<kik timestamp="1510911793414" push="false" app="chat" qos="false" hop="true"/>
<is-typing val="false"/>
<g jid="[GROUP_JID]@groups.kik.com"/>
</message>
When someone sends a message in a group:
<message id="[GUID]" type="groupchat" cts="1510911505345" xmlns="kik:groups" from="[USER_JID]@talk.kik.com" to="[BOT_JID]@talk.kik.com">
<body>Is vervelend... aan de plus kant ik weet nu hoe het eruit ziet als iemand we gaat...</body><!-- This is the original message as captured during the test -->
<pb/>
<preview>Is vervele...</preview><!-- some shortened version of the body -->
<kik timestamp="1510911505345" push="true" app="chat" qos="true" hop="true"/>
<request d="true" r="true" xmlns="kik:message:receipt"/>
<ri/>
<g jid="[GROUP_JID]@groups.kik.com"/><!-- group the message was posted in -->
</message>
Someone makes you admin:
<message type="groupchat" to="[BOT_JID]@talk.kik.com" xmlns="jabber:client" id="[GUID]" from="[GROUP_JID]@groups.kik.com">
<kik hop="true" push="false" app="all" qos="true" timestamp="1511180642944"/>
<request d="false" r="false" xmlns="kik:message:receipt"/>
<roster/>
<g jid="[GROUP_JID]@groups.kik.com"/>
<sysmsg xmlns="kik:msg:info">You have been promoted to admin by [ADMIN_FIRSTNAME] [ADMIN_LASTNAME]</sysmsg>
</message>
Owner removing adminship:
<message type="groupchat" to="[BOT_JID]@talk.kik.com" xmlns="jabber:client" id="[GUID]" from="[GROUP_JID]@groups.kik.com">
<kik hop="true" push="false" app="all" qos="true" timestamp="1511180665857"/>
<request d="false" r="false" xmlns="kik:message:receipt"/>
<roster/>
<g jid="[GROUP_JID]@groups.kik.com"/>
<sysmsg xmlns="kik:msg:info">Your admin status has been removed by [ADMIN_FIRSTNAME] [ADMIN_LASTNAME]</sysmsg>
</message>
Sending a message from the bot:
<message type="groupchat" to="[GROUP_JID]@groups.kik.com" id="[GUID]" cts="1511183566420"><!-- id is MESSAGE_ID later on -->
<body>[MESSAGE_TO_SEND]</body>
<pb></pb>
<preview></preview><!-- this doesnt matter -->
<kik push="true" qos="true" timestamp="1511183566420" />
<request xmlns="kik:message:receipt" r="true" d="true" /><!-- r: receive read request d: receive delivery request -->
<ri/>
</message>
Receiving a delivery notification for a send message:
<message type="receipt" id="[GUID]" xmlns="jabber:client" to="[BOT_JID]@talk.kik.com" from="[USER_JID]@talk.kik.com">
<receipt type="delivered" xmlns="kik:message:receipt">
<msgid id="[MESSAGE_ID]"/>
</receipt>
<kik app="chat" push="false" timestamp="1511183559656" qos="true" hop="true"/>
<g jid="[GROUP_JID]@groups.kik.com"/>
</message>
Receiving a read notification for a send message:
<message from="[USER_JID]@talk.kik.com" to="[BOT_JID]@talk.kik.com" type="receipt" cts="1511183930239" xmlns="jabber:client" id="[GUID]">
<kik qos="true" timestamp="1511183930239" push="false" hop="true" app="chat"/>
<receipt xmlns="kik:message:receipt" type="read">
<msgid id="[MESSAGE_ID_1]"/>
<msgid id="[MESSAGE_ID_2]"/>
<msgid id="[MESSAGE_ID_3]"/>
<msgid id="[MESSAGE_ID_4]"/><!-- you can receive multiple at a time -->
</receipt><g jid="[GROUP_JID]@groups.kik.com"/>
</message>
Requesting the roster (the groups and people you are chatting with):
<iq type="get" id="[GUID]">
<query p="8" xmlns="jabber:iq:roster" />
</iq>
Response to requesting roster:
<iq to="[BOT_JID]@talk.kik.com/CAN167da12427ee4dc4a36b40e8debafc25" type="result" id="[REQUEST_GUID]">
<query ts="1511180666000" xmlns="jabber:iq:roster">
<g is-public="true" jid="[GROUP_JID]@groups.kik.com">
<code>#[GROUP_HASHTAG]</code>
<n>[GROUP_DISPLAY_NAME]</n>
<pic ts="1505911808105">http://profilepics.cf.kik.com/[SOME_IDENTIFIER]</pic>
<m s="1" a="1">[USER_JID]@talk.kik.com</m><!-- owner -->
<m a="1">[USER_JID]@talk.kik.com</m><!-- admin -->
<m>[USER_JID]@talk.kik.com</m><!-- user -->
<!-- users are listed here until the end -->
</g>
<!-- all other groups follow the same format and appear before the users are listed -->
<item jid="[email protected]">
<username>kikteam</username>
<display-name>Kik Team</display-name>
<pic ts="1479751536620">http://profilepics.cf.kik.com/9wG3zRZW8sLxLnpmyOfwNE7ChYk</pic>
<verified/><!-- indicates the user has a purple gear -->
<pubkey/>
</item>
</query>
</iq>