login api issue
Rocket.Chat Version: 0.50.1
Hi, When i am hitting https://www.example.com/api/v1/login -d username=xxxx&password=xxx getting error "There is no route for the path" and not able to login rocket chat. OR When try to use curl.... getting no response . //login function function talklogin($fuser, $pass) { $service_url = 'https://xxx-xxxx-xxx/api/v1/login'; $curl = curl_init($service_url); $curl_post_data = array( "password" => $pass, "username" => $fuser, ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($curl_post_data)); $curl_response = curl_exec($curl); curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); print_r(json_decode($curl_response)); }
What am I doing wrong? Thanks in advance for any insight.
Make sure you're actually using the POST method and then change username to user.
Its working now. Thank you very much for your quick response :)
@neha1deshmukh could you please close the issue yourself if this is solved? :+1:
cant able to login using curl , I have written above script in external site and then after running this script, when I checked Rocket chat its still showing login form. script successfully returns token.