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

works on swagger but not in post man,thunder client or even curl

Open david-macharia opened this issue 2 years ago • 1 comments

curl -v -X POST 'http://localhost:9090/plugins/restapi/v1/users' -H 'accept: /' -H 'Authorization: 19YHTG87K2M5kIf8' -H 'Content-Type: application/json' -d '{ "username": "uniqueid", "name": "David ", "email": "[email protected]", "password": "string", "properties": [ { "key": "string", "value": "string" } ] }' Note: Unnecessary use of -X or --request, POST is already inferred.

  • Trying 127.0.0.1:9090...
  • TCP_NODELAY set
  • Connected to localhost (127.0.0.1) port 9090 (#0)

POST /plugins/restapi/v1/users HTTP/1.1 Host: localhost:9090 User-Agent: curl/7.68.0 accept: / Authorization: 19YHTG87K2M5kIf8 Content-Type: application/json Content-Length: 231

  • upload completely sent off: 231 out of 231 bytes
  • Mark bundle as not supporting multiuse < HTTP/1.1 302 Found < Date: Mon, 16 Oct 2023 03:42:41 GMT < X-Frame-Options: SAMEORIGIN < Set-Cookie: JSESSIONID=node0191ae6lvk6mr01twhxocwmsi472.node0; Path=/; HttpOnly < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Location: http://localhost:9090/login.jsp?url=%2Fplugins%2Frestapi%2Fv1%2Fusers < Content-Length: 0 <
  • Connection #0 to host localhost left intact

david-macharia avatar Oct 16 '23 03:10 david-macharia

Take a look at the 'important step' in the Installation section of the readme. I'd send a link, except I'm on mobile. There's a security feature you need to tweak to open the Rest API to network traffic.

Fishbowler avatar Oct 16 '23 06:10 Fishbowler