QBOS REST API documentation (document)

(return to Main Document)

Introduction

The document API allows client applications to maintain document data including any part of its demographic record sets.

Audience

This developer's guide is intended for software developers needing a technical reference for using the QBOS REST API. The information you find in this guide is written by software engineering, and is authoritative on how the API behaves.

Additional resources, information about this guide

Occasionally, we make a mistake in this documentation, or unknowingly break a feature that you depend on. If this has happened to you, we apologize! You can help us fix the issue by contacting us. We appreciate your help.

Getting Started

To place any request in QBOS API application from third party application you need to authenticate user account and set/calculate values for the following request headers: x-qbos-id, x-qbos-nonce, x-qbos-date-utc, x-qbos-hash-version, x-qbos-auth

See details in Authentication Documentation.

document properties

Properties prefixed with '_' (underscore) are read-only properties. i.e. POST and PUT processing will ignore these properties.

Name Type Max length Numeric Required
For POST
Filterable Description

id

bigint

 

 

 

Required for GET(by id),PUT,DELETE

parent_id

bigint

 

yes

 

parent_type

nvarchar

50

 

yes

 

type

nvarchar

50

 

 

 

Value is "document"

title

varchar

128

 

 

 

source_template_id

int

 

 

 

Id of the template from which document was spawned. To spawn a new document from a template: Assign a template id to this property and POST the payload. To spawn a new document VERSION from a template: Assign value 1 to this property and PUT the payload. This property is immutable.

href_content

varchar

87

 

 

 

Reference to the current version of the document

href

varchar

25

 

 

 

dos_extension

varchar

7

 

 

 

_version_number

smallint

 

 

 

_guid

uniqueidentifier

 

 

 

Read document by id:

GET https:/.../v1/o/document/{id}

Response codes:

  • 400 - Client error
  • 500 - Server error
  • 404 - Not found or user does not have permission to access resources of this type.
  • 200 - OK

Response data: GET https:/.../v1/o/document/1075400
{ "parent_type" : "PAYPERIOD", "parent_id" : 4009, "type" : "document", "id" : 1075400, "sub_type" : " ", "title" : "Payroll Hours approved on 04\/11\/2024", "source_template_id" : 0, "href_content" : "\/v1\/o\/document_content\/5B8456F9-ECB7-4DE7-85AA-692EC2861BDB", "href" : "\/v1\/o\/document\/1075400", "dos_extension" : "pdf", "_version_number" : 1, "_guid" : "5B8456F9-ECB7-4DE7-85AA-692EC2861BDB" }

Read document from parent:

GET https:/.../v1/o/{parent_type}/{parent_id}/links/document[?{filter}]

Response codes:

  • 400 - Client error
  • 500 - Server error
  • 404 - Not found or user does not have permission to access resources of this type.
  • 200 - OK

GET https:/.../v1/o/PAYPERIOD/4009/links/document
Response example is shown in XML format here even though REST API returns JSON format:
<document><document parent_type="PAYPERIOD" parent_id="4009" type="document" id="1075400" sub_type=" " _title="Payroll Hours approved on 04/11/2024" href="/v1/o/document/1075400"/><document parent_type="PAYPERIOD" parent_id="4009" type="document" id="1075399" sub_type=" " _title="Payroll Hours approved on 04/11/2024" href="/v1/o/document/1075399"/></document>

Create document:

POST https:/.../v1/o/PAYPERIOD/4009/document

Request data [See properties]:

{"document": [ { "parent_type" : "PAYPERIOD", "parent_id" : 4009, "property_a" : "value-a", "property" : "See document properties", "property_z" : "value-z" } ] }

Response codes:

Update document:

PUT https:/.../v1/o/document/{id}

Request data [See properties]:

{"document": [ { "id" : 1075400, "property_a" : "value-a", "property" : "See document properties", "property_z" : "value-z" } ] }

Response codes:

  • 400 - Client error
  • 500 - Server error
  • 200 - OK Content returned [See response data]
  • 204 - OK No content
  • 404 - Not found

Delete document:

DELETE https:/.../v1/o/document/{id}

The "id" in JSON payload is required to match the {id} in the URI to ensure that deletion requests are intended and safe

{"document": [{"id":1075400}]}

Response codes:

  • 400 - Client error
  • 500 - Server error
  • 204 - OK
  • 404 - Not found

Response data:
{}