question

ken-fields avatar image
ken-fields asked

Faxout API using php/cURL always responds with "No recipients specified"

No matter what I do I always receive "3 - No recipients specified" when attempting to use the Faxout api.  I have tried using a "1" in the Username and Recipient fields to no avail.  Here is my php code.  I have also tried converting is field to ascii without any difference. 

It would be great if there were some documented PHP code examples we could use.

$postURL = ' https://service.ringcentral.com/faxapi.asp';
$ch = curl_init($postURL);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_REFERER, ' http://www.google.com/');

$hiddens = '';
$hiddens .= 'Username'.'='.'1xxxxxxxxxx'.'&';
$hiddens .= 'Password'.'='.''.'xxxxxxx';
$hiddens .= 'Recipient'.'='.'15138211111|John Doe'.'&';
$hiddens .= 'Coverpage'.'='.'NONE'.'&';
$hiddens .= 'Coverpagetext'.'='.'asdf asdf'.'&';

$hiddens = urlencode(substr($hiddens, 0, strlen($hiddens)-1));
$hiddens = (substr($hiddens, 0, strlen($hiddens)-1));

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $hiddens);

$page = curl_exec($ch);
echo $page;// output result
if ($page === FALSE) {
var_dump(curl_getinfo($ch));
exit( "Post: FAILED = ".curl_error($ch) );
}
curl_close($ch); // close the connection


topic-default
1 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.