JSON API: Manage Domains

Refer to the domain schema for a formal definition of the request and the domain response schema for a definition of the response.

Route: domain/add

Sample request:

{
  "code": "ENG",
  "names": [
    {
      "name": "Engineering",
      "language": "en"
    },
    {
      "name": "la machination",
      "language": "fr"
    }
  ],
  "currency": "CAD"
}

Sample response:

{
  "domain": {
    "uuid": "2da08cab-6de0-43db-8b39-de5a1e484b9d",
    "code": "ENG",
    "currency": "CAD",
    "names":[
      {
        "name": "Engineering",
        "language": "en",
        "createdAt": "2021-12-22T05:28:27.776353Z",
        "updatedAt": "2021-12-22T05:28:27.776353Z"
      },
      {
        "name": "la machination",
        "language": "fr",
        "createdAt": "2021-12-22T05:28:27.779119Z",
        "updatedAt": "2021-12-22T05:28:27.779119Z"
      }
    ],
    "revision": "10b15d680033c4622d6616ff1204be9c291e246d43e898471d570a41fab3bb04",
    "createdAt": "2021-12-22T05:28:27.774975Z",
    "updatedAt": "2021-12-22T05:28:27.774975Z"
  },
  "time":"2021-12-22T05:28:27.782361Z"
}

Route: domain/delete

Sample request:

{
  "code": "ENG",
  "revision": "10b15d680033c4622d6616ff1204be9c291e246d43e898471d570a41fab3bb04"
}

Sample response:

{
  "success":true,
  "time":"2021-12-29T05:40:36.037363Z"
}

Route: domain/get

Sample request:

{
  "code": "ENG"
}

Sample response:

{
  "domain": {
    "uuid": "212b3cef-a74c-4196-b24f-65873d393be5",
    "code": "ENG",
    "currency": "CAD",
    "names": [
      {
        "name": "Engineering",
        "language": "en",
        "createdAt": "2021-12-22T05:28:27.776353Z",
        "updatedAt": "2021-12-22T05:28:27.776353Z"
      },
      {
        "name": "la machination",
        "language": "fr",
        "createdAt": "2021-12-22T05:28:27.779119Z",
        "updatedAt": "2021-12-22T05:28:27.779119Z"
      }
    ],
    "revision": "476436260c6592a6ef600966b1f6c3c45a6993762fb789e3c03382e1f41e967c",
    "createdAt": "2021-12-29T05:42:31.552523Z",
    "updatedAt": "2021-12-29T05:42:31.552523Z"
  },
  "time": "2021-12-29T05:42:31.620366Z"
}

Route: domain/update

Sample request:

{
  "code": "ENG",
  "names": [
    {
      "name": "Engineering and Development",
      "language": "en"
    },
    {
      "name": "Ingénierie et développement",
      "language": "fr"
    }
  ],
  "toCode": "ENGDEV",
  "revision": "476436260c6592a6ef600966b1f6c3c45a6993762fb789e3c03382e1f41e967c"
}

Sample response:

{
  "domain": {
    "uuid": "370dcc6d-752a-4a16-8960-18582bdb97fb",
    "code": "ENGDEV",
    "currency": "CAD",
    "names": [
      {
        "name": "Engineering and Development",
        "language": "en",
        "createdAt": "2021-12-29T05:48:01.599547Z",
        "updatedAt": "2021-12-29T05:48:01.599547Z"
      },
      {
        "name": "Ingénierie et développement",
        "language": "fr",
        "createdAt": "2021-12-29T05:48:01.601349Z",
        "updatedAt": "2021-12-29T05:48:01.601349Z"
      }
    ],
    "revision": "62ca859cb376e59170bfcbf047641783559719bfce6bc230746427a3f420b8e6",
    "createdAt": "2021-12-29T05:48:01.597451Z",
    "updatedAt": "2021-12-29T05:48:01.597451Z"
  },
  "time": "2021-12-29T05:48:01.683039Z"
}