News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
PHP cURL not getting a response...
Tags: oauth
Mar 23, 2016 at 5:44am   •   1 replies  •  0 likes
james.odonnell

Hi, I'm really having some trouble getting started with this api... I've written the following to get an auth token but I'm getting nothing back in response from the server at all, not even an error am I missing something?

<?php
      ini_set('display_errors', 'On');      error_reporting(E_ALL);        $headers = array();      $headers[] = 'Authorization: Basic TOKEN';      $headers[] = 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8';           $service_url = 'https://platform.ringcentral.com/restapi/oauth/token';         $curl = curl_init($service_url);         $curl_post_data = array(                    'grant_type'  => 'password',             'username'    => 'username',          'extension'   => 'ext',       'password'    => 'password',              );         curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);         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;            print_r($resp);     ?>


Thanks


James

1 Answer
answered on Mar 23, 2016 at 10:49am  
Have you tried using our PHP SDK? https://github.com/ringcentral/ringcentral-php 

 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us