To execute the command using JSON you will need to set HTTP header Content-Type
to application/json
{ "command" : { "node": "http://jabber.org/protocol/admin#end-user-session", "fields": [ { "var" : "accountjids", "value" : [ "test@domain.com" ] } ] } }
Where test@domain.com
is JID of user who will be disconnected
As a result, the server will return following JSON:
{ "command" : { "jid" : "sess-man@domain.com", "node" : "http://jabber.org/protocol/admin#end-user-session", "fields" : [ { "var" : "Notes", "type" : "text-multi", "value" : [ "Operation successful for user test@domain.com/resource" ] } ] } }
To confirm that user test@domain.com
with resource resource
was connect and it was disconnected.
If user was not connected server will return the following response:
{ "command" : { "jid" : "sess-man@domain.com", "node" : "http://jabber.org/protocol/admin#end-user-session", "fields" : [] } }