question

justin-nahin111 avatar image
justin-nahin111 asked ·

Call Logs for Individual Accounts

I want to retrieve call logs for individual accounts.  Currently logging into the API with the master credentials.  I should just be able to pass the extension number before the request to gather data for that individual ONLY, but it's not working for me.

Account ID: 18002769107
Extension ID: 12
Call Log URL: /account/18002769107/extension/12/call-log?view=Simple

RingCentral API Error -> Resource for parameter [accountId] is not found
topic-default
1 |1000 characters needed characters left characters exceeded

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

benjamin-dean avatar image
benjamin-dean answered ·
Hello Justin, there are a couple of things which need adjusting to get your Call Log request to respond as expected...
  1. Using the phone number as the account identifier in the path of your request's URL.

  2. 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.
Share
1 |1000 characters needed characters left characters exceeded

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

benjamin-dean avatar image
benjamin-dean answered ·
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.
Share
1 |1000 characters needed characters left characters exceeded

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

benjamin-dean avatar image
benjamin-dean answered ·
Did modifying your code to use the IDs rather than values for account and extension resolve the issue for you Justin?
Share
1 |1000 characters needed characters left characters exceeded

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.