Create Notecard In Zoho Notebook
Table of Contents
Description
The zoho.notebook.createNotecard task creates a new notecard with the specified content in Zoho Notebook.
Syntax
<response> = zoho.notebook.createNotecard(<content>, <type>, <values>, [<connection>]);
Params | Data type | Description |
<response> | KEY-VALUE | The task execution details such as ID of the notecard that will be created, creation and modification time of notecard, and the status of the task. |
<content> | TEXT/ FILE | The content of the notecard that needs to be created. The content can be a plain text, HTML content, image (of any valid format), or PDF. |
<type> | TEXT | The type of content that will be specified. Allowed Values:
|
<values> | TEXT | The parameters, as specified in the Zoho notebook API. |
<connection> (optional) | TEXT | The name of the connection. Note: This parameter is mandatory in Zoho Creator. |
Example 1: Create notecard with a text content
The following script creates a new notecard with the specified text content:
// Create a KEY-VALUE variable to hold version notes note = map(); note.put("appName", "Zoho CRM"); note.put("deviceName", "Shawn's Iphone"); // Create a KEY-VALUE variable to hold the parameters specified in Zoho Notebooks API dataMap = map(); dataMap.put("version_notes", note); // Execute the integration task to create a notecard in Zoho Notebook with TEXT content response = zoho.notebook.createNotecard("Note content", "text", dataMap, "notebook_connection");
where:
response
"Note content"
"text"
dataMap
Example 2: Create notecard with an HTML content
The following script creates a new notecard with the text specified in HTML format:
// Create a TEXT variable to hold the input HTML content htmlcontent = "<h1>New Notecard</h1><p>This notecard is created using Deluge task.</p>"; // Create a KEY-VALUE variable to hold version notes note = map(); note.put("appName", "Zoho CRM"); note.put("deviceName", "Shawn's Iphone"); // Create a KEY-VALUE variable to hold the parameters specified in Zoho Notebooks API dataMap = map(); dataMap.put("version_notes", note); // Execute the integration task to create a notecard in Zoho Notebook with HTML content response = zoho.notebook.createNotecard(htmlcontent, "html", dataMap, "notebook_connection");
where:
htmlcontent
"html"
Example 3: Create notecard with an image content
The following script creates a new notecard with the specified image file:
// Perform invoke URL task to fetch the image file with which the notecard needs to be created imageFile = invokeurl [ url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSz4pZuwLofV4goZVT0e2R3K5bElhWk3oMDuUgP3XT9p9d4_Tkv4g" type: GET ]; // Create a KEY-VALUE variable to hold version notes note = map(); note.put("appName", "Zoho CRM"); note.put("deviceName", "Shawn's Iphone"); // Create a KEY-VALUE variable to hold the parameters specified in Zoho Notebooks API dataMap = map(); dataMap.put("version_notes", note); // Execute the integration task to create a notecard in Zoho Notebook with an image response = zoho.notebook.createNotecard(imageFile, "resource", dataMap, "notebook_connection");
where:
imageFile
"resource"
Response Format
Success Response
The success response will be returned in the following format:
{
"created_time": "2019-08-14T03:29:54-0700",
"notecard_id": "2cbocXXXXXXXXXXXXXXXXXXXXXXXXXXXc504b",
"code": 201,
"locked_by_parent": false,
"color": "#E9FF9D",
"latitude": 0,
"description": " sampleText ",
"message": "Notecard created successfully",
"type": "note/mixed",
"is_collection": false,
"notebook_id": "1cbkkXXXXXXXXXXXXXXXXXXXXXXXXXXXee120",
"modified_time": "2019-08-14T03:29:54-0700",
"name": "Sample",
"location": "Unknown",
"is_parsable": false,
"last_accessed_time": "2019-08-14T03:29:54-0700",
"favorite": false,
"embed_resources": [
],
"status": "Success",
"longitude": 0
}
Failure Response
The failure response for supplying incorrect value to
parameter will be returned in the following format: {
"code": 1901,
"message": "upload is not configured for the parameter attachment",
"status": "Failed"
}The failure response for missing mandatory parameter will be returned in the following format:
{
"code": 1018,
"message": "version_notes should be present at least once",
"status": "Failed"
}