The connector's insert
fetch action inserts information into Evernote. To use the insert
action, you must construct some XML that specifies where to add each item, and the information to insert. You must add the XML to the action as the value of the insertXML
action parameter. The exact structure of the XML depends on the type of item that you want to insert.
The XML contained in the insertXml
parameter must be URL encoded before being used in the action command. For example:
http://host:port/action=Fetch&FetchAction=Insert &ConfigSection=MyTask &InsertXML=[URL encoded XML]
For more information about using the insert
fetch action, refer to the Evernote Connector Reference.
To insert a notebook, set the TYPE
property to NOTEBOOK
, and use the NOTEBOOKNAME
metadata field to specify the name of the new notebook. For example:
<insertXML> <insert> <property name="TYPE" value="NOTEBOOK"/> <metadata name="NOTEBOOKNAME" value="[Value]"/> </insert> </insertXML>
To insert a note, set the TYPE
property to NOTE
.
Use the NOTEBOOKID
metadata field to specify the ID of the notebook to insert the note into. A notebook ID is included in the document identifier returned by the insert fetch action when you insert a notebook, and in document metadata when you run the synchronize fetch action.
Use the TITLE
metadata field to specify a title for the note.
Use the file
element to specify the text to insert as the note's content. For information about the ways in which you can specify the content, refer to the documentation for the insert fetch action in the Evernote Connector Reference. If you specify a file, the file must be a text file.
For example:
<insertXML> <insert> <property name="TYPE" value="NOTE"/> <metadata name="NOTEBOOKID" value="[Value]"/> <metadata name="TITLE" value="[Value]"/> <file> <type>file</type> <displayname>My note content.txt</displayname> <content>C:\My files\My note content.txt</content> </file> </insert> </insertXML>
To insert a resource (a file attached to a note), set the TYPE
property to RESOURCE
.
To specify where to attach the file, set both the NOTEBOOKID
and NOTEID
metadata fields. A notebook ID is included in the document identifier returned by the insert fetch action when you insert a notebook, and in document metadata when you run the synchronize fetch action. A note ID is included in the document identifier returned by the insert fetch action when you insert a note, and in document metadata when you run the synchronize fetch action.
To specify the type of attachment, set the MIME
metadata field to the MIME type of the resource, for example image/jpeg
.
Finally, use the file
element to specify the file to insert. For information about the ways in which you can specify a file, refer to the documentation for the insert action in the Evernote Connector Reference.
<insertXML> <insert> <property name="TYPE" value="RESOURCE"/> <metadata name="NOTEBOOKID" value="[Value]"/> <metadata name="NOTEID" value="[Value]"/> <metadata name="MIME" value="[Value]"/> <file> <type>file</type> <displayname>image.jpg</displayname> <content>C:\My files\image.jpg</content> </file> </insert> </insertXML>
|