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
method not allowed
Tags: getting started
Oct 6, 2015 at 3:32pm   •   2 replies  •  0 likes
justin-nahin

I am getting this error of "Method Not Allowed" when trying to retrieve the call logs through PHP.


RingCentral API Error -> Method Not Allowed

Any Ideas?


$call_log_url = '/account/~/extension/~/call-log';

$ref = &$this->connection->platform;


try {

    $apiResponse = $ref->post($call_log_url);
    // dd($apiResponse);
}
catch (\RingCentral\SDK\Http\ApiException $e) {
  
    echo 'RingCentral API Error -> <b>' . $e->getMessage() . '</b>';
}      
2 Answers
answered on Jun 22, 2019 at 11:32pm  

This is a general kind of mistake every developers does now and then. It we hit an API with wrong method type eg hit GET method in API where the API expect POST and vice versa, this Method Not Allowed occurs.

Reading the full documentation is required in this case


 0
answered on Oct 6, 2015 at 4:06pm  
Hi Justin,

You should be using a GET request instead of a POST request in order to retrieve call logs through the API.

Please have a look at the code below :

try {
    
$apiResponse = $platform->get('/account/~/extension/~/call-log', array(
'perPage' => 10
));
print 'Retreieved Call logs' . $apiResponse->json()->uri . PHP_EOL;
} catch (\RingCentral\SDK\Http\ApiExceptionHttpException $e) {
    echo 'RingCentral API Error -> <b>' . $e->getMessage() . '</b>';
}


 1



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