Hi I keep getting the following response:
Authorization: Basic ******************************Content-Type: application/x-www-form-urlencoded;charset=UTF-8Content-Length: 73* upload completely sent off: 73 out of 73 bytes< HTTP/1.1 400 Bad Request* Server nginx/1.10.2 is not blacklisted< Server: nginx/1.10.2< Date: Thu, 22 Jun 2017 10:24:57 GMT< Content-Type: application/json;charset=utf-8< Transfer-Encoding: chunked< Connection: keep-alive< X-Application-Context: application:8080< Content-Language: en< WWW-Authenticate: Bearer realm="RingCentral REST API", error="invalid_client", error_description="Invalid client: "< RCRequestId: 0a67f30c-5735-11e7-a00b-005056bb26b9< AceRoutingKey: sjc11-c01-ace01.c83d65c2-46d3-11e7-ab8e-005056a73f60< X-Server-Name: sjc06-c01-hlb01< X-Request-Time: 0.010< X-Upstream-Server: 10.24.22.193:8080< X-Upstream-Status: 400< X-Upstream-HTime: 0.010< X-Upstream-RTime: 1498127097.763< X-Upstream-CTime: 0.000< X-Tcpinfo: 1000, 500, 10, 28960< RoutingKey: SJC11P01
Here is the snippet I am using to try and authenticate...
$headers = array(); $headers[] = 'Authorization: Basic 7he87Tb1TjWiy6L7waiCwg'; $headers[] = 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8'; $curl_post_data = 'grant_type=password&username=[sandbox number]&extension=301&password=xxxxxx'; $service_url = 'https://platform.devtest.ringcentral.com/restapi/oauth/token'; $curl = curl_init($service_url); $fp = fopen('errorlog.txt', 'w'); curl_setopt($curl, CURLOPT_STDERR, $fp); curl_setopt($curl, CURLOPT_VERBOSE, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $resp = $curl_response; $obj = json_decode($resp, true);
Any ideas why I should be getting invalid client??
Thanks
James