Codejig data types REST API (1.0.0)

Download OpenAPI specification:Download

Authentication

Application API uses HTTP Basic Authentication. Authorization header must be constructed from login and password of app-only users (credentials of Codejig users will be rejected).

Resources that do not have any permission restrictions are accessible without authorization HTTP header.

BasicAuth

Security scheme type: HTTP
HTTP Authorization Scheme basic

List instances

Returns a list of instances of the specified type. Request body controls pagination, ordering and filtering.

Returned instances will not contain collection fields. To get full object refer to GET /api/entity/{typeReference}/{entityId}.

By default, instances are sorted by an identifier in descending order. You can sort on any field that is not a collection. Nulls are considered to be greater than non-null values. References are sorted by the default string view of their type.

Pagination is cursor-based. To get a next page supply the same request body, but set value to a lastValue field as the last element from a previous page. If the lastValue field is empty but a size field is not, the first page of results will be retrieved. If both are empty, all instances of the specified type will be returned.

Filters field expects logical expression written in Reverse Polish notation. Examples of such expressions can be found under the payload examples.

Read permission for the specified type will be checked. Additionally, we will check View deleted permission if you set loadDeleted to true.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

Request Body schema: application/json

Pagination, ordering and filtering

order
object

Sorting parameters

filters
Array of objects or objects

A logical expression that we will use to filter result collection. It has to be expressed in Reverse Polish notation.

loadDeleted
boolean
Default: false

If deleted instances should be returned

size
integer <int32> Nullable
Default: null

Size of the page. If not specified, all instances will be returned.

lastValue
object

The last value from the previous page. Used for cursor-based pagination

Responses

200

A page of instances

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type

get /api/entity/{typeReference}/
https://app12345.codejig.com/api/entity/{typeReference}/

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "filters":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total": 0
}

Create an instance

Create permission for the type will be checked.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

Request Body schema: application/json

Instance

metaObject
object (MetaObject)
serialNumber
string

Responses

200

Entity

400

Instance from the request body does not pass validation logic

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type

post /api/entity/{typeReference}/
https://app12345.codejig.com/api/entity/{typeReference}/

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metaObject":
    {
    },
  • "serialNumber": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "281474976723052",
  • "metaObject":
    {
    },
  • "serialNumber": "string",
  • "entityTypeId": "string"
}

List instances

Alias for GET /api/entity/{typeReference}/

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

Request Body schema: application/json

Pagination, ordering and filtering

order
object

Sorting parameters

filters
Array of objects or objects

A logical expression that we will use to filter result collection. It has to be expressed in Reverse Polish notation.

loadDeleted
boolean
Default: false

If deleted instances should be returned

size
integer <int32> Nullable
Default: null

Size of the page. If not specified, all instances will be returned.

lastValue
object

The last value from the previous page. Used for cursor-based pagination

Responses

200

A page of instances

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type

post /api/entity/{typeReference}/search
https://app12345.codejig.com/api/entity/{typeReference}/search

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "filters":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total": 0
}

Get top-level instances

Get top-level instances and folders of the specified type

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

query Parameters
wholeTree
boolean

If the response should contain all instances on all levels of the tree

Responses

200

Instances and folders

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type

get /api/entity/{typeReference}/children
https://app12345.codejig.com/api/entity/{typeReference}/children

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "folders":
    [
    ],
  • "instances":
    [
    ]
}

Get an instance

Read permission for this instance will be checked. Additionally if the instance is deleted we will check View deleted permission (or View history if the instance is snapshot from history) before Read.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

instanceId
required
string

An identifier of the instance

Responses

200

Entity

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type or instance

get /api/entity/{typeReference}/{instanceId}
https://app12345.codejig.com/api/entity/{typeReference}/{instanceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "281474976723052",
  • "metaObject":
    {
    },
  • "serialNumber": "string",
  • "entityTypeId": "string"
}

Update an instance

Update permission for this instance will be checked. Instance must be active, otherwise response will be 403.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

instanceId
required
string

An identifier of the instance

Request Body schema: application/json

Instance

metaObject
object (MetaObject)
serialNumber
string

Responses

200

Entity

400

Instance from the request body does not pass validation logic

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type or instance

post /api/entity/{typeReference}/{instanceId}
https://app12345.codejig.com/api/entity/{typeReference}/{instanceId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metaObject":
    {
    },
  • "serialNumber": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "281474976723052",
  • "metaObject":
    {
    },
  • "serialNumber": "string",
  • "entityTypeId": "string"
}

Patch an instance

Update permission for this instance will be checked. Instance must be active, otherwise response will be 403.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

instanceId
required
string

An identifier of the instance

Request Body schema: application/json

Instance

metaObject
object (MetaObject)
serialNumber
string

Responses

200

Entity

400

Instance from the request body does not pass validation logic

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type or instance

patch /api/entity/{typeReference}/{instanceId}
https://app12345.codejig.com/api/entity/{typeReference}/{instanceId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metaObject":
    {
    },
  • "serialNumber": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "281474976723052",
  • "metaObject":
    {
    },
  • "serialNumber": "string",
  • "entityTypeId": "string"
}

Delete an instance

Delete permission for this instance will be checked. Instance must be active, otherwise response will be 403.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

instanceId
required
string

An identifier of the instance

Responses

200

Entity

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type or instance

delete /api/entity/{typeReference}/{instanceId}
https://app12345.codejig.com/api/entity/{typeReference}/{instanceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "281474976723052",
  • "metaObject":
    {
    },
  • "serialNumber": "string",
  • "entityTypeId": "string"
}

Get children

Get direct children (instances and folders) of the specified instance

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

instanceId
required
string

An identifier of the instance

Responses

200

Instances and folders

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type or instance

get /api/entity/{typeReference}/{instanceId}/children
https://app12345.codejig.com/api/entity/{typeReference}/{instanceId}/children

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "folders":
    [
    ],
  • "instances":
    [
    ]
}

Post a document

Post permission for this document will be checked.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

instanceId
required
string

An identifier of the instance

Responses

200

Entity

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type or instance

post /api/entity/{typeReference}/{instanceId}/post
https://app12345.codejig.com/api/entity/{typeReference}/{instanceId}/post

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "281474976723052",
  • "metaObject":
    {
    },
  • "serialNumber": "string",
  • "entityTypeId": "string"
}

Unpost a document

Unpost permission for this document will be checked.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

instanceId
required
string

An identifier of the instance

Responses

200

Entity

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type or instance

post /api/entity/{typeReference}/{instanceId}/unpost
https://app12345.codejig.com/api/entity/{typeReference}/{instanceId}/unpost

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "281474976723052",
  • "metaObject":
    {
    },
  • "serialNumber": "string",
  • "entityTypeId": "string"
}

Get journal records

Get journal records for a document. Returns records grouped by their type.

View posted journal records permission for this document will be checked.

Authorizations:
path Parameters
typeReference
required
string

An identifier or a system name of the data type

instanceId
required
string

An identifier of the instance

Responses

200

Journal records

401

The request lacks valid authorization header or supplied credentials are invalid

403

Supplied credentials are valid but the access is forbidden

404

No such type or instance

get /api/entity/{typeReference}/{instanceId}/journals
https://app12345.codejig.com/api/entity/{typeReference}/{instanceId}/journals

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "property1":
    [
    ],
  • "property2":
    [
    ]
}