Skip to main content

POST /links

Description

Creates a new link and returns a json object with a new link ID

The route handles the HTTP POST request made to the /links path.

Payload

The server expects to receive a json object with the next properties:

NameTypeDescription
masterIdnumber or stringRequired. The ID of a master link.
slaveIdnumber or stringRequired. The ID of a slave link.
relationstringRequired. The type of the relation created by the link.

Example:

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

Response

The route returns a json object with a new link ID.

Example:

{ 
"id": 1
}

The HTTP status code shows whether the request succeeds (response.status == 200) or fails (response.status == 500).


Related articles: