Draft 

Circularo REST API example

Create draft, update it and then delete it.

Step 1 - Sign in

Sign user in.

Endpoint

POST - /login

Example

/login

Content-Type: application/json

{
  "name": "mary.griffin@circularo.com",
  "password": "#32Password1!",
  "tenant": "default"
}

Response

Note following properties in response object:

  • token - In response object at position ‘token‘. It may have value of “PnkZO6kj0niR6e9qpdIxBEnM53AqtSp5PCCRIq0Jpt8wQz0baBM0fG3XacLsKmqd“.

Step 2 - Create draft.

Create new draft. Draft type “create” can be used to create new document.

Endpoint

POST - /drafts

Example

/drafts?token=PnkZO6kj0niR6e9qpdIxBEnM53AqtSp5PCCRIq0Jpt8wQz0baBM0fG3XacLsKmqd

Content-Type: application/json

{
  "body": {
    "documentType": "d_blank",
    "draftType": "create",
    "documentTitle": "My document title",
    "D_BLANK_TEXTAREA": "My custom value."
  }
}

Response

Note following properties in response object:

  • draftId - In response object at position ‘id‘. It may have value of “6b28deb1-f699-497b-a179-37ff7070d73d“.

The draft is now created. Draft version is 1.

Step 3 - Update draft.

Update existing draft.

Endpoint

PUT - /drafts/:draftId/:draftVersion

Example

/drafts/6b28deb1-f699-497b-a179-37ff7070d73d/1?token=PnkZO6kj0niR6e9qpdIxBEnM53AqtSp5PCCRIq0Jpt8wQz0baBM0fG3XacLsKmqd

Content-Type: application/json

{
  "body": {
    "documentType": "d_blank",
    "draftType": "create",
    "documentTitle": "Updated title name",
    "D_DEFAULT_DESCRIPTION": "Updated custom value."
  }
}

Response

Note following properties in response object:

  • draftVersion - In response object at position ‘version‘. It may have value of 6.

The draft is now updated.

Step 4 - Delete draft.

Delete existing draft.

Endpoint

DELETE - /drafts/:draftId

Example

/drafts/6b28deb1-f699-497b-a179-37ff7070d73d?token=PnkZO6kj0niR6e9qpdIxBEnM53AqtSp5PCCRIq0Jpt8wQz0baBM0fG3XacLsKmqd

The draft is now deleted.

Step 5 - Sign out (Optional)

Sign user out.

Endpoint

GET - /logout

Example

/logout?token=PnkZO6kj0niR6e9qpdIxBEnM53AqtSp5PCCRIq0Jpt8wQz0baBM0fG3XacLsKmqd