Task Dependency
This module covers operations related to task dependencies within Zoho Projects. Use this API to add, retrieve, update, or delete task dependencies.
This module covers operations related to task dependencies within Zoho Projects. Use this API to add, retrieve, update, or delete task dependencies.
Create a dependency between two tasks in a project.
OAuth Scope:
ZohoProjects.tasks.READ
String
requiredUnique, immutable identifier of the portal in Zoho Projects. You can obtain it from the Get Portals API (the "id" field in the response).
String
requiredUnique, immutable identifier of the project within the specified portal. You can obtain it from the Get Projects API (the "id" field in the response).
JSONObject
requiredEnter the details of the predecessor task.
JSONObject
requiredEnter the details of the successor task.
String
Specify the type of dependency between the tasks. Accepted values: FS, FF, SF, SS, AutoSet
String
Specify the dependency link type. Accepted values: 0 for Hard Link, 1 for Soft Link
JSONObject
Enter the lag details to apply between the predecessor and successor tasks.
Request Example
curl -X POST \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa' \
-H 'Content-Type: application/json' \
-d '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency";
params = Map();
params.put("predecessor_task", {"id":"4000000062005"});
params.put("successor_task", {"id":"4000000062005"});
params.put("dependency_type", "FS");
params.put("link_type", "0");
params.put("lag", {"value":"2","type":"days"});
response = invokeUrl
[
url: url
type: POST
parameters: params.toString()
connection: "projects"
];
info response;
const https = require('https');
const url = new URL('https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency');
const payload = JSON.stringify({"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}});
const options = {
hostname: url.hostname,
path: url.pathname + url.search,
method: 'POST',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(payload)
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => { data += chunk; });
res.on('end', () => { console.log(JSON.parse(data)); });
});
req.on('error', (err) => { console.error(err); });
req.write(payload);
req.end();
require 'net/http'
require 'uri'
require 'json'
url = URI("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
request["Content-Type"] = "application/json"
request.body = '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
response = http.request(request)
puts response.read_body
<?php
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}',
CURLOPT_HTTPHEADER => [
"Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
headers = {
"Authorization": "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type": "application/json",
}
payload = '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
response = requests.post(url, headers=headers, data=payload)
print(response.json())
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}");
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK)
fprintf(stderr, "curl failed: %s\n", curl_easy_strerror(res));
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}
using System.Net.Http;
using System.Text;
using System.Web;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
var request = new HttpRequestMessage(HttpMethod.Post, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
request.Content = new StringContent(
@"{""predecessor_task"":{""id"":""4000000062005""},""successor_task"":{""id"":""4000000062005""},""dependency_type"":""FS"",""link_type"":""0"",""lag"":{""value"":""2"",""type"":""days""}}",
Encoding.UTF8,
"application/json"
);
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* output) {
output->append((char*)contents, size * nmemb);
return size * nmemb;
}
int main() {
CURL* curl = curl_easy_init();
if (curl) {
std::string response;
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}");
CURLcode res = curl_easy_perform(curl);
if (res == CURLE_OK)
std::cout << response << std::endl;
else
std::cerr << curl_easy_strerror(res) << std::endl;
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}
(require '[clj-http.client :as client])
(def response
(client/post "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
{:headers {"Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" "application/json"}
:body "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}"
:as :json}))
(println (:body response))
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader("{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}")
req, _ := http.NewRequest("POST", "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency", payload)
req.Header.Add("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
req.Header.Add("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
POST https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency
Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa
Content-Type: application/json
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
SSLContext sslContext = SSLContext.getDefault();
SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE);
CloseableHttpClient httpclient = httpClientBuilder.setSSLSocketFactory(sslConnectionSocketFactory).build();
URIBuilder uriBuilder = new URIBuilder("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
HttpUriRequest requestObj = new HttpPost(uriBuilder.build());
requestObj.addHeader("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
HttpEntityEnclosingRequestBase requestBase = (HttpEntityEnclosingRequestBase) requestObj;
String requestBody = "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}";
requestBase.setEntity(new StringEntity(requestBody, HTTP.UTF_8));
HttpResponse response = httpclient.execute(requestObj);
HttpEntity responseEntity = response.getEntity();
Object responseObject = EntityUtils.toString(responseEntity);
String responseString = responseObject.toString();
const url = 'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency';
const options = {
method: 'POST',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json'
},
body: JSON.stringify({"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}})
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}import java.net.HttpURLConnection
import java.net.URL
import okhttp3.HttpUrl.Companion.toHttpUrl
fun main() {
val url = URL("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")
val conn = url.openConnection() as HttpURLConnection
conn.requestMethod = "POST"
conn.setRequestProperty("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
conn.setRequestProperty("Content-Type", "application/json")
conn.doOutput = true
conn.outputStream.bufferedWriter().use { it.write("""{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}""") }
val response = conn.inputStream.bufferedReader().readText()
println(response)
}
NSURL *url = [NSURL URLWithString:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa" forHTTPHeaderField:@"Authorization"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSData *body = [@"{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}" dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:body];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@", result);
}];
[task resume];
open Lwt
open Cohttp_lwt_unix
let () =
let uri = Uri.of_string "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency" in
let headers = Cohttp.Header.init ()
|> fun h -> Cohttp.Header.add h "Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
|> fun h -> Cohttp.Header.add h "Content-Type" "application/json"
in
let body = Cohttp_lwt.Body.of_string {json|{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}|json} in
Lwt_main.run (
Client.post ~headers ~body uri >>= fun (_, body) ->
Cohttp_lwt.Body.to_string body >|= fun s ->
print_endline s)
$headers = @{
"Authorization" = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" = "application/json"
}
$body = @'
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
'@
$response = Invoke-RestMethod -Uri "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency" -Method POST -Headers $headers -Body $body
$response | ConvertTo-Json
library(httr)
url <- "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
response <- POST(
url,
add_headers(Authorization = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"),
content_type_json(),
body = "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}"
)
content(response, "text")
import Foundation
let url = URL(string: "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = """
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
""".data(using: .utf8)
let semaphore = DispatchSemaphore(value: 0)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let data = data, let result = String(data: data, encoding: .utf8) {
print(result)
}
semaphore.signal()
}
task.resume()
semaphore.wait()
Sample Input
Sample Response
Remove a task dependency between tasks in a project.
OAuth Scope:
ZohoProjects.tasks.READ
String
requiredUnique, immutable identifier of the portal in Zoho Projects. You can obtain it from the Get Portals API (the "id" field in the response).
String
requiredUnique, immutable identifier of the project within the specified portal. You can obtain it from the Get Projects API (the "id" field in the response).
JSONObject
requiredEnter the predecessor task details.
JSONObject
requiredEnter the successor task details.
String
Specify the dependency type. Accepted values: FS, FF, SF or SS.
String
Specify the dependency link type. Accepted values: 0 - Hard Link or 1 - Soft Link.
JSONObject
Enter the lag details.
Request Example
curl -X DELETE \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa' \
-H 'Content-Type: application/json' \
-d '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency";
params = Map();
params.put("predecessor_task", {"id":"4000000062005"});
params.put("successor_task", {"id":"4000000062005"});
params.put("dependency_type", "FS");
params.put("link_type", "0");
params.put("lag", {"value":"2","type":"days"});
response = invokeUrl
[
url: url
type: DELETE
parameters: params.toString()
connection: "projects"
];
info response;
const https = require('https');
const url = new URL('https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency');
const payload = JSON.stringify({"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}});
const options = {
hostname: url.hostname,
path: url.pathname + url.search,
method: 'DELETE',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(payload)
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => { data += chunk; });
res.on('end', () => { console.log(JSON.parse(data)); });
});
req.on('error', (err) => { console.error(err); });
req.write(payload);
req.end();
require 'net/http'
require 'uri'
require 'json'
url = URI("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
request["Content-Type"] = "application/json"
request.body = '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
response = http.request(request)
puts response.read_body
<?php
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}',
CURLOPT_HTTPHEADER => [
"Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
headers = {
"Authorization": "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type": "application/json",
}
payload = '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
response = requests.delete(url, headers=headers, data=payload)
print(response.json())
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}");
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK)
fprintf(stderr, "curl failed: %s\n", curl_easy_strerror(res));
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}
using System.Net.Http;
using System.Text;
using System.Web;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
var request = new HttpRequestMessage(HttpMethod.Delete, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
request.Content = new StringContent(
@"{""predecessor_task"":{""id"":""4000000062005""},""successor_task"":{""id"":""4000000062005""},""dependency_type"":""FS"",""link_type"":""0"",""lag"":{""value"":""2"",""type"":""days""}}",
Encoding.UTF8,
"application/json"
);
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* output) {
output->append((char*)contents, size * nmemb);
return size * nmemb;
}
int main() {
CURL* curl = curl_easy_init();
if (curl) {
std::string response;
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}");
CURLcode res = curl_easy_perform(curl);
if (res == CURLE_OK)
std::cout << response << std::endl;
else
std::cerr << curl_easy_strerror(res) << std::endl;
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}
(require '[clj-http.client :as client])
(def response
(client/delete "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
{:headers {"Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" "application/json"}
:body "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}"
:as :json}))
(println (:body response))
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader("{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}")
req, _ := http.NewRequest("DELETE", "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency", payload)
req.Header.Add("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
req.Header.Add("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
DELETE https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency
Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa
Content-Type: application/json
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
SSLContext sslContext = SSLContext.getDefault();
SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE);
CloseableHttpClient httpclient = httpClientBuilder.setSSLSocketFactory(sslConnectionSocketFactory).build();
URIBuilder uriBuilder = new URIBuilder("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
HttpUriRequest requestObj = new HttpDelete(uriBuilder.build());
requestObj.addHeader("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
HttpResponse response = httpclient.execute(requestObj);
HttpEntity responseEntity = response.getEntity();
Object responseObject = EntityUtils.toString(responseEntity);
String responseString = responseObject.toString();
const url = 'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency';
const options = {
method: 'DELETE',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json'
},
body: JSON.stringify({"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}})
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}import java.net.HttpURLConnection
import java.net.URL
import okhttp3.HttpUrl.Companion.toHttpUrl
fun main() {
val url = URL("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")
val conn = url.openConnection() as HttpURLConnection
conn.requestMethod = "DELETE"
conn.setRequestProperty("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
conn.setRequestProperty("Content-Type", "application/json")
conn.doOutput = true
conn.outputStream.bufferedWriter().use { it.write("""{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}""") }
val response = conn.inputStream.bufferedReader().readText()
println(response)
}
NSURL *url = [NSURL URLWithString:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"DELETE"];
[request setValue:@"Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa" forHTTPHeaderField:@"Authorization"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSData *body = [@"{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}" dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:body];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@", result);
}];
[task resume];
open Lwt
open Cohttp_lwt_unix
let () =
let uri = Uri.of_string "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency" in
let headers = Cohttp.Header.init ()
|> fun h -> Cohttp.Header.add h "Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
|> fun h -> Cohttp.Header.add h "Content-Type" "application/json"
in
let body = Cohttp_lwt.Body.of_string {json|{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}|json} in
Lwt_main.run (
Client.delete ~headers ~body uri >>= fun (_, body) ->
Cohttp_lwt.Body.to_string body >|= fun s ->
print_endline s)
$headers = @{
"Authorization" = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" = "application/json"
}
$body = @'
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
'@
$response = Invoke-RestMethod -Uri "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency" -Method DELETE -Headers $headers -Body $body
$response | ConvertTo-Json
library(httr)
url <- "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
response <- DELETE(
url,
add_headers(Authorization = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"),
content_type_json(),
body = "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}"
)
content(response, "text")
import Foundation
let url = URL(string: "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")!
var request = URLRequest(url: url)
request.httpMethod = "DELETE"
request.setValue("Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = """
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
""".data(using: .utf8)
let semaphore = DispatchSemaphore(value: 0)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let data = data, let result = String(data: data, encoding: .utf8) {
print(result)
}
semaphore.signal()
}
task.resume()
semaphore.wait()
Sample Input
Sample Response
Modify the dependency between tasks in a project.
OAuth Scope:
ZohoProjects.tasks.READ
String
requiredUnique, immutable identifier of the portal in Zoho Projects. You can obtain it from the Get Portals API (the "id" field in the response).
String
requiredUnique, immutable identifier of the project within the specified portal. You can obtain it from the Get Projects API (the "id" field in the response).
JSONObject
requiredEnter the details of the predecessor task.
JSONObject
requiredEnter the details of the successor task.
String
Specify the type of dependency between the tasks. Accepted values: FS, FF, SF, SS, AutoSet
String
Specify the dependency link type. Accepted values: 0 for Hard Link, 1 for Soft Link
JSONObject
Enter the lag details to apply between the predecessor and successor tasks.
Request Example
curl -X PATCH \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa' \
-H 'Content-Type: application/json' \
-d '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency";
params = Map();
params.put("predecessor_task", {"id":"4000000062005"});
params.put("successor_task", {"id":"4000000062005"});
params.put("dependency_type", "FS");
params.put("link_type", "0");
params.put("lag", {"value":"2","type":"days"});
response = invokeUrl
[
url: url
type: PATCH
parameters: params.toString()
connection: "projects"
];
info response;
const https = require('https');
const url = new URL('https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency');
const payload = JSON.stringify({"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}});
const options = {
hostname: url.hostname,
path: url.pathname + url.search,
method: 'PATCH',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(payload)
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => { data += chunk; });
res.on('end', () => { console.log(JSON.parse(data)); });
});
req.on('error', (err) => { console.error(err); });
req.write(payload);
req.end();
require 'net/http'
require 'uri'
require 'json'
url = URI("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
request["Content-Type"] = "application/json"
request.body = '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
response = http.request(request)
puts response.read_body
<?php
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}',
CURLOPT_HTTPHEADER => [
"Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
headers = {
"Authorization": "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type": "application/json",
}
payload = '{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}'
response = requests.patch(url, headers=headers, data=payload)
print(response.json())
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}");
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK)
fprintf(stderr, "curl failed: %s\n", curl_easy_strerror(res));
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}
using System.Net.Http;
using System.Text;
using System.Web;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
var request = new HttpRequestMessage(HttpMethod.Patch, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
request.Content = new StringContent(
@"{""predecessor_task"":{""id"":""4000000062005""},""successor_task"":{""id"":""4000000062005""},""dependency_type"":""FS"",""link_type"":""0"",""lag"":{""value"":""2"",""type"":""days""}}",
Encoding.UTF8,
"application/json"
);
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* output) {
output->append((char*)contents, size * nmemb);
return size * nmemb;
}
int main() {
CURL* curl = curl_easy_init();
if (curl) {
std::string response;
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}");
CURLcode res = curl_easy_perform(curl);
if (res == CURLE_OK)
std::cout << response << std::endl;
else
std::cerr << curl_easy_strerror(res) << std::endl;
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}
(require '[clj-http.client :as client])
(def response
(client/patch "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
{:headers {"Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" "application/json"}
:body "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}"
:as :json}))
(println (:body response))
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader("{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}")
req, _ := http.NewRequest("PATCH", "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency", payload)
req.Header.Add("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
req.Header.Add("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
PATCH https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency
Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa
Content-Type: application/json
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
SSLContext sslContext = SSLContext.getDefault();
SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE);
CloseableHttpClient httpclient = httpClientBuilder.setSSLSocketFactory(sslConnectionSocketFactory).build();
URIBuilder uriBuilder = new URIBuilder("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency");
HttpUriRequest requestObj = new HttpPatch(uriBuilder.build());
requestObj.addHeader("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
HttpEntityEnclosingRequestBase requestBase = (HttpEntityEnclosingRequestBase) requestObj;
String requestBody = "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}";
requestBase.setEntity(new StringEntity(requestBody, HTTP.UTF_8));
HttpResponse response = httpclient.execute(requestObj);
HttpEntity responseEntity = response.getEntity();
Object responseObject = EntityUtils.toString(responseEntity);
String responseString = responseObject.toString();
const url = 'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json'
},
body: JSON.stringify({"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}})
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}import java.net.HttpURLConnection
import java.net.URL
import okhttp3.HttpUrl.Companion.toHttpUrl
fun main() {
val url = URL("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")
val conn = url.openConnection() as HttpURLConnection
conn.requestMethod = "PATCH"
conn.setRequestProperty("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
conn.setRequestProperty("Content-Type", "application/json")
conn.doOutput = true
conn.outputStream.bufferedWriter().use { it.write("""{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}""") }
val response = conn.inputStream.bufferedReader().readText()
println(response)
}
NSURL *url = [NSURL URLWithString:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"PATCH"];
[request setValue:@"Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa" forHTTPHeaderField:@"Authorization"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSData *body = [@"{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}" dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:body];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@", result);
}];
[task resume];
open Lwt
open Cohttp_lwt_unix
let () =
let uri = Uri.of_string "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency" in
let headers = Cohttp.Header.init ()
|> fun h -> Cohttp.Header.add h "Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
|> fun h -> Cohttp.Header.add h "Content-Type" "application/json"
in
let body = Cohttp_lwt.Body.of_string {json|{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}|json} in
Lwt_main.run (
Client.patch ~headers ~body uri >>= fun (_, body) ->
Cohttp_lwt.Body.to_string body >|= fun s ->
print_endline s)
$headers = @{
"Authorization" = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" = "application/json"
}
$body = @'
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
'@
$response = Invoke-RestMethod -Uri "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency" -Method PATCH -Headers $headers -Body $body
$response | ConvertTo-Json
library(httr)
url <- "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency"
response <- PATCH(
url,
add_headers(Authorization = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"),
content_type_json(),
body = "{\"predecessor_task\":{\"id\":\"4000000062005\"},\"successor_task\":{\"id\":\"4000000062005\"},\"dependency_type\":\"FS\",\"link_type\":\"0\",\"lag\":{\"value\":\"2\",\"type\":\"days\"}}"
)
content(response, "text")
import Foundation
let url = URL(string: "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/projects/23806000097545166/tasks/dependency")!
var request = URLRequest(url: url)
request.httpMethod = "PATCH"
request.setValue("Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = """
{"predecessor_task":{"id":"4000000062005"},"successor_task":{"id":"4000000062005"},"dependency_type":"FS","link_type":"0","lag":{"value":"2","type":"days"}}
""".data(using: .utf8)
let semaphore = DispatchSemaphore(value: 0)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let data = data, let result = String(data: data, encoding: .utf8) {
print(result)
}
semaphore.signal()
}
task.resume()
semaphore.wait()
Sample Input
Sample Response