Openfire REST API - Create Service

Does the API have the ability to add a Service?

In Group Chat there is a dropdown listing all the Services.

conference being the default.

Group Chat

Group Chat Settings

Service Summary

Create New Service

You can create a Service here and it is passed as a Query string parameter in a lot of the APIs.

Example

Retrieve all chat rooms

GET /chatrooms

Parameter
Parameter Type
Description
Default value
servicename
@QueryParam
The name of the Group Chat Service
conference

http://127.0.0.1:9090/plugin-admin.jsp?plugin=restapi&showReadme=true&decorator= none#retrieve-all-chat-rooms

Docos

http://127.0.0.1:9090/plugin-admin.jsp?plugin=restapi&showReadme=true&decorator= none

http://127.0.0.1:9090/plugin-admin.jsp?plugin=restapi&showChangelog=true&decorat or=none

Hi;

If I recall correctly, you can create a room using a new service, and it will create the service automatically. I may be wrong though, but if it can save you time, it’s worth a try.

1 Like

Indeed it does, just tested, thanks for this.

http://localhost:9090/plugins/restapi/v1/chatrooms?servicename=newservice

Content-Type: application/json

{

“roomName”: “global”,

“naturalName”: “global-2”,

“description”: “Global chat room”

}

I’d noticed other APIs tried to create a user/group if it didn’t exist too.