Skip to main content

Partially update an object

Jetmir Abdija avatar
Written by Jetmir Abdija
Updated this week

You can partially update an active object by setting the desired values for object attributes and passing them to the endpoint PATCH /objects/{id}. The body should contain only the elements with the values that need to be modified. However, if you decide to also include the elements that need to remain unchanged, please make sure the values are identical to the existing ones. Otherwise, unwanted changes will be applied to an object.

HTTP responses

HTTP response status code

Interpretation

200 OK

Object updated successfully

400 Bad Request

Object cannot be updated due to one or more parameters being missing or incorrect

401 Unauthorized

Invalid or missing API key secret and/or tenant

403 Forbidden

The user is not allowed to update objects of this type

Conditions

  • To update an object of a specific object type, you must have permissions for that object definition

  • The request body should contain the property object_title only if it needs to be changed

  • The request body should contain only the existing fields. No new object_properties or boem can be added using this request.

  • The request body must contain a valid boem id and boem item id for the updates on questionnaire responses to be successful

  • Updates on questionnaire responses will be ignored if the boem id or boem item id is incorrect

  • The maximum length of an object_properties value is 255 characters

To partially update an existing object, use the PATCH /objects/{id} endpoint specifying the following in your request:

  • Resource/endpoint destination URL. Replace the path parameter {id} with the ID of the object that you want to have updated.

  • The header for your API request

  • The request body, which should include only the values that need to be updated:

Property

Type

Mutable

Description

object_title

string

βœ“

The name of the object

object_properties

array

A list of object properties

object_lifecycle_state

string

The lifecycle state can be Current or Future.

object_properties[].name

string

X

The name of the object property

object_properties[].name_internal

string

X

The internal name of the object property

object_properties[].value

string

βœ“

The value of the object property

boem

array

A list of the questionnaires of the object

boem[].id

string

X

Unique identifier for the questionnaire

boem[].name

string

X

The name of the questionnaire

boem[].items

array

X

A list of questionnaire fields

boem[].items[].id

string

X

Unique identifier for the questionnaire field

boem[].items[].name

string

X

The name of the questionnaire field

boem[].items[].value

string

βœ“

The value of the questionnaire field (see the table Questionnaire field value validation)

boem[].items[].field_type

string

X

The type of the questionnaire field

Please note that all values provided for immutable properties will be ignored. If any immutable properties were included in your request, changes will not be applied, even though the response returns the 200 OK status code.

Questionnaire field value validation

Field type

Rules

Date

The value supplied needs to be in dd-MM-yyyy format

Text

The value supplied is capped to the configured MaxLength

RichText

The value supplied is "sanitized" to remove a possible HTML code injection

Multi

Supplied values are in the list of possible values. Values are separated by a pipe |

Dropdown

Supplied values are in the list of possible values

Multiselect dropdown

Supplied values are in the list of possible values. Values are separated by a pipe |

Checkbox

The value supplied is "yes" or "no".

Number

Values will be adjusted to the configured number of decimal places

Currency

Values will be adjusted to the configured number of decimal places

Relationship

Not supported

Please note that if a given value does not comply with the specified rules, it will be cleared or added a type-specific default value.

Here is an example API request of how to update an active object in the repository. Pass a request with the body which contains new values for object properties that need to be modified.

To make changes to questionnaire responses, the only fields that are required for every boem item are id and value.

curl -L -X PATCH 'https://public-api.eu.bluedolphin.app/v1/objects/643e9020d97c6a7e28775377' \
-H 'x-api-key: YOURAPIKEYSECRET' \
-H 'tenant: yourtenantname' \
-H 'Content-Type: application/json' \
-d '{
    "object_title": "New Application Name",
    "object_properties": [
        {
            "name": "Name",
            "value": "Application Update"
        }
    ],
    "boem": [
           {
            "id": "58edcaf2829327621dfff9e5",
            "name": "Application Info",
            "items": [
                {
                    "id": "dfbf6463-c17d-4107-8903-51cf0968267c",
                    "value": ""
                },
                {
                    "id": "e59a6e32-bef9-430c-86dc-9dbc31e49b46",
                    "value": ""
                },
                {
                    "id": "6cb46f87-b1a6-4fbd-9043-1f32b4a8f9d2",
                    "value": "532fff94b41281c17ce263b7|58a0378a63bab70ae83525d9"
                },
                {
                    "id": "c29271a2-7634-4abc-962a-bb2af522c547",
                    "value": ""
                }
            ]
        }
    ]
	}'

