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
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
answered on Jun 18, 2018 at 7:15pm  
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.

 0
answered on Jun 18, 2018 at 9:07am  
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.

 0
answered on Jun 18, 2018 at 8:47am  
But how do I translate that to PHP cURL lib?... such as using curl_init(), curl-setopt(), etc?

Ya, 1.5 days were stuck reading docs and the other 1.5 days were trying to implement things fruitlessly. 

 0
answered on Jun 18, 2018 at 3:35am  
Been stuck for the past 3 days.
You should have asked for help earlier :)

 0
answered on Jun 18, 2018 at 3:34am  
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"


 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