Hello Justin, there are a couple of things which need adjusting to get your Call Log request to respond as expected...
- Using the phone number as the account identifier in the path of your request's URL.
- Using the extension number instead of the extension ID in the path of your request's URL.
Here is the correct URL to be used in a GET request to retrieve the Call Log data for a particular extension in a RingCentral account:
/restapi/v1.0/account/<ACCOUNT_ID>/extension/<EXTENSION_ID>/call-log?view=Simple
Once you have a valid access token from the RingCentral API Authentication resource, you can use it to get the appropriate pieces of information you'll need to update which are causing you issues:
Account ID can be obtained by executing a GET to the Account resource of the RingCentral API (notice that I'm using the tilda character which will request the currently authenticated account):
/restapi/v1.0/account/~/
The response from the RingCentral API will contain JSON data which describes the account. It contains the account ID value you'll need to use for any explicit account requests.
{ "uri" : "<URI_TO_GET_ACCOUNT_DATA>",
"id" : 123456789, // THIS IS THE ACCOUNT_ID YOU NEED
"serviceInfo" : {},
"operator" : {},
"mainNumber" : "5555555555", // THIS IS THE PHONE NUMBER, NOT THE ACCOUNT ID
"status" : "Confirmed",
"signupInfo" : { },
"setupWizardState" : "Completed"
}
Extension ID can be obtained by executing a GET request to the Account & Extension Info resource:
Get the list of all extensions for the currently authenticated account (implied account by using tilda in place of <ACCOUNT_ID>)
/restapi/v1.0/account/~/extension/
The response from the RingCentral API will contain JSON data with the list of extensions as objects within the records array. You'll want to use the "id" value for the extension from which you're retrieving the call data respectively.
{
"records" : [ {
"uri" : <URI_TO_GET_INDIVIDUAL_EXTENSION_DATA>;,
"id" : 987654321, // THIS IS THE EXTENSION_ID YOU WANT TO USE
"extensionNumber" : "102",
"contact" : {
"firstName" : "Dummy",
"lastName" : "User",
"email" : "<EMAIL_ADDRESS>"
} ],
"paging" : {
"page" : 1,
"totalPages" : 1,
"perPage" : 100,
"totalElements" : 1,
"pageStart" : 0,
"pageEnd" : 1
}
}
If you need the call logs for the logged in account user's extension, you can also use this URL as a short cut:
/restapi/v1.0/account/~/extension/~/call-log?view=Simple
Please do not hesitate to let me know if you have any questions, need further help, or if this resolves your issue receiving call data for a specific account's particular extension.
Additionally, you can also use the RingCentral API Explorer (currently in beta):
http://ringcentral.github.io/api-explorer/This tool provides you an easy way to enter your authentication credentials, obtain a valid access token, and then make requests to the various resources exposed in the RingCentral API quickly. It is really handy for debugging issues with API requests.
Did modifying your code to use the IDs rather than values for account and extension resolve the issue for you Justin?