powered by Jive Software

Openfire restApi can not add user

I want to use RestApi to add a new user from php by this way:

file_get_contents(“http://myip:9090/plugins/restapi/userservice?type=add&secret=mysecretkey&usernam e=kafka&password=drowssap&name=franz&email=franz@kafka.comsecretkey&username=kafka&password=drowssap&name=franz&email=franz@kafka.com”);

But it does not add a user, and does not return anything even error.

Even when I type the url in browser it just shows a blank window.

In openfire I chose:

But still no result.

So what can cause the problem?

I would recommend you at first to use not the deprecated version of user service in REST API Plugin.

Here is a example how to create a new user: REST API Plugin Readme

Regarding your request call, it seems to be that you send an unavailable “secretkey” query parameter, two times the username, password, name and email.

I have installed Rest API plugin. Get User API is working properly but when i tried to create/add new user or put/update current user info, the server response me with 415 Unsupported Media Types.

i have tried to add header parameters such as Content-type : application/json as well as tried the accept : application/json.

But still getting the same error as response. I have tried with the xml.

Please let me know, if there any extra settings required for the REST API or not.

Can you please post here your full request