UI Extensions API

List UI extensions

List all UI extensions for an account:

GET /ui_extensions

Response

Status: 200 OK
[
  {
    "id": 3,
    "name": "Location Move",
    "disabled": false,
    "created_at": "2016-03-18T19:04:06-05:00",
    "updated_at": "2016-03-18T19:04:06-05:00",
    "active_version": {
      "id": 7,
      "name": "Location Move",
      "version": 1
    },
    "prepared_version": {
      "id": 8,
      "name": "Location Move",
      "version": 2
    }
  },
  {
    "id": 2,
    "name": "SAP Finance field option",
    "disabled": false,
    "created_at": "2016-03-18T19:04:06-05:00",
    "updated_at": "2016-03-18T19:04:06-05:00",
    "active_version": {
      "id": 5,
      "name": "SAP Finance field option",
      "version": 1
    },
    "prepared_version": {
      "id": 6,
      "name": "SAP Finance field option",
      "version": 2
    }
  }
]

The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of UI extensions.

Collection Fields

By default the following fields will appear in collections of UI extensions:

active_version created_at disabled id name prepared_version updated_at

Obtain a different set of fields using the ?fields= parameter.

Sorting

By default a collection of UI extensions is sorted ascending by name.

The following fields are accepted by the ?sort= parameter:

id name created_at updated_at

Get a single UI extension

GET /ui_extensions/:id

Response

Status: 200 OK
{
  "active_version": {
    "id": 7,
    "name": "Location Move",
    "version": 1
  },
  "category": "request_template",
  "created_at": "2016-03-18T19:04:06-05:00",
  "css": ".row.subject {\n  display: none;\n}",
  "disabled": false,
  "html": "<div class=\"row vertical\">\n  <label for=\"move_from\">Move from\n  <input id=\"move_from\" type=\"text\" class=\"required add-to-subject\">\n\n\n<div class=\"row vertical\">\n  <label for=\"move_to\">Move to\n  <input id=\"move_to\" type=\"text\" class=\"required add-to-subject\">\n",
  "id": 3,
  "javascript": null,
  "name": "Location Move",
  "phrases": [
    "Move from",
    "Move to"
  ],
  "prepared_version": {
    "id": 8,
    "name": "Location Move",
    "version": 2
  },
  "compiled_css": ".row.subject {\n  display: none; }\n",
  "localized_html": "\n<div class=\"row vertical\"><label for=\"move_from\">Verplaats van<input id=\"move_from\" type=\"text\" class=\"required add-to-subject\">\n<div class=\"row vertical\"><label for=\"move_to\">Verplaats naar<input id=\"move_to\" type=\"text\" class=\"required add-to-subject\">\n\n",
  "title": "Information",
  "localized_title": "Informatie",
  "updated_at": "2016-03-18T19:04:06-05:00"
}

The response contains these fields.

Create a UI extension

POST /ui_extensions

When creating a new UI extension these fields are available.

Response

Status: 201 Created
{
  "name": "...",
  "...": "..."
}

The response contains all fields of the created UI extension and is similar to the response in Get a single UI extension

Update a UI extension

PATCH /ui_extensions/:id

When updating a UI extension these fields are available.

Response

Status: 200 OK
{
  "name": "...",
  "...": "..."
}

The response contains all fields of the updated UI extension and is similar to the response in Get a single UI extension

Fields

activate
Optional boolean, default: false — Set to true to promote the Prepared Version to the Active Version. If the was an Active Version, it will be Archived.
active_version
Readonly Optional reference to UI extension Version The version with Status active.
category
Required enum — The Category field is used to select the type of record in which the UI extension can be selected. Valid values are:
  • request_template: Request Template
  • change_template: Change Template
  • task_template: Task Template
  • project: Project
  • project_task_template: Project Task Template
  • product: Product
  • contract: Contract
  • organization: Organization
  • person: Person
  • site: Site
compiled_css
Readonly text (max 64KB) — The compiled CSS stylesheet of the Active Version (if available).
created_at
Readonly datetime — The date and time at which the UI extension was created.
css
Optional text (max 64KB) — The CSS stylesheet; Shows the CSS stylesheet of the Active Version on retrieval and sets the CSS stylesheet of the Prepared Version if updated.
disabled
Optional boolean, default: false — The Disabled box is checked when the UI extension is inactive.
html
Optional text (max 64KB) — The HTML code; Shows the HTML code of the Active Version on retrieval and sets the HTML code of the Prepared Version if updated.
id
Readonly integer — The unique ID of the UI extension.
javascript
Optional text (max 64KB) — The Javascript code; Shows the Javascript code of the Active Version on retrieval and sets the Javascript code of the Prepared Version if updated.
localized_html
Readonly text (max 64KB) — The HTML code of the Active Version with all phrases translated in the current users locale (if available).
name
Required string (max 190) — The Name field is used to enter the name of the UI extension.
phrases
Readonly array — The translatable phrases used in the version with Status active.
prepared_version
Readonly reference to UI Extension Version The version with Status being prepared.
title
Optional string — The Title field is used to enter the text that is to be displayed as the section header above the UI extension when the UI extension is presented within a form.
updated_at
Readonly datetime — The date and time of the last update of the UI extension. If the UI extension has no updates it contains the created_at value.