Created
August 12, 2011 11:42
-
-
Save fsvehla/1141894 to your computer and use it in GitHub Desktop.
Faxonline API PHP Sample: Sending
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$login = 'xxxxxxxx'; /* Username */ | |
$password = 'xxxxxxxx'; /* Password */ | |
$path = 'Test.pdf'; /* Path to file */ | |
$recipient = '+43125330331115'; /* Recipient */ | |
$handle = curl_init(); | |
$url = 'https://' . $login . ':' . $password . '@faxonline.at/api-v1/faxes.json'; | |
$data = array('document' => '@' . $path, 'recipient' => $recipient); | |
curl_setopt($handle, CURLOPT_URL, $url); | |
curl_setopt($handle, CURLOPT_POST, true); | |
curl_setopt($handle, CURLOPT_POSTFIELDS, $data); | |
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); | |
$response = curl_exec($handle); | |
curl_close($handle); | |
$data = json_decode($response, true); | |
var_dump($data); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment