question

paul-tracy2971 avatar image
paul-tracy2971 asked Anirban Sen Chowdhary edited

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

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\token 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"

}

]

}

api
1 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

paul-tracy2971 avatar image
paul-tracy2971 answered

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

1 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered Anirban Sen Chowdhary edited

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

1 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.