nodes_datalinks_create
const url = 'https://example.com/api/nodes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/datalinks';const options = { method: 'POST', headers: { 'X-Workspace': '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"data":"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/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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Workspace ID
Request Bodyrequired
Section titled “Request Bodyrequired”Serializer for the creation of a datalink.
object
Example generated
{ "data": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Serializer for the creation of a datalink.
object
Example generated
data=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0Serializer for the creation of a datalink.
object
Responses
Section titled “Responses”Serializer for the answer to the creation of a datalink.
object
Task enriching the data of the datalink, to follow with GET /api/tasks/{task_id}. Null when nothing is to be enriched.
False when the data was already linked to the node.
Serializer for Datalink.
object
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
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
Example generated
{ "task_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "created": true, "datalink": { "node": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "data": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }}Serializer for the answer to the creation of a datalink.
object
Task enriching the data of the datalink, to follow with GET /api/tasks/{task_id}. Null when nothing is to be enriched.
False when the data was already linked to the node.
Serializer for Datalink.
object
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
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
Example generated
{ "task_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "created": true, "datalink": { "node": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "data": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }}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": "data", "message": "This field is required", "code": "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", "message": "Not a member of the node.", "code": "unauthorized" } ]}
