You can partially update a relationship by setting the desired values for relationship attributes and passing them to the endpoint PATCH /relations/{id}
. The body should contain only the elements with the values that need to be modified.
HTTP responses
HTTP response status code |
Interpretation |
---|---|
200 OK |
Relationship updated successfully |
400 Bad Request |
Relationship 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 this relationship |
To partially update an existing relationship, use the PATCH /relations/{id}
endpoint specifying the following in your request:
-
Resource/endpoint destination URL. Replace the path parameter {id} with the ID of the relationship 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 |
---|---|---|---|
remark |
string |
✓ |
The remark/label of the relationship |
boem |
array |
|
Information on the relationship questionnaire |
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[].field_type |
string |
X |
One of the listed values:
|
boem[].items[].name |
string |
X |
The name of the questionnaire field |
boem[].items[].value |
string |
✓ |
The value 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 types
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.
Here is an example API request of how to update a questionnaire with multiple fields for an existing relationship. Pass a request with the body which includes the changed values for the questionnaire New Form
.
In the following example, immutable properties name
and field_type
will be ignored. We will, however, display all fields in the request body for the sake of consistency.
curl -L -X PATCH 'https://public-api.eu.bluedolphin.app/v1/relations/645a3daf3c2a798611bb0dfc' \
-H 'x-api-key: YOURAPIKEYSECRET' \
-H 'tenant: yourtenantname' \
-H 'Content-Type: application/json' \
-d '{
"remark": "",
"boem": [
{
"id": "6552362cc653174bfa27d4a1",
"name": "New Form",
"items": [
{
"field_type": "checkbox",
"id": "35082bda-c0d3-4f37-99bb-dc69c735fc34",
"name": "Checkbox",
"value": "yes"
},
{
"field_type": "date",
"id": "2a80a635-1847-4540-aad6-935194a40741",
"name": "Date",
"value": "01-05-2023"
},
{
"field_type": "multiselect",
"id": "e35d3076-1833-49f8-8b03-2b72d676dc77",
"name": "Dropdown multiple select",
"value": "Answer 3"
},
{
"field_type": "hyperlink",
"id": "007e36d0-8d8d-4390-8430-638c7096c58d",
"name": "Hyperlink",
"value": "https://google.com"
},
{
"field_type": "multiline",
"id": "cf1606ca-8889-4c98-8b8d-794331f9528d",
"name": "Multiple text lines",
"value": "Hello"
},
{
"field_type": "number",
"id": "55d13af5-f68e-4f13-936f-86bacafa2a60",
"name": "Number",
"value": "321"
},
{
"field_type": "text",
"id": "9bde0475-0f1c-4c1a-8fb8-9e4dbaf51ee2",
"name": "Text",
"value": "Lorem Ipsum"
},
{
"field_type": "richtext",
"id": "9e0e1c13-1cbe-4cfe-a2f3-8057bab5c5fe",
"name": "Formatted text",
"value": "Hello"
},
{
"field_type": "currency",
"id": "fc06f15a-e8af-4804-943d-450cde9b3b49",
"name": "Currency dollar",
"value": "999.99"
}
]
}
]
}'
A successful call returns a response with a 200 OK
HTTP status code and the following body:
"Ok"
Comments
0 comments
Please sign in to leave a comment.