Exemple #1
0
    #### Create Signer, ApiClient and Annotation Api objects
    # Create signer object
    $signer = new GroupDocsRequestSigner($privateKey);
    # Create apiClient object
    $apiClient = new ApiClient($signer);
    # Create Annotation object
    $antApi = new AntApi($apiClient);
    if ($basePath == "") {
        //If base base is empty seting base path to prod server
        $basePath = 'https://api.groupdocs.com/v2.0';
    }
    //Set base path
    $antApi->setBasePath($basePath);
    # Make a request to Annotation API using clientId and fileId
    try {
        $list = $antApi->ListAnnotations($clientId, $fileId);
        if ($list->status == "Ok") {
            // Check the result of the request
            if (isset($list->result)) {
                // If request was successfull - set annotations variable for template
                F3::set('annotations', $list->result->annotations);
            }
        } else {
            throw new Exception($list->error_message);
        }
    } catch (Exception $e) {
        $error = 'ERROR: ' . $e->getMessage() . "\n";
        F3::set('error', $error);
    }
}
// Process template