set_note_attachment
Overview
Creates an attachment and associated it to a specific note record.
Available APIs
Definition
set_note_attachment(session, note)
Parameters
Name |
Type |
Description |
session |
String |
Session ID returned by a previous login call. |
note |
new_note_attachment | Array |
The file attachment details |
note.id |
String |
The ID of the note record to associate the attachment to. |
note.filename |
String |
The file name of the file attachment. |
note.file |
String |
The binary contents of the file. |
Result
Name |
Type |
Description |
result |
new_set_entry_result | Array |
The call result. |
result.id |
String |
The ID of the note record / attachment |
Change Log
Version |
Change |
v2 |
Return type was changed from set_entry_result to new_set_entry_result. |
v2 |
Parameter note type change from note_attachment to new_note_attachment. |
Examples
PHP
$file_contents = file_get_contents("/path/to/example_file.php");
$set_note_attachment_parameters = array(
//Session id
"session" => $session_id,
//The attachment details
"note" => array(
//The ID of the note containing the attachment.
'id' => $note_id,
//The file name of the attachment.
'filename' => 'example_file.php',
//The binary contents of the file.
'file' => base64_encode($file_contents),
),
);