PHP 5.2 Curl Fax Code Examples
Tags: fax
Jun 17, 2018 at 10:46pm • 5 replies • 0 likes
drew-bolton
So unfortunately I'm stuck on PHP 5.2.3 and cannot upgrade, thus cannot use the official PHP SDK. I need examples of how to set up the FaxOut after obtaining a valid Access Token. Been stuck for the past 3 days.
5 Answers
Curl to PHP: https://incarnate.github.io/curl-to-php/
Update: I find that it doesn't support '-F' at all, so ignore this one.
Update: I find that it doesn't support '-F' at all, so ignore this one.
0
Drew,
Try out my PHP "Lite" SDK. It's a 1-file, 0-dependency library designed to support older PHP and uses cURL.
You can see a fax example using the SDK here:
https://github.com/grokify/ringcentral-sdk-php-lite#send-a-fax
You can see the SDK's cURL code here:
https://github.com/grokify/ringcentral-sdk-php-lite/blob/master/src/ringcentrallite.php#L139
I don't have PHP 5.2.3, so let me know if it works for you.
Try out my PHP "Lite" SDK. It's a 1-file, 0-dependency library designed to support older PHP and uses cURL.
You can see a fax example using the SDK here:
https://github.com/grokify/ringcentral-sdk-php-lite#send-a-fax
You can see the SDK's cURL code here:
https://github.com/grokify/ringcentral-sdk-php-lite/blob/master/src/ringcentrallite.php#L139
I don't have PHP 5.2.3, so let me know if it works for you.
0
I can show you how to do it with curl. You try to adjust it for PHP curl.
curl \
--header "Accept: application/json" \
--header "Authorization: Bearer <token>" \
-F "request=@request.json;type=application/json" \
-F " attachment=@hello.txt;type=text/plain" \
" https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/fax";
Content of request.json file:
{
"to": [{ "phoneNumber": <fax receiver> }]
}
Content of hello.txt:
<Whatever text you want to send.>
You can also send pdf:
-F " attachment=@test.pdf;type=application/pdf"
curl \
--header "Accept: application/json" \
--header "Authorization: Bearer <token>" \
-F "request=@request.json;type=application/json" \
-F " attachment=@hello.txt;type=text/plain" \
" https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/fax";
Content of request.json file:
{
"to": [{ "phoneNumber": <fax receiver> }]
}
Content of hello.txt:
<Whatever text you want to send.>
You can also send pdf:
-F " attachment=@test.pdf;type=application/pdf"
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