we have created an application which sends SMS to customer through Rest API (curl) hit.
SMS is Sending Successfully, but the issue is, when any customer reply against any (or specific) Message.
we are not identify the reply of Message.
can we use any event or webhooks? for reply of message, which we have sent to customers and we want to store that reply against
specific message. how we can do this in PHP.
if any body have done such type of work, pleas share your response on it. we don't want to use Message store method or with message Id.
Thanks
SMS is Sending Successfully, but the issue is, when any customer reply against any (or specific) Message.
we are not identify the reply of Message.
can we use any event or webhooks? for reply of message, which we have sent to customers and we want to store that reply against
specific message. how we can do this in PHP.
if any body have done such type of work, pleas share your response on it. we don't want to use Message store method or with message Id.
Thanks
-
120 Points
Posted 1 year ago
John Wang, Official Rep
-
5,786 Points
The RingCentral API supports both webhooks (server-side) and pub/sub (client-side) subscriptions. To retrieve SMS message content, you can create a subscription with the SMS Instant Message Event event filter.
The filter has the following format:
The Developer Guide has general information on webhooks (and pub/sub):
http://ringcentral-api-docs.readthedocs.io/en/latest/webhooks/
Some PHP example code for setting up a webhook is available here:
https://github.com/anilkumarbp/ringcentral-demos-webhooks/tree/master/php
A JavaScript example app is also available:
https://github.com/ringcentral-tutorials/webhook-basics-nodejs-demo
More information on this is available on the SMS Instant Message Event filter here:
https://developer.ringcentral.com/api-docs/latest/index.html#!#RefGetInstantMessageEvent
The filter has the following format:
/restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store/instant?type=SMS
The Developer Guide has general information on webhooks (and pub/sub):
http://ringcentral-api-docs.readthedocs.io/en/latest/webhooks/
Some PHP example code for setting up a webhook is available here:
https://github.com/anilkumarbp/ringcentral-demos-webhooks/tree/master/php
A JavaScript example app is also available:
https://github.com/ringcentral-tutorials/webhook-basics-nodejs-demo
More information on this is available on the SMS Instant Message Event filter here:
https://developer.ringcentral.com/api-docs/latest/index.html#!#RefGetInstantMessageEvent
-
120 Points
Hi
Thanks for response, i am using below link.
https://github.com/grokify/ringcentral-sdk-php-lite
and how i can use webhooks (server-side) and pub/sub (client-side) subscriptions or set event in such type of code, which contains the link (file sms.php or in
ringcentral-sdk-php-lite/src/ringcentrallite.php).
Thanks for response, i am using below link.
https://github.com/grokify/ringcentral-sdk-php-lite
and how i can use webhooks (server-side) and pub/sub (client-side) subscriptions or set event in such type of code, which contains the link (file sms.php or in
ringcentral-sdk-php-lite/src/ringcentrallite.php).
John Wang, Official Rep
-
5,786 Points
Using the lite SDK is straight-forward for webhooks and a small demo app can be provided.
However, it does not have a pub/sub client to manage the connection so if you want to use that approach, it would be easier to use the official PHP SDK:
https://github.com/ringcentral/ringcentral-php
We have both webhook and pub/sub examples using the official PHP SDK.
Is there any reason you chose to use the lite SDK over the official one?
However, it does not have a pub/sub client to manage the connection so if you want to use that approach, it would be easier to use the official PHP SDK:
https://github.com/ringcentral/ringcentral-php
We have both webhook and pub/sub examples using the official PHP SDK.
Is there any reason you chose to use the lite SDK over the official one?
(Edited)
-
120 Points
I have a custom application for send sms to client, SMS send from different interfaces. i get message string, to number and send it to client through this code Lite SDK.
this is a centralized file behave like as a web service. due to this it was suitable for me.
for this link https://github.com/ringcentral/ringcentral-php it requires PHP 5.5+ version, we are using 5.6.23 when i Install composer
" Problem 1
- phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.23) does not satisfy that requirement.
- phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.23) does not satisfy that requirement.
- Installation request for phpunit/php-token-stream (locked at 2.0.1) -> satisfiable by phpunit/php-token-stream[2.0.1].
"
this is the reason to use the lite SDK over the official one. it fulfill the requirements for sending sms but not for reply from clients response.
if any client reply against any message we want to store that reply in our DB because further action will be triggered.
please tell me any solution for PHP Version 5.6.23, if i use this link https://github.com/ringcentral/ringcentral-php and leave lite SDK. we can't update php version at now.
this is a centralized file behave like as a web service. due to this it was suitable for me.
for this link https://github.com/ringcentral/ringcentral-php it requires PHP 5.5+ version, we are using 5.6.23 when i Install composer
$ curl -sS https://getcomposer.org/installerit gives error
" Problem 1
- phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.23) does not satisfy that requirement.
- phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.23) does not satisfy that requirement.
- Installation request for phpunit/php-token-stream (locked at 2.0.1) -> satisfiable by phpunit/php-token-stream[2.0.1].
"
this is the reason to use the lite SDK over the official one. it fulfill the requirements for sending sms but not for reply from clients response.
if any client reply against any message we want to store that reply in our DB because further action will be triggered.
please tell me any solution for PHP Version 5.6.23, if i use this link https://github.com/ringcentral/ringcentral-php and leave lite SDK. we can't update php version at now.
(Edited)
-
120 Points
if i use this one
$ composer require ringcentral/php-sdk
get same response Problem 1
- phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.23) does not satisfy that requirement.
- phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.23) does not satisfy that requirement.
- Installation request for phpunit/php-token-stream (locked at 2.0.1) -> satisfiable by phpunit/php-token-stream[2.0.1]
$ composer require ringcentral/php-sdk
get same response Problem 1
- phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.23) does not satisfy that requirement.
- phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.23) does not satisfy that requirement.
- Installation request for phpunit/php-token-stream (locked at 2.0.1) -> satisfiable by phpunit/php-token-stream[2.0.1]
John Wang, Official Rep
-
5,786 Points
Thanks. That's good info.
I've created a GitHub issue here:
https://github.com/ringcentral/ringcentral-php/issues/61
If this remains an issue with PHP 5.6.23, I can create a demo webhook app using the Lite PHP SDK.
We have webhook examples in JS and Go that can be used as a reference.
I've created a GitHub issue here:
https://github.com/ringcentral/ringcentral-php/issues/61
If this remains an issue with PHP 5.6.23, I can create a demo webhook app using the Lite PHP SDK.
We have webhook examples in JS and Go that can be used as a reference.
-
120 Points
We are stuck on it. i have deleted old app and create a new one, also set webhook url, in my last app there were not permission set (readMessage,webhooksubscription) but in current these permission sets are exists.
also when i run demo/subscription.php it gives me "Hosting Server Read Timeout" and link stop working, but sms.php,authData.php working well. When i check in api-explorer i get this response
https://platform.ringcentral.com/restapi/v1.0/subscription
"records": [
{
"uri": "https://platform.ringcentral.com/restapi/v1.0/subscription/bb50584d-b22f-43e2-9bd7-b29f7eed2f47";,
"id": "bb50584d-b22f-43e2-9bd7-b29f7eed2f47",
"creationTime": "2018-02-02T10:25:36.037Z",
"status": "Active",
"eventFilters": [
"/restapi/v1.0/account/304393018/extension/1446699019/message-store"
],
"expirationTime": "2018-02-02T10:40:36.037Z",
"expiresIn": 363,
"deliveryMode": {
"transportType": "PubNub",
"encryption": false,
"address": "268263456096097_0688d736",
"subscriberKey": "sub-c-b8b9cd8c-e906-11e2-b383-02ee2ddab7fe"
}
}
]
}
Now confusion is, SMS is sending well but when any to number reply against message we are unable to get any trigger or webhook url. this url was verified when app deploy for production. in this url that is "https:// "my server name" .com/ringcentral/webhook.php"
$callbackBody = file_get_contents('php://input');
$txt = "Server Hit from webhook call";
$fp = fopen('webhook.txt', 'w');
fwrite($fp, $txt);
fclose($fp);
$callbackSignature = $_SERVER['HTTP_VALIDATION_TOKEN'];
header('Validation-Token: '. $callbackSignature);
http_response_code(200);
we need to that response store in DB for further action.
i think this link do not hit when any message recieved from customer to company number. please guide me what i am doing wrong here and why webhook link is not working.
also when i run demo/subscription.php it gives me "Hosting Server Read Timeout" and link stop working, but sms.php,authData.php working well. When i check in api-explorer i get this response
https://platform.ringcentral.com/restapi/v1.0/subscription
{"uri": "https://platform.ringcentral.com/restapi/v1.0/subscription";,
"records": [
{
"uri": "https://platform.ringcentral.com/restapi/v1.0/subscription/bb50584d-b22f-43e2-9bd7-b29f7eed2f47";,
"id": "bb50584d-b22f-43e2-9bd7-b29f7eed2f47",
"creationTime": "2018-02-02T10:25:36.037Z",
"status": "Active",
"eventFilters": [
"/restapi/v1.0/account/304393018/extension/1446699019/message-store"
],
"expirationTime": "2018-02-02T10:40:36.037Z",
"expiresIn": 363,
"deliveryMode": {
"transportType": "PubNub",
"encryption": false,
"address": "268263456096097_0688d736",
"subscriberKey": "sub-c-b8b9cd8c-e906-11e2-b383-02ee2ddab7fe"
}
}
]
}
Now confusion is, SMS is sending well but when any to number reply against message we are unable to get any trigger or webhook url. this url was verified when app deploy for production. in this url that is "https:// "my server name" .com/ringcentral/webhook.php"
$callbackBody = file_get_contents('php://input');
$txt = "Server Hit from webhook call";
$fp = fopen('webhook.txt', 'w');
fwrite($fp, $txt);
fclose($fp);
$callbackSignature = $_SERVER['HTTP_VALIDATION_TOKEN'];
header('Validation-Token: '. $callbackSignature);
http_response_code(200);
we need to that response store in DB for further action.
i think this link do not hit when any message recieved from customer to company number. please guide me what i am doing wrong here and why webhook link is not working.
-
120 Points
i am getting notification when any reply received, but not write in this file $fp = fopen('webhook.txt', 'w');.
if you can create webhook example for SMS in Lite PHP SDK. it will be very helpful.Thanks
also please guide in screenshot registrationId. what it will be ? and certificationName ? if i select webhook it require registrationId. if it Client ID or something else ?

