Chat Room in XMPP
Hello friends, I am creating a chat room with the XMPP + RestAPI, with the help of POST API with the parameters.
URL:
Type:
Post
Parameters:
{
"roomName": "1234567803",
"naturalName": "Birthday",
"description": "Description”,
"subject": "Subject",
"maxUsers": "20",
"persistent": "true",
"publicRoom": "true",
"registrationEnabled": "false",
"canAnyoneDiscoverJID": "true",
"membersOnly": "true",
"owners": [
"mark123@serverendpoint”
],
"members": [“james@serverendpoint", "mark@serverendpoint"]
}
Here I am successfully able to create chat room. Also when I fetch the room details using the GET API
URL:
Type:
Get
Response:
{
"roomName": "newuser1615449654",
"naturalName": "Birthday",
"description": "Description",
"subject": "Subject",
"creationDate": "2021-03-11T08:02:59.404Z",
"modificationDate": "2021-03-16T12:22:15.094Z",
"maxUsers": "20",
"persistent": "true",
"publicRoom": "true",
"registrationEnabled": "false",
"canAnyoneDiscoverJID": "true",
"canOccupantsChangeSubject": "false",
"canOccupantsInvite": "false",
"canChangeNickname": "false",
"logEnabled": "false",
"loginRestrictedToNickname": "false",
"membersOnly": "true",
"moderated": "false",
"broadcastPresenceRoles": [],
"owners": {
"owner": "mark123@serverendpoint”
},
"admins": [],
"members": [“james@serverendpoint", "mark@serverendpoint"],
"outcasts": [],
"ownerGroups": [],
"adminGroups": [],
"memberGroups": [],
"outcastGroups": []
}
When I try to send a message to a group using the room.sendMessage(withBody: “Hello”) I am getting an error message like you are not in the room.
Can anyone help me out with this?