Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create group error 500 #176

Open
Mutronics opened this issue Mar 29, 2023 · 6 comments
Open

Create group error 500 #176

Mutronics opened this issue Mar 29, 2023 · 6 comments

Comments

@Mutronics
Copy link

Mutronics commented Mar 29, 2023

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

@Fishbowler
Copy link
Member

The list of members and admins needs to be provided

@Mutronics Mutronics changed the title Add group error 500 Create group error 500 Mar 29, 2023
@Fishbowler
Copy link
Member

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"

@Mutronics
Copy link
Author

Mutronics commented Mar 30, 2023

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"
}

@Fishbowler
Copy link
Member

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.

@Mutronics
Copy link
Author

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
Copy link
Author

Mutronics commented Mar 30, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants