Mark an inbound or outbound fax as read or unread
POST Variables
Variable Name | Var Type | Type | Description |
action | String | Required | Must be “Update_Viewed_Status” |
access_id | Integer | Required | Account Number |
access_pwd | String | Required | Password on the user’s account |
sFaxFileName | String | Required* | sFaxFileName returned from Get_Fax_Inbox or Get_Fax_Outbox |
sFaxDetailsID | Integer | Required* | sFaxDetailsID of the fax – the ID is located after the “|” (pipe) character of the sFaxFileName |
sDirection | String | Required | “IN” or “OUT” for inbound or outbound fax |
sMarkasViewed | String | Required | “Y” – mark fax as READ “N” – mark fax as UNREAD |
sResponseFormat | String | Optional | “XML” or “JSON” – Default is JSON |
*NOTE: Either the sFaxFileName or the sFaxDetailsID must be supplied
Returned Variables (JSON or XML Encoded)
Status | string | “Success” or “Failed” |
Result | string | Empty String |
Note: If an error is found then the reason for the failure will be in the Result string |
Examples
PHP using cURL
-
<?php
-
‘action’ => ‘Update_Viewed_Status’,
-
‘access_id’ => ‘12345’,
-
‘access_pwd’ => ‘myPassword’,
-
‘sFaxDetailsID’ => ‘12345678’,
-
‘sDirection’ => ‘OUT’,
-
‘sMarkasViewed’ => ‘Y’
-
);
-
CURLOPT_POST => 1,
-
CURLOPT_HEADER => 0,
-
CURLOPT_URL => “https://secure.srfax.com/SRF_SecWebSvc.php”,
-
CURLOPT_FRESH_CONNECT => 1,
-
CURLOPT_RETURNTRANSFER => 1,
-
CURLOPT_FORBID_REUSE => 1,
-
CURLOPT_TIMEOUT => 60,
-
CURLOPT_SSL_VERIFYPEER => false,
-
CURLOPT_SSL_VERIFYHOST => 2,
-
);
-
}
-
else {
-
}
-
?>
PHP using SRFax Object
-
<?php
-
require_once (“srFax_class.php”);
-
$accountID = “12345”;
-
$accountPassword = “myPassword”;
-
// instantiate object with Account ID and Password
-
$srFax = new srFax ( $accountID, $accountPassword );
-
try {
-
‘sFaxDetailsID’ => ‘12345678’,
-
‘sDirection’ => ‘OUT’,
-
‘sMarkasViewed’ => ‘Y’,
-
));
-
}
-
catch (Exception $e) { //display error when exception is thrown
-
}
-
if ( $srFax->getRequestStatus () ) {
-
} else {
-
echo “ERROR: “ . $srFax->getRequestResponse ();
-
}
-
?>