News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Accessing to the name who received an inbound call in Call Log API.
Tags: rest api
Jul 18, 2023 at 9:50am   •   3 replies  •  0 likes
Santiago Castaneda

Hi, i need to get access to the information of the inbound call receiver. In the API response we just get the phonenumber. With this i cannot join it with my main table because of the duplicates (One phone number used by more than 2 people). So how may i get acceess to it ? Should i use the LEG attribute in the Detailed API and get it from there ?

Help please. Thanks


3 Answers
answered on Jul 18, 2023 at 12:44pm  

.


 0
answered on Jul 18, 2023 at 10:52am  

For Inbound call i'm not receiving that exntension obtject. When i try to access to that atribute, i get a traceback errror. This object doesn't appear neither in the main object or when i acces to the "TO" object or the "LEG" object. It just appear when it's a internal company call or Outbound, but we do really need it from all directions. Any suggestion ?

note: in the image below, the extensio attribute doesn't show up.

Thank for your help. Please

1689702711146.png


 0
on Jul 18, 2023 at 10:56am   •  0 likes

Can you share the response in JSON string or expanded all the JSON objects. Remember to mask or erase sensitive info such as real phone number, name etc.

on Jul 18, 2023 at 11:10am   •  0 likes
This is the main JSON. No extension object
{
    "uri": "https://platform.ringcentral.com/restapi/v1.0/account/283132030/call-log/GyoPNHUzA3gvTUA?view=Detailed",
    "id": "GyoPNHUzA3gvTUA",
    "sessionId": "328396170030",
    "startTime": "2023-07-18T16:16:34.323Z",
    "duration": 79,
    "durationMs": 79101,
    "type": "Voice",
    "internalType": "LocalNumber",
    "direction": "Inbound",
    "action": "Phone Call",
    "result": "Accepted",
    "to": "<ringcentral.http.json_object.JsonObject object at 0x000002BE1B37BB10>",
    "from_": "<ringcentral.http.json_object.JsonObject object at 0x000002BE1B37BB90>",
    "recording": "<ringcentral.http.json_object.JsonObject object at 0x000002BE1B37BC10>",
    "reason": "Accepted",
    "reasonDescription": "The call connected to and was accepted by this number.",
    "telephonySessionId": "s-a71803217f49ez18969ca0403z3600cf0000",
    "partyId": "p-a71803217f49ez18969ca0403z3600cf0000-1",
    "transport": "PSTN",
    "lastModifiedTime": "2023-07-18T16:18:22.365Z",
    "billing": "<ringcentral.http.json_object.JsonObject object at 0x000002BE1B37BC90">,
    "legs": [
        "<ringcentral.http.json_object.JsonObject object at 0x000002BE1B37BD50>, <ringcentral.http.json_object.JsonObject object at 0x000002BE1B37BFD0>",
        "<ringcentral.http.json_object.JsonObject object at 0x000002BE1B384290>",
        "<ringcentral.http.json_object.JsonObject object at 0x000002BE1B384490>",
        "<ringcentral.http.json_object.JsonObject object at 0x000002BE1B384690>, <ringcentral.http.json_object.JsonObject object at 0x000002BE1B3848D0>"]
    }



on Jul 18, 2023 at 2:49pm   •  0 likes

It's still the object address, not the JSON content.

<ringcentral.http.json_object.JsonObject object at 0x000002BE1B37BB10>

In Python, you can import the json lib and dumps the dictionary like this. I assumed that you are using the RingCentral Python SDK.

resp = platform.get("...", queryParams)
jsonObj = resp.json_dict()
print(json.dumps(jsonObj, indent=2, sort_keys=True))
on Jul 18, 2023 at 11:12am   •  0 likes
And when i access to the TO object there. I just get the phone number, neither the name, or extension

{'phoneNumber': '+178....7'}
answered on Jul 18, 2023 at 10:23am  

From the call log result, look for the extension object in the main call record (or the master leg), use the extension id to read the extension info and you can find the extension name and other info. If this process is needed repeatedly or for multiple users, you can read all extensions info and keep them in an array with just the id and the metadata you need. Then you can quickly access the data without the need to call the extension API every time you parse the call log.


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us