POST
/api/v2/clients/{client_id}/linksCreate a link between two tasks across projects
Code samples
# You can also use wget
curl -X POST /api/v2/clients/{client_id}/links \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST /api/v2/clients/{client_id}/links HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"startTaskUuid": "550e8400-e29b-41d4-a716-446655440001",
"finishTaskUuid": "550e8400-e29b-41d4-a716-446655440002",
"startDateTime": 1700000000,
"finishDateTime": 1700860000,
"typeLink": 0,
"typeDelay": 0,
"delayTime": 3,
"delayRelative": false,
"rgbColor": 16711680,
"bold": true,
"confirmed": false
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/api/v2/clients/{client_id}/links',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post '/api/v2/clients/{client_id}/links',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v2/clients/{client_id}/links', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v2/clients/{client_id}/links', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/clients/{client_id}/links");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v2/clients/{client_id}/links", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v2/clients/{client_id}/links
Creates a link between two tasks that can belong to different projects. This allows for cross-project dependencies and relationships.
Body parameter
{
"startTaskUuid": "550e8400-e29b-41d4-a716-446655440001",
"finishTaskUuid": "550e8400-e29b-41d4-a716-446655440002",
"startDateTime": 1700000000,
"finishDateTime": 1700860000,
"typeLink": 0,
"typeDelay": 0,
"delayTime": 3,
"delayRelative": false,
"rgbColor": 16711680,
"bold": true,
"confirmed": false
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| client_id | path | integer | true | Client ID |
| body | body | LinkItem | true | Link data |
Example responses
201 Response
{
"status": "success",
"code": 201,
"message": "Link successfully created",
"details": {
"startTaskUuid": "550e8400-e29b-41d4-a716-446655440001",
"finishTaskUuid": "550e8400-e29b-41d4-a716-446655440002",
"startDateTime": 1700000000,
"finishDateTime": 1700860000,
"typeLink": 0,
"typeDelay": 0,
"delayTime": 3,
"delayRelative": false,
"rgbColor": 16711680,
"bold": true,
"confirmed": false
}
}
401 Response
{
"status": "error",
"code": 401,
"message": "Authentication failed",
"details": "JWT token not found"
}
403 Response
{
"status": "error",
"code": 403,
"message": "Access denied",
"details": "Insufficient permissions"
}
404 Response
{
"status": "error",
"code": 404,
"message": "Not found",
"details": "The requested resource was not found"
}
500 Response
{
"status": "error",
"code": 500,
"message": "Internal server error",
"details": "An internal server error occurred"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Link created | Inline |
| 401 | Unauthorized | Authentication error (JWT token missing/invalid) | ErrorResponse |
| 403 | Forbidden | Access denied (insufficient permissions) | ErrorResponse |
| 404 | Not Found | Resource not found | ErrorResponse |
| 500 | Internal Server Error | Internal server error | ErrorResponse |
Response Schema
Status Code 201
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » status | string | false | none | none |
| » code | integer | false | none | none |
| » message | string | false | none | none |
| » details | LinkItem | false | none | none |
| »» startTaskUuid | string(uuid) | true | none | Start task UUID |
| »» finishTaskUuid | string(uuid) | true | none | Finish task UUID |
| »» startDateTime | integer | true | none | Link start time (timestamp) |
| »» finishDateTime | integer | true | none | Link finish time (timestamp) |
| »» typeLink | integer | true | none | Link type (e.g. Finish-Start, Start-Start) |
| »» typeDelay | integer | false | none | Delay type (e.g. work days, calendar days) |
| »» delayTime | integer | false | none | Delay time in units according to typeDelay |
| »» delayRelative | boolean | false | none | Whether the delay is relative |
| »» rgbColor | integer | false | none | Link RGB color |
| »» bold | boolean | false | none | Whether the link is displayed in bold |
| »» confirmed | boolean | false | none | Whether the link is confirmed |
