To set user status you need to set HTTP header Content-Type
to application/json
{ "available": "true", "priority": "-1", "show": "xa", "status": "On the phone" }
where:
-
available
- may be:true
- user is available/connected (default)false
- user is unavailable/disconnected
priority
- an integer of presence priority. (It should be always set as a negative value to make sure that messages are not dropped) (default: -1)-
show
- may be one ofpresence/show
element values (optional)chat
away
xa
dnd
status
- message which should be sent as a presence status message (optional)
As a result, the server will return following JSON:
{ "status": { "user": "test@domain.com/tigase-external", "available": "true", "priority": "-1", "show": "xa", "status": "On the phone", "success": true } }
This will confirm that user test@domain.com
with resource tigase-external
has it presence changed (look for success
element value).