Closed SibeeshVenu closed 5 years ago
@SibeeshVenu as you can see in the changelog, this endpoint has been added only in 1.0.0. Your server version is 0.74.2, you are getting this error because this endpoint does not exist in your server.
@MarcosSpessatto Thanks a lot for the response. Updating to the newest version fixed my issue.
I would like this issue re-opened as I am having the exact same issue.
My RocketChat server version is 1.1.0
After a successful login with a user that has start-discussion permissions and then calling POST on /api/v1/rooms.createDiscussion with the correct X-Auth-Token and X-User-Id as returned from the login, the response returns a HUGE amount of HTML code and NOT a discussion object as defined above in SibeeshVenu post or on the Rocket.Chat REST page https://rocket.chat/docs/developer-guides/rest-api/rooms/creatediscussion/
Regards
Steve
Description:
I am trying to create a room from my Angular application using
HttpClient
by following this post but I am always getting an error as below.ERROR Error: Uncaught (in promise): HttpErrorResponse: {"headers":{"normalizedNames":{},"lazyUpdate":null},"status":200,"statusText":"OK","url":"myurl/rocketchat/api/v1/rooms.createDiscussion","ok":false,"name":"HttpErrorResponse","message":"Http failure during parsing for myrul/rocketchat/api/v1/rooms.createDiscussion","error":{"error":{},"text":"
I am able to use the login API, and I am getting a correct response.
Steps to reproduce:
curl -H "X-Auth-Token: token" -H "X-User-Id: userid" -H "Content-Type: application/json" myurl/rocketchat/api/v1/rooms.createDiscussion -d '{ "prid": "GENERAL", "t_name": "Discussion Name"}'
But getting an HTML response instead of an actual JSON response.
Expected behavior:
Should return a response as below.
Actual behavior:
The API returns an Invalid HTML response.
Server Setup Information:
Please let me know how can I fix this. Thanks in advance.