Extobj (extobjs)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/reference/extobjs

Creating a new extobj

GET

/rest/v1/reference/extobjs

Getting the list of extobj

GET

/rest/v1/reference/extobjs_by_type/<type>

Getting the list of extobj filtered by type

GET

/rest/v1/reference/extobjs_by_type

Getting the list of extobj filtered by type

GET

/rest/v1/reference/extobjs/<id>

Getting extobj data

PATCH

/rest/v1/reference/extobjs/<id>

Modifying extobj data

DELETE

/rest/v1/reference/extobjs/<id>

Deleting extobj

LOOKUP

/rest/v1/reference/extobjs

Searching for an object identifier


Creating a new extobj

Request

Field description: extobj

Example request
POST /rest/v1/reference/extobjs HTTP/1.1
Content-Type: application/json; charset=utf-8

extobj

Response

Field description: extobj

Example response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "f199b9f2-016c-b30f-e345-50e54938780c",
  "type": "mytype",
  "value": {
    "obj": {
      "name": "Obj",
      "no": 2
    }
  },
  "opts": {
    "title": "Object 1",
    "comment": "second comment",
    "user_tags": [
      "red",
      "mytype",
      "once"
    ]
  },
  "ext": {
    "ct": "2019-08-21T07:24:18.62Z",
    "lwt": "2019-08-21T07:24:18.62Z"
  }
}

Getting the list of extobj

Request

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, type, opts.title, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/reference/extobjs?offset=0&limit=2 HTTP/1.1

Response

Field description: extobj

Example response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "f199b9f2-016c-b30f-e345-50e54938780c",
    "type": "mytype",
    "opts": {
      "title": "Object 1"
    },
    "ext": {
      "ct": "2019-08-21T07:43:53.91Z",
      "lwt": "2019-08-21T07:43:53.91Z"
    }
  },
  {
    "id": "48ca5b30-016c-b31f-fb85-50e54938780c",
    "type": "newType",
    "opts": {
      "title": "Object 75"
    },
    "ext": {
      "ct": "2019-08-21T07:45:22.17Z",
      "lwt": "2019-08-21T07:45:22.17Z"
    }
  }
]

Getting the list of extobj filtered by type

The request retrieves data from the collection; parameters and the return value are similar to request Getting the list of extobj. Searches for entities filtered by the type field specified in the URL. Without a type in the URL (`/rest/v1/reference/extobjs_by_type`), returns the list of existing type values with links to selections by them.

Request

Example request
GET /rest/v1/reference/extobjs_by_type/mytype?mask=id,type,opts&limit=2 HTTP/1.1

Response

Example response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "f199b9f2-016c-b30f-e345-50e54938780c",
    "type": "mytype",
    "opts": {
      "title": "Object 1"
    }
  },
  {
    "id": "1830aa72-016c-6b70-75a1-02004c4f4f50",
    "type": "mytype",
    "opts": {
      "title": "Object 2"
    }
  }
]

Getting extobj data

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/reference/extobjs/f199b9f2-016c-b30f-e345-50e54938780c HTTP/1.1

Response

Field description: extobj

Example response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "f199b9f2-016c-b30f-e345-50e54938780c",
  "type": "mytype",
  "value": {
    "obj": {
      "name": "Obj",
      "no": 2
    }
  },
  "opts": {
    "title": "Object 1",
    "comment": "second comment",
    "user_tags": [
      "red",
      "mytype",
      "once"
    ]
  },
  "ext": {
    "ct": "2019-08-21T07:24:18.62Z",
    "lwt": "2019-08-21T07:24:18.62Z"
  }
}

Modifying extobj data

Fields prohibited for modification: id

Request

Field description: extobj

Example request
PATCH /rest/v1/reference/extobjs/f199b9f2-016c-b30f-e345-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

{
  "value": "{\"obj\":{\"name\":\"Obj\",\"no\":2}}",
  "opts": {
    "comment": "third comment",
    "user_tags": [
      "yellow",
      "mytype",
      "once"
    ]
  }
}

Response

Field description: extobj

Example response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "f199b9f2-016c-b30f-e345-50e54938780c",
  "type": "mytype",
  "value": "{\"obj\":{\"name\":\"Obj\",\"no\":2}}",
  "opts": {
    "title": "Object 1",
    "comment": "third comment",
    "user_tags": [
      "yellow",
      "mytype",
      "once"
    ]
  },
  "ext": {
    "ct": "2019-08-21T07:24:18.62Z",
    "lwt": "2019-09-06T12:46:18.62Z"
  }
}

Deleting extobj

Request

Example request
DELETE /rest/v1/reference/extobjs/f199b9f2-016c-b30f-e345-50e54938780c HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for an object identifier

Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.

Key fields for search: id, type

Request

Example request
LOOKUP /rest/v1/reference/extobjs HTTP/1.1
Content-Type: application/json; charset=utf-8

"mytype"

Response

Example successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "f199b9f2-016c-b30f-e345-50e54938780c"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}