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
"Insufficient Permissions" - SMS API
Tags: sending sms
May 17, 2023 at 6:59pm   •   3 replies  •  0 likes
Jose Malaga

Hi @Phong Vu ,

You've helped me before. I think I'm having the same issue with not having permissions for SMS API. Can you please help me activate the sandbox number?

Thank you!

on May 18, 2023 at 7:10am   •  0 likes

What is the sandbox phone number?

on May 18, 2023 at 3:29pm   •  0 likes

sorry here it is +14242994218
Thank you

2 Answers
answered on May 19, 2023 at 7:49am  

Your last reply includes a long unclean response and the service blocked it. But I had a look at the first line as saw that it failed at the code where you called the /phone-number endpoint to check the user's phone number and the number feature. This API require the "ReadAccounts" app scope and it is missing from your app settings.

Login the RingCentral developer portal, open your app settings and add the missing app scope and test again.


 0
answered on May 18, 2023 at 6:03pm  

PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/phone-number` resulted in a `403 Forbidden` response:

{

"errorCode" : "InsufficientPermissions",

"message" : "In order to call this API endpoint, application needs to hav (truncated...)

in C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113

Stack trace:

#0 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\guzzle\src\Middleware.php(69): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL)

#1 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\promises\src\Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))

#2 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\promises\src\Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)

#3 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\promises\src\TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()

#4 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\promises\src\Promise.php(248): GuzzleHttp\Promise\TaskQueue->run(true)

#5 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\promises\src\Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()

#6 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\promises\src\Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()

#7 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\promises\src\Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()

#8 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\promises\src\Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()

#9 C:\XAMPP\htdocs\RingCentralTest\vendor\guzzlehttp\guzzle\src\Client.php(123): GuzzleHttp\Promise\Promise->wait()

#10 C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Http\Client.php(74): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request), Array)

#11 C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Http\Client.php(39): RingCentral\SDK\Http\Client->loadResponse(Object(GuzzleHttp\Psr7\Request))

#12 C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Platform\Platform.php(333): RingCentral\SDK\Http\Client->send(Object(GuzzleHttp\Psr7\Request))

#13 C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Platform\Platform.php(349): RingCentral\SDK\Platform\Platform->sendRequest(Object(GuzzleHttp\Psr7\Request), Array)

#14 C:\XAMPP\htdocs\RingCentralTest\sms.php(27): RingCentral\SDK\Platform\Platform->get('/restapi/v1.0/a...')

#15 C:\XAMPP\htdocs\RingCentralTest\sms.php(23): read_extension_phone_number()

#16 {main}


Next RingCentral\SDK\Http\ApiException: Client error: `GET https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/phone-number` resulted in a `403 Forbidden` response:

{

"errorCode" : "InsufficientPermissions",

"message" : "In order to call this API endpoint, application needs to hav (truncated...)

in C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Http\Client.php:52

Stack trace:

#0 C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Platform\Platform.php(333): RingCentral\SDK\Http\Client->send(Object(GuzzleHttp\Psr7\Request))

#1 C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Platform\Platform.php(349): RingCentral\SDK\Platform\Platform->sendRequest(Object(GuzzleHttp\Psr7\Request), Array)

#2 C:\XAMPP\htdocs\RingCentralTest\sms.php(27): RingCentral\SDK\Platform\Platform->get('/restapi/v1.0/a...')

#3 C:\XAMPP\htdocs\RingCentralTest\sms.php(23): read_extension_phone_number()

#4 {main}

{

"errorCode" : "InsufficientPermissions",

"message" : "In order to call this API endpoint, application needs to hav (truncated...)

in C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Http\Client.php:52

Stack trace:

#0 C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Platform\Platform.php(333): RingCentral\SDK\Http\Client->send(Object(GuzzleHttp\Psr7\Request))

#1 C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Platform\Platform.php(349): RingCentral\SDK\Platform\Platform->sendRequest(Object(GuzzleHttp\Psr7\Request), Array)

#2 C:\XAMPP\htdocs\RingCentralTest\sms.php(27): RingCentral\SDK\Platform\Platform->get('/restapi/v1.0/a...')

#3 C:\XAMPP\htdocs\RingCentralTest\sms.php(23): read_extension_phone_number()

#4 {main}

thrown in C:\XAMPP\htdocs\RingCentralTest\vendor\ringcentral\ringcentral-php\src\Http\Client.php on line 52


 0
answered on May 18, 2023 at 4:33pm  

Nothing is wrong with your phone number. I see you have 2 apps in sandbox environment. Both apps have the RingOut and SMS app scope and you should be able to call SMS API.

Show me the code how you call the API and the entire error. Make sure that you login your app with the user in your sandbox account.


 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