Question

Invalid Account error using API request (error code = PIC-018)

  • 16 July 2020
  • 2 replies
  • 1222 views

I just got my app promoted to production and was testing api calls. For the below request I am getting back the error "Invalid Account". I am taking "owner_id" from the oauth oken results (Just like i did in the sandbox environment which worked) and supplying that as the accountID. Why does this work in the sandbox and not prodution


API Request:

https://platform.ringcentral.com/restapi/v1.0/account/<accountId goes here>/message-store-report


Result:

{

"errors": [

{

"errorCode": "PIC-018",

"message": "Invalid account"

}

]

}


2 replies

Never mind.... I used the ~ in place of the accountid and it is working...

You can use the following to get Account ID:

https://platform.ringcentral.com/restapi/v1.0/account/~

Or

https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~

You will get a response where there will be the full uri you requested which includes account id and extension id

example:

https://platform.ringcentral.com/restapi/v1.0/account/123456780/extension/123456

Remember to use production url

Reply