Choose where you’d like to start

Create Notecard In Zoho Notebook

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>]);
where:

 

ParamsData typeDescription

<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:

  • text - Treats the <content> parameter as plain text.
  • html - Executes the HTML tags present in the value of the <content> parameter.
  • resource - Treats the value of the <content> parameter as FILE (image or a PDF).

<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
The KEY-VALUE response returned by Zoho Notebook. It represents the task execution details, such as the ID of the notecard that will be created, creation and modification time of the notecard, and the status of the task.
"Note content"
The TEXT that represents the content of the notecard that needs to be created.
"text"
The TEXT that represents the type of specified content.
dataMap
The KEY-VALUE variable that holds the version notes.

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
The TEXT that represents the content of the notecard that needs to be created. Here, the content is in HTML format.
"html"
The TEXT that represents the type of specified content.

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
The FILE variable that holds the image content of the notecard that needs to be created.
"resource"
The TEXT that represents the type of specified content.

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"
      }

Related Links

Get Started Now

Execute