Skip to content

nodes_datalinks_create

POST
/api/nodes/{node_pk}/datalinks
curl --request POST \
--url https://example.com/api/nodes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/datalinks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Workspace: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--data '{ "data": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Link a data to the node.

The datalink is created at once, and its data is read again from its source in the background, with its metadata and associations, by the task identified by task_id: the same task as for a batch of datalinks. A data that failed to be enriched turns in progress again; one that is active stays so while it is refreshed. A data already being enriched for another node is left to that task, and no task is queued.

A data already linked to the node is returned with created: false and left untouched. The answer is a 202 when a task was queued, a 200 otherwise.

node_pk
required
string format: uuid
X-Workspace
required
string format: uuid

Workspace ID

Serializer for the creation of a datalink.

object
data
required
string format: uuid

Example generated

{
"data": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
Media typeapplication/json

Serializer for the answer to the creation of a datalink.

object
task_id
required

Task enriching the data of the datalink, to follow with GET /api/tasks/{task_id}. Null when nothing is to be enriched.

string format: uuid
nullable
created
required

False when the data was already linked to the node.

boolean
datalink
required

Serializer for Datalink.

object
id
required
string format: uuid
node
required
string format: uuid
data
required
string format: uuid
data_obj
required

Return serialized data object with request context.

Parameters

obj : DataLink The object containing the data that needs to be serialized.

Returns

DatalinkDataSerializer A DatalinkDataSerializer object is being returned, with the data attribute of the input obj and the context set to include the request from the current context.

object
key
additional properties
created_by
required

Return the interactor information of the object’s creator.

Parameters

obj : DataLink The object containing the creator information.

Returns

dict The interactor information of the creator.

object
key
additional properties
created_time
required
string format: date-time

Example generated

{
"task_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"created": true,
"datalink": {
"node": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"data": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
}
Media typeapplication/json

Serializer for the answer to the creation of a datalink.

object
task_id
required

Task enriching the data of the datalink, to follow with GET /api/tasks/{task_id}. Null when nothing is to be enriched.

string format: uuid
nullable
created
required

False when the data was already linked to the node.

boolean
datalink
required

Serializer for Datalink.

object
id
required
string format: uuid
node
required
string format: uuid
data
required
string format: uuid
data_obj
required

Return serialized data object with request context.

Parameters

obj : DataLink The object containing the data that needs to be serialized.

Returns

DatalinkDataSerializer A DatalinkDataSerializer object is being returned, with the data attribute of the input obj and the context set to include the request from the current context.

object
key
additional properties
created_by
required

Return the interactor information of the object’s creator.

Parameters

obj : DataLink The object containing the creator information.

Returns

dict The interactor information of the creator.

object
key
additional properties
created_time
required
string format: date-time

Example generated

{
"task_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"created": true,
"datalink": {
"node": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"data": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
}
Media typeapplication/json
object
code
required
string
>= 1 characters
message
required
string
>= 1 characters
details
required
Array<object>
object
parameter
string
nullable
code
string
nullable
message
string

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": "data",
"message": "This field is required",
"code": "required"
}
]
}
Media typeapplication/json
object
code
required
string
>= 1 characters
message
required
string
>= 1 characters
details
required
Array<object>
object
parameter
string
nullable
code
string
nullable
message
string

Example

{
"code": "forbidden",
"message": "You do not have permission to perform this operation. Check the `details` property for more details.",
"details": [
{
"parameter": "node",
"message": "Not a member of the node.",
"code": "unauthorized"
}
]
}