Skip to content

Link API

This document provides detailed information about the links-related API endpoints available in the Constellation project.

Base

Description:

Retrieve all links in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "example_type",
      "attributes": {
        "link_uuid": 1
      }
    }
  ],
  "message": "All links successfully returned"
}

GET /constellation/{constellation_uuid}/link/node/{node_uuid}

Description:

Retrieve all links to/from a specific node in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • node_uuid (path): The unique identifier of the node.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "example_type",
      "attributes": {
        "link_uuid": 1
      }
    }
  ],
  "message": "All links successfully returned"
}

Description:

Retrieve a link by its UUID in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • link_uuid (path): The unique identifier of the link.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "example_type",
      "attributes": {
        "link_uuid": 1
      }
    }
  ],
  "message": "Link successfully returned"
}

POST /constellation/{constellation_uuid}/link

Description:

Create a new link in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Request Body:

  • start_node (body): The UUID of the start node.
  • end_node (body): The UUID of the end node.
  • link_type (body): The type of the link.
{
    "start_node": "0000-000000...",
    "end_node": "0000-000000...",
    "link_type": "string"
}

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "example_type",
      "attributes": {
        "link_uuid": 1
      }
    }
  ],
  "message": "Link successfully created"
}

Description:

Delete a link in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • link_uuid (path): The unique identifier of the link.

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "message": "Link successfully deleted"
}

Description:

Update a link in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • link_uuid (path): The unique identifier of the link.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Request Body:

  • new_start_node (body, optional): The new UUID of the start node.
  • new_end_node (body, optional): The new UUID of the end node.
  • new_link_type (body, optional): The new type of the link.
{
    "new_start_node": "0000-000000...",
    "new_end_node": "0000-000000...",
    "new_link_type": "string"
}

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "example_type",
      "attributes": {
        "link_uuid": 1
      }
    }
  ],
  "message": "Link successfully updated"
}

Attributes

Description:

Retrieve all attributes keys of a specific link in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • link_uuid (path): The unique identifier of the link.

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    [
      "attribute1",
      "attribute2",
      "attribute3"
    ]
  ],
  "message": "Attributes retrieved"
}

Description:

Retrieve the value of a specific attribute of a specific link in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • link_uuid (path): The unique identifier of the link.
  • attribute (path): The name of the attribute.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    "value1"
  ],
  "message": "Attribute retrieved"
}

Description:

Set the value of a specific attribute of a specific link in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • link_uuid (path): The unique identifier of the link.
  • attribute (path): The name of the attribute.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Request Body:

  • value (body): The new value for the attribute.
{
    "value": "new_value"
}

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "LINK",
      "attributes": {
        "link_uuid": 1,
        "attribute": "value"
      }
    }
  ],
  "message": "Attribute updated"
}

Description:

Delete a specific attribute of a specific link in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • link_uuid (path): The unique identifier of the link.
  • attribute (path): The name of the attribute.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "LINK",
      "attributes": {
        "link_uuid": 1,
        "attribute": "value"
      }
    }
  ],
  "message": "Attribute deleted"
}

POST /constellation/{constellation_uuid}/link/{link_uuid}/attribute/{attribute}

Description:

Add a new attribute to a link in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • link_uuid (path): The unique identifier of the link.
  • attribute (path): The name of the attribute.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Request Body:

  • value (body): The value for the attribute.
{
    "value": "new_value"
}

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "LINK",
      "attributes": {
        "link_uuid": 1,
        "attribute": "value"
      }
    }
  ],
  "message": "Attribute added"
}

GET /constellation/{constellation_uuid}/links/attribute/{attribute}

Description:

Retrieve all links with a specific attribute key in a constellation.

Request Parameters:

  • constellation_uuid (path): The unique identifier of the constellation.
  • attribute (path): The name of the attribute.
  • decode (query, optional): Set to None by default. If set to XML, xml, XML_TEXT or xml_text, the attributes containing ydoc data will be decoded to a readable format in an xml format. If set to PLAIN, plain, PLAIN_TEXT or plain_text, the attributes containing ydoc data will be decoded to a readable format in a plain text format. Else, the attributes will be returned in their original format.
  • in_filter (query, optional): A filter to include only specific attributes in the final results.
  • out_filter (query, optional): A filter to exclude specific attributes from the final results.

Response:

  • 200 OK: Returns user details.
  • 401 Unauthorized: User not authorized.
  • 403 Forbidden: User does not have permission to access the constellation.
  • 404 Not Found: Constellation not found.
  • 500 Internal Server Error: An error occurred while retrieving links.

Response Example:

{
  "success": true,
  "data": [
    {
      "start_node": 1,
      "end_node": 2,
      "type": "LINK",
      "attributes": {
        "link_uuid": 1,
        "attribute": "value"
      }
    }
  ],
  "message": "Links retrieved"
}