openfire-restAPI-plugin icon indicating copy to clipboard operation
openfire-restAPI-plugin copied to clipboard

Create group error 500

Open Mutronics opened this issue 2 years ago • 6 comments

Create group error 500

Openfire 4.7.4 REST API 1.10.1

curl -k -X POST -H "Authorization: mysecret" -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"name\": \"groupName\", \"description\": \"Description group\"}" https://mydomain.com:9091/plugins/restapi/v1/groups
{
"servlet":"PluginServlet",
"message":"Request failed.",
"url":"/plugins/restapi/v1/groups",
"status":"500"
}

other requestы work fine

Mutronics avatar Mar 29 '23 18:03 Mutronics

The list of members and admins needs to be provided

Fishbowler avatar Mar 29 '23 19:03 Fishbowler

I'd like to implement some proper validation rules over the body so that you can get informative messages back. This conforms to what the API knows (this is a group entity object) but isn't enough to actually create the group.

Something like this I expect: https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/bean-validation.html#bv.example.constraints.fields

Something like that would probably give useful responses rather than just this "I've gone wrong trying to use this"

Fishbowler avatar Mar 29 '23 20:03 Fishbowler

curl -k -X POST -H "Authorization: mysecret" -H "Accept: application/json" -H "Content-Type: application/json" -d "{"name": "groupName", "description": "Description group"}" https://mydomain.com:9091/plugins/restapi/v1/groups { "servlet":"PluginServlet", "message":"Request failed.", "url":"/plugins/restapi/v1/groups", "status":"500" }

Mutronics avatar Mar 30 '23 04:03 Mutronics

You appear to have posted the same curl. I'm gonna give the same answer.

The list of members and admins needs to be provided.

{"name": "groupName", "description": "Description group", "admins": ["admin1"], "members":["person1","person2"]}

Each of those needs to be a valid username or jid.

Fishbowler avatar Mar 30 '23 06:03 Fishbowler

You appear to have posted the same curl. I'm gonna give the same answer.

The list of members and admins needs to be provided.

{"name": "groupName", "description": "Description group", "admins": ["admin1"], "members":["person1","person2"]}

Each of those needs to be a valid username or jid.

Thanks, outdated plugin information https://www.igniterealtime.org/projects/openfire/plugins/1.10.1/restAPI/readme.html#create-a-group-endpoint-to-create-a-new-group

Mutronics avatar Mar 30 '23 09:03 Mutronics

Tell me please you can rename the group. Based on the API, it is possible to change admins, members and description, but not the group itself

Mutronics avatar Mar 30 '23 13:03 Mutronics