Purpose:
Gets the value of a given codeValueID.
Service Parameters (json array)
- serviceName (string) = “content”
- function (string) = “ccb_getCodeValue”
Key Parameters
- codeValueid (string) Required
Notes
- If a FollowupID is provided, the service returns the elements for that event only.
-
Data Parameters
A the value of the codeValueID.
-
Results (json array)
- Status (string). (“0″=Success, “1”=Not Successful)
- statusMessage (string) (“Empty”,”Results”)
- data (json array) (the results if not empty)
function getCodeValue_example(){
$rm_options = get_option('ccb_option_name');
?>
<br><strong><a href="<?php echo $_GET['returnURL'];?>">Back</a></strong><p>
<?php
try {
// old way
$endPointURL = $webserviceURL ;
// new way
$endPointURL = $webserviceURL ;
$postParameters = array(
"serviceName" => "dataDictionary",
"function" => "cdd_getCodeValue"
) ;
$data_ar = array(
"CodeValueID" => "278" //
);
util_dump_var($postParameters, "Post Parameters") ;
util_dump_var($data_ar, "Data Parameters") ;
$transData_json = json_encode($data_ar);
$response = wp_remote_post( $rm_options['webservice_url'], array(
'method' => 'POST',
'timeout' => 45,
'redirection' => 5,
'httpversion' => '1.0',
'blocking' => true,
'headers' => array(),
'body' => array(
"serviceName" => $postParameters["serviceName"],
"function" => $postParameters["function"],
"transData" => $transData_json
),
'cookies' => array()
)
);
if ( is_wp_error( $response ) ) {
$error_message = $response->get_error_message();
util_log("Web service error in:" . $postParameters["service"] . " " . $postParameters["function"] . " " . $error_message);
} else {
}
$obj = json_decode($response['body'], true);
$responseData = $obj["data"] ;
util_dump_var($responseData, "wp_remote_post response") ;
return $responseData ;
}
catch (Exception $e) {
return "<br>searchImportTables_example Error: " . $e->getMessage();
}
}