cdd_getFileTypeProcesses

The webServiceURL= The worksheetURL=https://contentbroker.ca/api-example/ Press here to see an example.



Description

Get a list of workflow for a given file type.

Code

function getClientFiles_example() { 
    $rm_options = get_option('ccb_option_name');    
  ?>
    <br><strong><a href="<?php echo $_GET['returnURL'];?>">Back</a></strong><p>
    <?php  

    try {   
  
        $keys_ar = array(
            "clientID" => "824" // some client id
        );  
        $keys_json = json_encode($keys_ar); 
        
        $transData_ar = array(
            "groupInd" => "1"
        ) ;
        $transData_json = json_encode($transData_ar);          
      
        util_dump_var($keys_ar, "Key Parameters") ;
        util_dump_var($transData_ar, "Transaction Data Parameters") ; 
        $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" => "content", 
                "function" => "ccb_getClientFiles", 
                "keys" => $keys_json, 
                "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();
    } 
} 



ccb_getClientFiles

Description

Get a list of a particular client’s files

Code

function getClientFiles_example() { 
    $rm_options = get_option('ccb_option_name');    
  ?>
    <br><strong><a href="<?php echo $_GET['returnURL'];?>">Back</a></strong><p>
    <?php  

    try {   
  
        $keys_ar = array(
            "clientID" => "824" // some client id
        );  
        $keys_json = json_encode($keys_ar); 
        
        $transData_ar = array(
            "groupInd" => "1"
        ) ;
        $transData_json = json_encode($transData_ar);          
      
        util_dump_var($keys_ar, "Key Parameters") ;
        util_dump_var($transData_ar, "Transaction Data Parameters") ; 
        $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" => "content", 
                "function" => "ccb_getClientFiles", 
                "keys" => $keys_json, 
                "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();
    } 
} 

Example:

cdd_getCodePossibleValues

Purpose:

For a given code table, the function gets it’s possible values. MaritalStatusCd is given in the example. Gets and array of codeValueIDs and possible values (label_med) of a given codeID.

Parameters (json array)

  • serviceName (string) = “dataDictionary”
  • function (string) = “cdd_getCodePossibleValues”
  • CodeID (string) required

Results (json array)

  • Status (string).  (“0″=Success, “1”=Not Successful)
  • statusMessage (string) (“Empty”,”Results”)
  • data (json array) (the results if not empty)

ccb_search

Purpose:

Searches content for matching data elements with values matching the criteria described in an array of key value pairs and returns the values of the data elements as described in the array of return elements.

Service Parameters (json array)

  • serviceName (string) = “content”
  • function (string) = “ccb_search”

Search Parameters

  • ccbUserID (string) Required
  • At least one  key value pair of Data Element and search it’s search criteria
  • Return Parameters

      • At least one Data Element to return

    Notes

          • Returns a maximum of 100 records
          • String searches that contain a wild card (“%”) are searched with a “LIKE” statement.

    Results (json array)

          • Status (string).  (“0″=Success, “1”=Not Successful)
          • statusMessage (string) (“Empty”,”Results”)
          • data (json array) (the results if not empty)