Create Template With Content
Purpose
To create template with content parameter. The template will be created along with the content that you provided in the request body.
Quick Reference
| Property | Value |
|---|---|
| Method | POST |
| Request URL | https://{zohoapis_domain}/writer/api/v1/templates |
| Scopes | ZohoWriter.documentEditor.ALL, ZohoPC.files.ALL, WorkDrive.files.ALL, WorkDrive.organization.ALL, WorkDrive.workspace.ALL |
| Rate Limit | See Writer API throttle limits |
Parameters
Body Parameters
| Parameter | Data Type | Mandatory/Optional | Description |
|---|---|---|---|
| content | File | Mandatory | Provide the required content in your API request body. |
| type | String | Optional | Specify the type (either personal or organization ) of templates that needs to be created. For example: type = personal / organization By default, personal templates will be created. |
| name | String | Optional | Specify a unique name for the template. |
| password | String | Optional | If the provide input file is password protected, then you can specify that password via this parameter. |
Notes
- PDF file format is not supported during import.
- For possible errors, refer to error codes.
Sample Request
Copiedcurl -X POST "https://www.zohoapis.com/writer/api/v1/templates" \
-H "Authorization: Zoho-oauthtoken <ACCESS_TOKEN>" \
-F "content=@template.docx" \
-F "type=personal" \
-F "name=Template with Content"Copiedparam = Map();
param.put("type","personal");
fileMap = Map();
fileMap.put("content",file("/Users/zylker/Downloads/invoice.docx"));
response = invokeurl
[
url :"https://www.zohoapis.com/writer/api/v1/templates"
type :POST
parameters:param
files:fileMap
connection:"<connection_name>"
];
info response;Sample Response
Copied{
"created_time": "2019-08-28T16:30:33Z",
"modified_time_ms": 1567009834477,
"owner_id": "14335411",
"last_opened_time": "2019-08-28T16:30:33Z",
"open_url": "https://writer.zoho.com/writer/template/a7iyybadb",
"last_opened_time_ms": 1567009833936,
"type": "template",
"thumbnail_url":"https://writer.zoho.com/writer/thumbnail/a7iyybadb",
"created_by": "amelia",
"created_time_ms": 1567009833936,
"modified_time": "2019-08-28T16:30:34Z",
"preview_url": "https://writer.zoho.com/writer/zwpreview/a7iyybadbb8",
"creator_id": "11122329",
"name": " Sample Name",
"id": "a7iyybadbb8b74e1147638bad04abc161e79e",
"permalink": "https://docs.zoho.com/file/a7iyybadb"
"status": "active"
}