Skip to main content

POST /links

Description

Adds a new link and returns a JSON object containing the new link ID

This route processes HTTP POST requests sent to the /links endpoint.

Payload

The server expects a JSON object with the following properties:

NameTypeDescription
masterIdnumber or stringRequired. The ID of the master link.
slaveIdnumber or stringRequired. The ID of the slave link.
relationstringRequired. Defines the type of relation the link represents.

Example:

{
"masterId": 1,
"slaveId": 2,
"relation": "relatesTo",
}

Response

The response returns a JSON object with the ID of the newly created link.

Example:

{ 
"id": 1
}

The HTTP status code indicates if the request was successful (response.status == 200) or if it failed (response.status == 500).


Related articles: