set_document_revision
Overview
Creates a new document revision for a specific document record.
Available APIs
Definition
set_document_revision(session, note)
Parameters
Name |
Type |
Description |
session |
String |
Session ID returned by a previous login call. |
note |
document_revision | Array |
The file attachment details |
note.id |
String |
The ID of the note record to associate the attachment to. |
note.file |
String |
The binary contents of the file. |
note.filename |
String |
The file name of the file attachment. |
note.revision |
String |
The revision number |
Result
Name |
Type |
Description |
result |
new_set_entry_result | array |
The results from the call. |
result.id |
String |
The ID of the document revision. |
Change Log
Version |
Change |
v2 |
Return type was changed from set_entry_result to new_set_entry_result. |
Examples
PHP
$file_contents = file_get_contents("/path/to/example_document.txt");
$set_document_revision_parameters = array(
//Session id
"session" => $session_id,
//The attachment details
"note" => array(
//The ID of the parent document.
'id' => $document_id,
//The binary contents of the file.
'file' => base64_encode($file_contents),
//The name of the file
'filename' => 'example_document.txt',
//The revision number
'revision' => '1',
),
);