Skip to main content
Question

"Insufficient Permissions" - SMS API

  • May 18, 2023
  • 4 replies
  • 250 views

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!

4 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • May 18, 2023

What is the sandbox phone number?


PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • May 18, 2023

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.


  • Author
  • New Participant
  • May 19, 2023

PHP Fatal error: Uncaught GuzzleHttpExceptionClientException: 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:XAMPPhtdocsRingCentralTestvendorguzzlehttpguzzlesrcExceptionRequestException.php:113

Stack trace:

#0 C:XAMPPhtdocsRingCentralTestvendorguzzlehttpguzzlesrcMiddleware.php(69): GuzzleHttpExceptionRequestException::create(Object(GuzzleHttpPsr7Request), Object(GuzzleHttpPsr7Response), NULL, Array, NULL)

#1 C:XAMPPhtdocsRingCentralTestvendorguzzlehttppromisessrcPromise.php(204): GuzzleHttpMiddleware::GuzzleHttp{closure}(Object(GuzzleHttpPsr7Response))

#2 C:XAMPPhtdocsRingCentralTestvendorguzzlehttppromisessrcPromise.php(153): GuzzleHttpPromisePromise::callHandler(1, Object(GuzzleHttpPsr7Response), NULL)

#3 C:XAMPPhtdocsRingCentralTestvendorguzzlehttppromisessrcTaskQueue.php(48): GuzzleHttpPromisePromise::GuzzleHttpPromise{closure}()

#4 C:XAMPPhtdocsRingCentralTestvendorguzzlehttppromisessrcPromise.php(248): GuzzleHttpPromiseTaskQueue->run(true)

#5 C:XAMPPhtdocsRingCentralTestvendorguzzlehttppromisessrcPromise.php(224): GuzzleHttpPromisePromise->invokeWaitFn()

#6 C:XAMPPhtdocsRingCentralTestvendorguzzlehttppromisessrcPromise.php(269): GuzzleHttpPromisePromise->waitIfPending()

#7 C:XAMPPhtdocsRingCentralTestvendorguzzlehttppromisessrcPromise.php(226): GuzzleHttpPromisePromise->invokeWaitList()

#8 C:XAMPPhtdocsRingCentralTestvendorguzzlehttppromisessrcPromise.php(62): GuzzleHttpPromisePromise->waitIfPending()

#9 C:XAMPPhtdocsRingCentralTestvendorguzzlehttpguzzlesrcClient.php(123): GuzzleHttpPromisePromise->wait()

#10 C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcHttpClient.php(74): GuzzleHttpClient->send(Object(GuzzleHttpPsr7Request), Array)

#11 C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcHttpClient.php(39): RingCentralSDKHttpClient->loadResponse(Object(GuzzleHttpPsr7Request))

#12 C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcPlatformPlatform.php(333): RingCentralSDKHttpClient->send(Object(GuzzleHttpPsr7Request))

#13 C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcPlatformPlatform.php(349): RingCentralSDKPlatformPlatform->sendRequest(Object(GuzzleHttpPsr7Request), Array)

#14 C:XAMPPhtdocsRingCentralTestsms.php(27): RingCentralSDKPlatformPlatform->get('/restapi/v1.0/a...')

#15 C:XAMPPhtdocsRingCentralTestsms.php(23): read_extension_phone_number()

#16 {main}


Next RingCentralSDKHttpApiException: 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:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcHttpClient.php:52

Stack trace:

#0 C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcPlatformPlatform.php(333): RingCentralSDKHttpClient->send(Object(GuzzleHttpPsr7Request))

#1 C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcPlatformPlatform.php(349): RingCentralSDKPlatformPlatform->sendRequest(Object(GuzzleHttpPsr7Request), Array)

#2 C:XAMPPhtdocsRingCentralTestsms.php(27): RingCentralSDKPlatformPlatform->get('/restapi/v1.0/a...')

#3 C:XAMPPhtdocsRingCentralTestsms.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:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcHttpClient.php:52

Stack trace:

#0 C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcPlatformPlatform.php(333): RingCentralSDKHttpClient->send(Object(GuzzleHttpPsr7Request))

#1 C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcPlatformPlatform.php(349): RingCentralSDKPlatformPlatform->sendRequest(Object(GuzzleHttpPsr7Request), Array)

#2 C:XAMPPhtdocsRingCentralTestsms.php(27): RingCentralSDKPlatformPlatform->get('/restapi/v1.0/a...')

#3 C:XAMPPhtdocsRingCentralTestsms.php(23): read_extension_phone_number()

#4 {main}

thrown in C:XAMPPhtdocsRingCentralTestvendor ingcentral ingcentral-phpsrcHttpClient.php on line 52


PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • May 19, 2023

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.