Table of Contents
/Xmpp/SetRosterItem
Sets information about a specific roster item for the account.
JSON
- Request
- { "bareJid":Required(Str(PBareJid)), "name": Required(Str(PName)), "Groups": Optional(Str(PGroups)[]) }
- Response (if successful)
- { "bareJid": Required(Str(PBareJid)), "pendingSubscription": Required(Bool(PPendingSubscription)), "status": Required(Str(PStatus)), "name": Required(Str(PName)), "Groups": Optional(Str(PGroups)[]) }
XML
- Request
- <SetRosterItem xmlns="https://waher.se/Schema/BrokerAgent.xsd" bareJid=(Required(Str(PBareJid))) name=(Required(Str(PName)))> <Groups> <[<Item><[Optional(Str(PGroups))]></Item>?[]]> </Groups> </SetRosterItem>
- Response (if successful)
- <RosterItem xmlns="https://waher.se/Schema/BrokerAgent.xsd" bareJid=(Required(Str(PBareJid))) pendingSubscription=(Required(Bool(PPendingSubscription))) status=(Required(Str(PStatus))) name=(Required(Str(PName)))> <Groups> <[<Item><[Optional(Str(PGroups))]></Item>?[]]> </Groups> </RosterItem>
Input Parameters
| Parameter | Description | 
|---|---|
| PBareJid | Bare JID of roster item. | 
| PName | Name to assign to the roster item. | 
| PGroups | Groups to assign to the roster item. | 
Response Parameters
| Parameter | Description | 
|---|---|
| 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.SetRosterItem(BareJid,Name,Groups);