if you can create webhook example for SMS in Lite PHP SDK. it will be very helpful.Thanks
also please guide in screenshot registrationId. what it will be ? and certificationName ? if i select webhook it require registrationId. if it Client ID or something else ?

(Edited)
Tyler Long, Official Rep
-
8,884 Points
As far as I can tell, when you create a webhook using code, you don't need to specify registrationId. Here is some sample code: https://github.com/tylerlong/glip-ping-bot/blob/master/index.js#L31-L48
Code is JS instead of PHP, but at least it proves that registrationId is not needed.
Code is JS instead of PHP, but at least it proves that registrationId is not needed.
John Wang, Official Rep
-
5,786 Points
@Test RE2QA
I put together a simple webhook app using the Lite PHP SDK.
https://github.com/grokify/ringcentral-sdk-php-lite/tree/master/examples/webhook
You will see that you don't need `registrationId`. You just need the following:
Here is an example request:
Let us know if you are up and running or if there's anything else we can assist with.
I put together a simple webhook app using the Lite PHP SDK.
https://github.com/grokify/ringcentral-sdk-php-lite/tree/master/examples/webhook
You will see that you don't need `registrationId`. You just need the following:
- eventFilters
- deliveryMode.transportType
- deliveryMode.address
Here is an example request:
$reqBody = array( 'eventFilters' => array( '/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS', '/restapi/v1.0/subscription/~?threshold=86400&interval=3600' ), 'deliveryMode' => array( 'transportType' => 'WebHook', 'address' => 'https://12345678.ngrok.io/hook.php' ) );
Let us know if you are up and running or if there's anything else we can assist with.
(Edited)
VB, Official Rep
-
1,500 Points
You indicated you typed this :
Make sure you have the pipe symbol as shown in the read me : https://github.com/ringcentral/ringcentral-php#with-composer-recommended
I run php 5.6.3
curl -sS https://getcomposer.org/installer
Make sure you have the pipe symbol as shown in the read me : https://github.com/ringcentral/ringcentral-php#with-composer-recommended
curl -sS https://getcomposer.org/installer | php
I run php 5.6.3
(Edited)
-
100 Points
Hello - I am seeking if there is anyone out there that I can hire to write a PHP script for me to allow me to send and receive SMS messages from my RingCentral #. Ideally the script would monitor a POP3 mailbox, when a new email exists the subject is the phone # to send, the message body is the SMS to send. I can't find anything out there already made and assume a programmer who is familiar with the RingCentral SMS API platform can write this in a few hours?
Any help would be appreciated!
Scott
Any help would be appreciated!
Scott
Tyler Long, Official Rep
-
8,884 Points
You can try https://www.ringcentral.com/solutions/professional-services.html I know the professional service team does write code for customers.
John Wang, Official Rep
-
5,786 Points
You can also use the following developer-specific page for our Professional Services team. This also has a request form:
https://developer.ringcentral.com/support/services.html
https://developer.ringcentral.com/support/services.html