Create a New Diagram

From Creately Developer

Jump to: navigation, search

Contents

Description

This method is used to create a new document in Creately.

Request

Request Details

URL https://creately.com/api/document
HTTP Method POST
Supported Authentication CT or SA
API Permissions This API call will not require any permissions
User Permissions The user will need to have permission to create new diagrams according to the given parameters. If user does not have sufficient permissions a error will be sent back

Request Parameters

Parameter Description Required Default Value
action Must contain the value "createdoc". Will indicate that this is a Document Create action. Mandatory N/A
name A string for the Document name. Need to contain valid characters of a file name. Validating regular expression is
/ \: " * & # | ; % ? \
Mandatory N/A
desc A string for the description of the document Optional Empty
public A boolean value indicating "true" or "false". Specifies if document is public or private. Optional false
tags A list of tags for the document. Separate each tag with a comma(,) Optional Empty
width An integer value to indicate the width of the document canvas in pixels. The value can ranging from 100 to 8000. Optional 1500
height An integer value to indicate the height of the document canvas in pixels. The value can ranging from 100 to 8000. Optional 1500
diagramtype A valid Diagram Type ID in Creately. This creates a specific type of document opening the related KObject sets Optional Block Diagram
template A valid ID of a Creately Template document that will be loaded in the newly created document Optional None
returnxml A boolean value indicating "true" or "false". Specifies if response should be a XML. Response will be sent in a XML if the value is true. Response will be sent in a serial string if the value is false. Optional true

NOTE: Parameters required by the authentication method must be provided. See what parameters are required in Authentication

Response

Response Details

Type XML
Content The ID of the newly created document will be returned on successful response.

Response Parameters

Tag Description
success Indicates if the request was successfully processed. May have true or false
doc-id The unique ID of the newly created Creately document.
errorcode Will be available if the success parameter was false. Will contain a valid API Error code. Valid error codes are listed in API Error Codes
message Will be available if the success parameter was false. Will contain a string message for the error

Errors

Refer to Errors related to Document API calls in the Error Codes
Possible errors for Create a New Diagram method are: 1107, 1201, 1403, 1407, 1414, 1415, 1416, 1417, 1419, 1422

Examples

Example 1

Request

https://creately.com/api/document?apikey=2njk4234j23hkj23h4j2k3423jk4h&sig=jkn435654jk2j1kjh3mjk9&usr=johndoe@achme.com&action=createdoc&name=test&diagramtype=uml-class

Response

	<creately-api-response>
 		<success>true</success>
 		<doc-id>f4ne342d</doc-id>
 	</creately-api-response>

Code Example

An example of how to use this end point - http://creately.com/api/document - is available in PHP - Right click and choose Save as to download the files.

Personal tools