Response properties

Property

Type

Description

id

string

Unique identifier for the object

object_title

string

The name of the object

type

object

Object definition that the object is based on

workspace

object

Information on the workspace where the object is located (See the table Workspace)

created_information

object

Information on the creation of the object (See the table User information)

modified_information

object

Information on the modification of the object (See the table User information)

status

number

The status identifier of the object

object_properties

array

A list of object properties

object_properties[].name

string

The name of the object property

object_properties[].value

string

The value of the object property

boem

array

A list of the questionnaires of the object

boem[].id

string

Unique identifier for the questionnaire

boem[].name

string

The name of the questionnaire

boem[].items

array

A list of questionnaire fields

boem[].items[].id

string

Unique identifier for the questionnaire field

boem[].items[].name

string

The name of the questionnaire field

boem[].items[].value

string

The value of the questionnaire field

boem[].items[].field_type

string

The type of the questionnaire field

related_objects

array

A list of accepted/active related objects

related_objects[].relationship_id

string

The identifier of the relationship

related_objects[].object_id

string

The identifier of the related object

related_objects[].object_title

string

The name of the related object

related_objects[].type

object

Object definition that the related object is based on

related_objects[].relationship

object

Relationship type that the relationship is based on

Workspace

Property

Type

Description

id

string

Unique identifier for the workspace

name

string

The name of the workspace

User information

Property

Type

Description

date

string

The stringed version of the ISO date and time

user_id

string

Unique identifier for the user

first_name

string

The first name of the user

last_name

string

The last name of the user

A successful call returns a response with a 200 OK HTTP status code and the following body:

{
    "id": "643e9020d97c6a7e28775377",
    "object_title": "New Application Name",
"object_lifecycle_state": "Future", "type": { "id": "640b3d7d4a28b925fcf8b9b4", "name": "Application", "name_internal": "application_component" }, "workspace": { "id": "63f621863279a10a8eefa7a9", "name": "mainworkspace" }, "created_information": { "user_id": "63f6322c275ab8fea702f9b7", "first_name": "Hannah", "last_name": "Blake", "date": "2023-04-18T12:42:08.075Z" }, "modified_information": { "user_id": "000000000000000000000000", "first_name": "BlueDolphin", "last_name": "", "date": "2023-06-22T19:25:23.021Z" }, "status": 2, "object_properties": [ { "name": "Name", "value": "Aplication Update" } ], "boem": [ { "id": "58edcaf2829327621dfff9e5", "name": "Application Info", "items": [ { "field_type": "dropdown", "id": "dfbf6463-c17d-4107-8903-51cf0968267c", "name": "Is this application Single Point of Failure (SPOF)?", "value": "" }, { "field_type": "currency", "id": "e59a6e32-bef9-430c-86dc-9dbc31e49b46", "name": "Estimate of annual application costs", "value": "" }, { "field_type": "relation", "id": "6cb46f87-b1a6-4fbd-9043-1f32b4a8f9d2", "name": "What are the functions of this application?", "value": "532fff94b41281c17ce263b7|58a0378a63bab70ae83525d9" }, { "field_type": "dropdown", "id": "c29271a2-7634-4abc-962a-bb2af522c547", "name": "Which stadium applies to this application?", "value": "" } ] } ], "related_objects": [ { "relationship_id": "21435a647f12172fc4cc72f0", "object_id": "64369407346524508417d7b2", "object_title": "Acquisition and development of building lots", "type": { "id": "5d25c4bc0c0ba6e79c23d123", "name": "Business Process", "name_internal": "business_process" }, "relationship": { "template_id": "5123e9d68ccee096c838fe93", "name": "used by", "type": "usedby" } } ] }
Did this answer your question?