data_associations_metadata_create
const url = 'https://example.com/api/data/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/associations/example/metadata';const options = { method: 'POST', headers: { 'X-Workspace': '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"madbot_field":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","plugin_field":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","value":"example","selected_value":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/data/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/associations/example/metadata \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-Workspace: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --data '{ "madbot_field": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "plugin_field": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "value": "example", "selected_value": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Create metadata for a node/sample/data/data-association. When X-Batch: true is provided, the request body must be a JSON array and the endpoint performs batch create in one transaction.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Set to true to enable batch create mode. In batch mode, body must be a JSON array of metadata items.
Workspace ID
Query Parameters
Section titled “Query Parameters”Datalink ID specific to the provided data
Request Body
Section titled “Request Body”Serializer for Metadata model during create.
object
Example generated
{ "madbot_field": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "plugin_field": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "value": "example", "selected_value": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Serializer for Metadata model during create.
object
Example generated
madbot_field=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&plugin_field=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&value=example&selected_value=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0Serializer for Metadata model during create.
object
Responses
Section titled “Responses”Serializer for Metadata model.
object
Dynamically return the correct metadata field (madbot_field or plugin_field).
Parameters
obj : Metadata The Metadata instance.
Returns
dict Serialized data of the related metadata field.
object
Retrieve the history of the metadata object.
Parameters
obj : object
The object that has a history attribute.
Returns
list A list of dictionaries containing the history of the metadata object, where each dictionary includes the history ID, date, value, and editor information.
object
Return the interactor information of the object’s creator.
Parameters
obj : object The object containing the creator information.
Returns
dict The interactor information of the creator.
object
Return information about the last interactor who edited the object.
Parameters
obj : object The object containing the last editor information.
Returns
dict The interactor information of the last editor.
object
Example generated
{ "value": "example"}Serializer for Metadata model.
object
Dynamically return the correct metadata field (madbot_field or plugin_field).
Parameters
obj : Metadata The Metadata instance.
Returns
dict Serialized data of the related metadata field.
object
Retrieve the history of the metadata object.
Parameters
obj : object
The object that has a history attribute.
Returns
list A list of dictionaries containing the history of the metadata object, where each dictionary includes the history ID, date, value, and editor information.
object
Return the interactor information of the object’s creator.
Parameters
obj : object The object containing the creator information.
Returns
dict The interactor information of the creator.
object
Return information about the last interactor who edited the object.
Parameters
obj : object The object containing the last editor information.
Returns
dict The interactor information of the last editor.
object
Example generated
{ "value": "example"}object
object
Example
{ "code": "body_validation_error", "message": "The request body does not match the schema for the expected parameters. Check the `details` property for more details.", "details": [ { "parameter": "<parameter>", "code": "required", "message": "This field is required." } ]}object
object
Example
{ "code": "forbidden", "message": "You do not have permission to perform this operation. Check the `details` property for more details.", "details": [ { "parameter": "node", "code": "not_allowed", "message": "The member's role does not allow creation." } ]}object
object
Example
{ "code": "object_not_found", "message": "Object not found. Check the `details` property for more details.", "details": [ { "parameter": "<id>", "code": "does_not_exist", "message": "\"<id>\" does not exist." } ]}
