Skip to content

WhatsApp XMPP Reference

Ben edited this page Jun 18, 2021 · 6 revisions

Ack:

<ack/>
Attribute Description
class message, receipt, ?
from Receiving from this JID.
id Stanza ID
participant Participant of group
t Time (epoch)
to Sending to this JID.
type delivery, read

Send:

TODO

Receive:

<ack from="[email protected]" class="receipt" type="read" id="123"/>

Chat State:

<chatstate/>
Attribute Description
from Receiving from this JID.
to Sending to this JID.
Child Description
<active/> User is actively participating in the chat session.
<composing/> User is composing a message.
<gone/> User has effectively ended their participation in the chat session.
<inactive/> User has not been actively participating in the chat session.
<paused/> User had been composing but now has stopped.

Send:

<chatstate to="[email protected]"><composing/></chatstate>
<chatstate to="[email protected]"><paused/></chatstate>

Receive:

<chatstate from="[email protected]"><composing/></chatstate>
<chatstate from="[email protected]"><paused/></chatstate>

Failure:

<failure/>
Attribute Description
location Datacenter location of connection
reason Reason of failure

Receive:

<failure reason="401" location="nao"/>

Inbound:

<ib/>

Info/Query:

<iq/>

Get server properties:

Request:

<iq id="123" type="get" xmlns="w" to="s.whatsapp.net">
	<props/>
</iq>

Ping:

Request:

<iq id="123" xmlns="w:p" type="get" to="s.whatsapp.net">
	<ping/>
</iq>

Response:

...

Pong:

Request:

<iq to="s.whatsapp.net" id="123" type="result">
	<ping/>
</iq>

Response:

...

Set profile picture:

Request:

<iq type="set" id="123" xmlns="w:profile:picture" to="{jid}@s.whatsapp.net">
	<picture type="image" id="456">{imageData}</picture>
	<picture type="preview">{previewData}</picture>
</iq>

Response:

None

Message

<message/>

Receive:

<message from="[email protected]" type="text" id="123" t="1623854590" notify="Name of User">
	<enc v="2" type="msg">{{encryptedProtobuf}}</enc>
</message>

Presence

<presence/>
Attribute Description
from Receiving from this JID.
name Some nickname (?)
last Last online time (epoch)
to Sending to this JID.
type attribute Description
active Active (as long as connected)
available Available
subscribe Subscribe (as long as connected)
unavailable Unavailable
unsubscribe Unsubscribe

Send:

<presence type="available"/>
<presence to="[email protected]" type="subscribe"/>
<presence to="[email protected]" type="unsubscribe"/>

Receive:

<presence from="[email protected]"/>
<presence from="[email protected]" type="unavailable" last="1623849759"/>

Success:

<success/>
Attribute Description
abprops ?
creation Time of account creation (epoch)
location Datacenter location of connection
props ?
t Time of account login (epoch)

Receive:

<success t="162385119" props="26" location="nao" abprops="0" creation="162211362"/>