I don't understand your definition and your expectation from 'one-click' calls. Did you mean 'click-to-dial' or 'click-to-call'?
The RC embeddable allows you to integrate the "RC phone app" into your Web app/page so you can login and make or receive calls, send SMS, Fax with just a few lines of code. If you want to customize the widget, you have to clone the project and customize the code and host the app on your own server. The instructions are detailed in the github page.
As for the call log, only RingCentral customers can access their own call logs. If you are an ISV who provides the service to multiple RingCentral customers, you can create a public app and allow your customers (who are also RingCentral customers) to login your app with their own login credentials, then you can use that user's access token to access their call log. However, if you need to read any user's call log in a RingCentral account, the authenticated user must be a super admin user (or a custom role which includes the company call log user permission).
Read this blog to learn more about RingCentral call log.
I don't understand also what you expect from using a webhook. So please clarify.
@Phong Vu
Thank you for responding, sorry for responding late I thought I'd get email notifications.
First let me clarify a few things I probably have been too vague, the scope is calls between one account and the people that call this one account only, we don't provide a service to multiple ringcentral customers.
On our website there is an admin account and the people who sign up are called clients.
We have a list of personal numbers of clients (their real phone numbers not ringcentral ones), we show the list of phone numbers to admin so he can call them without using ringcentral for now, but now we want to make the phone calls online so it becomes easier for the admin to contact any of the clients.
Also we show each client the admin's number (which is only one number for admin), they call the admin directly right now, but we want to make this online too.
So these are our intentions for the calls, please let us know if that is possible using RC Phone and embeddable widget.
And please give me a little more context wether the clients need ringcentral accounts as well to make the calls to the admin? Or the only thing that matters is that the admin has a ringcentral account?
--------------
As for the call logs, we only want the admin to see the logs of the client calls nothing more complicated than that, which we assume an api call will provide us the info? We would save that info in the database and that's why I was asking if this has a webhook available, but if there isn't one it's still okay.
And again please let me in order for these call logs to work, must customers call admin's ringcentral phone, with their own ringcentral numbers? or will it work if they use their regular (personal) numbers too?
Here is my suggestion for you using low code option.
For the admin to call his clients directly from the page, you need a "click-to-dial" feature. If the admin wants to make a call from within the admin web page, then you can embed the RingCentral embeddable widget. If the admin wants to make a call from the RC app then you don't really need the RC embeddable. Below are the solution for both use cases
- Using the embeddable:
Embed the RC embeddable to the page. And when creating the page, put the client phone number in an element and add the onclick attribute to call the makeCall() function passing the client phone number to the function.
<html>
<head>
...
<script>
function makeCall(phoneNumber)
document.querySelector("#rc-widget-adapter-frame").contentWindow.postMessage({
type: 'rc-adapter-new-call',
phoneNumber: phoneNumber,
toCall: true,
}, '*');
}
</script>
</head>
<body>
<script>
(function() {
var rcs = document.createElement("script");
rcs.src = "https://ringcentral.github.io/ringcentral-embeddable/adapter.js?defaultCallWith=browser";
var rcs0 = document.getElementsByTagName("script")[0];
rcs0.parentNode.insertBefore(rcs, rcs0);
})();
</script>
...
<div><b>Click to dial from Embeddable</b></div>
<ul>
<li><div onclick="makeCall('+12091234567')">Alice 12091234567</div></li>
<li><div onclick="makeCall('+14081234567')">Anne 14081234567</div></li>
</ul>
...
- Using the RC app:
And when creating the page, put the client phone number in an <a> element and add the href attribute to launch the RC app using the URL schemes below
<a target="_blank" href="rcapp://r/dialer?number=+12091234567">Dial Alice</a></br>
<a target="_blank" href="rcapp://r/call?number=+14081234567">Call Anne</a>
...
Try it and you will see the different between the /dialer? and /call? mode. The user experience with this option is not as great as the one with the the embeddable.
For the clients to call the admin, you can implement the ring-out feature in your backend engine. And on the frontend (the client web page), provide a button called e.g. "Call me" which would take the client phone number (you can set the client number by default and allow them to change their number). When the client click the button, get the client number and send to your backend, where you will use the RingCentral platform API to make a ring-out call. Example in Node JS.
async function call_ringout() {
try {
var resp = await platform.post('/restapi/v1.0/account/~/extension/~/ring-out', {
'from': { 'phoneNumber': CLIENT-PHONE-NUMBER },
'to': { 'phoneNumber': ADMIN-PHONE-NUMBER },
'playPrompt': false
})
var jsonObj = await resp.json()
console.log("Call placed. Call status: " + jsonObj.status.callStatus)
} catch (e) {
console.log(e.message)
}
}
Click here to learn more about /ring-out and see sample code in different programming languages.
Of course, you must construct a different page for client so they don't see the functions the admin can use to make call!
Your clients do not need to be a RingCentral customers. The /ring-out will make a call from their own phone (e.g if it's a mobile number, their cell phone will ring).
For call log, call the extension /call-log API to read call records of the admin.
@Phong Vu
Thank you so much for the detailed answer! Ring out sounds pretty cool it calls both admin and client from what I read in your answer and in the docs! I didn't even know that could be possible!
Thanks again you're the best I was lost in tons of documents, stuck trying to figure out what to do!