Table of Contents
/Xmpp/SendSubscriptionAccepted
Allows the client to accept a presence subscription made to its account.
JSON
- Request
{ "to":Required(Str(PTo)), "id":Optional(Str(PId)) }
- Response (if successful)
{ "sent":Required(Bool(PSent)), "id":Required(Str(PId)), "RosterItem": { "bareJid": Required(Str(PBareJid)), "pendingSubscription": Required(Bool(PPendingSubscription)), "status": Required(Str(PStatus)), "name": Required(Str(PName)), "Groups": Required(Str(PGroups)?[]) } }
XML
- Request
<SendSubscriptionAccepted xmlns="https://waher.se/Schema/BrokerAgent.xsd" to=(Required(Str(PTo))) id=(Optional(Str(PId))) />
- Response (if successful)
<SubscriptionAcceptedResult xmlns="https://waher.se/Schema/BrokerAgent.xsd" sent=(Required(Bool(PSent))) id=(Required(Str(PId)))> <RosterItem bareJid=(Required(Str(PBareJid))) pendingSubscription=(Required(Bool(PPendingSubscription))) status=(Required(Str(PStatus))) name=(Required(Str(PName)))> <Groups> <[<Item><[Optional(Str(PGroups))]></Item>?[]]> </Groups> </RosterItem> </SubscriptionAcceptedResult>
Input Parameters
Parameter | Description |
---|---|
PTo |
A Bare or Full JID (XMPP network address). |
PId |
Optional Message ID. |
Response Parameters
Parameter | Description |
---|---|
PSent |
If the XMPP stanza was sent or not. |
PId |
ID of stanza sent. Can be used to match responses. If no ID was provided in the call, a message ID will be generated. |
PBareJid |
Bare JID of roster item. |
PPendingSubscription |
If the account has a pending subscription request to the remote entity. |
PStatus |
Status of roster item. |
PName |
Name given to the roster item. |
PGroups |
Names of groups to which the roster item is assigned. |
Javascript Library
Use the following asynchronous method in the Javascript Library, to call this resource.
var Response = await AgentAPI.Xmpp.SendSubscriptionAccepted(To,Id);
Note: The Id
argument is optional, and can be omitted, or set to null
or undefined
.