Module Options
This module covers operations related to the fields within Zoho Projects modules. Use this API to retrieve, create, update, or delete options for fields, as well as disassociate or apply bulk options for fields.
This module covers operations related to the fields within Zoho Projects modules. Use this API to retrieve, create, update, or delete options for fields, as well as disassociate or apply bulk options for fields.
Retrieve available options for a field. Use this API for picklist values, statuses, or selectable options.
OAuth Scope:
ZohoProjects.custom_fields.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
requiredEnter the module API name or ID. You can obtain it from the Get Modules API (the "id" field in the response).
String
requiredEnter the field name or ID. You can obtain it from the Get Fields API (the "id" field in the response).
JSONObject
Enter the filter criteria to refine the results. Use it to combine multiple filter conditions.
int
default : 1Enter the page number.
int
limit : 1-200Enter the number of entries to be displayed per page.
Request Example
curl -X GET \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options?module=projects&field=4000003212456&filter=%7B%22project_id%22%3A%224009238123434%22%2C%22layout_id%22%3A%224000000003003%22%2C%22is_unassociated%22%3A%22true%22%2C%22option_type_filter%22%3A%7B%22criteria%22%3A%5B%7B%22module%22%3A%22projects%22%2C%22field_name%22%3A%22project%22%2C%22module_name%22%3A%22task%22%2C%22criteria_condition%22%3A%22contains%22%2C%22value%22%3A%5B1752587000000097269%5D%7D%5D%2C%22pattern%22%3A%221%22%7D%2C%22options%22%3A%22-%22%2C%22search_term%22%3A%22-%22%2C%22is_client_user%22%3A%22-%22%7D&page=1&per_page=10' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa'
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options";
filter_value = {"project_id":"4009238123434","layout_id":"4000000003003","is_unassociated":"true","option_type_filter":{"criteria":[{"module":"projects","field_name":"project","module_name":"task","criteria_condition":"contains","value":[1752587000000097269]}],"pattern":"1"},"options":"-","search_term":"-","is_client_user":"-"};
params = Map();
params.put("module", "projects");
params.put("field", "4000003212456");
params.put("filter", filter_value);
params.put("page", 1);
params.put("per_page", 10);
response = invokeUrl
[
url: url
type: GET
parameters: params
connection: "projects"
];
info response;
const https = require('https');
const url = new URL('https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options');
url.searchParams.append('module', 'projects');
url.searchParams.append('field', '4000003212456');
url.searchParams.append('filter', '{"project_id":"4009238123434","layout_id":"4000000003003","is_unassociated":"true","option_type_filter":{"criteria":[{"module":"projects","field_name":"project","module_name":"task","criteria_condition":"contains","value":[1752587000000097269]}],"pattern":"1"},"options":"-","search_term":"-","is_client_user":"-"}');
url.searchParams.append('page', '1');
url.searchParams.append('per_page', '10');
const options = {
hostname: url.hostname,
path: url.pathname + url.search,
method: 'GET',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa'
}
};
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.end();
require 'net/http'
require 'uri'
require 'json'
url = URI("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options")
params = {
"module" => "projects",
"field" => "4000003212456",
"filter" => "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}",
"page" => "1",
"per_page" => "10"
}
url.query = URI.encode_www_form(params)
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
response = http.request(request)
puts response.read_body
<?php
$params = [
'module' => 'projects',
'field' => '4000003212456',
'filter' => '{"project_id":"4009238123434","layout_id":"4000000003003","is_unassociated":"true","option_type_filter":{"criteria":[{"module":"projects","field_name":"project","module_name":"task","criteria_condition":"contains","value":[1752587000000097269]}],"pattern":"1"},"options":"-","search_term":"-","is_client_user":"-"}',
'page' => '1',
'per_page' => '10',
];
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options" . "?" . http_build_query($params);
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options"
params = {
"module": "projects",
"field": "4000003212456",
"filter": "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}",
"page": "1",
"per_page": "10"
}
headers = {
"Authorization": "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
char *enc_module = curl_easy_escape(curl, "projects", 0);
char *enc_field = curl_easy_escape(curl, "4000003212456", 0);
char *enc_filter = curl_easy_escape(curl, "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}", 0);
char *enc_page = curl_easy_escape(curl, "1", 0);
char *enc_per_page = curl_easy_escape(curl, "10", 0);
char url[2048];
snprintf(url, sizeof(url), "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options?module=%s&field=%s&filter=%s&page=%s&per_page=%s", enc_module, enc_field, enc_filter, enc_page, enc_per_page);
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK)
fprintf(stderr, "curl failed: %s\n", curl_easy_strerror(res));
curl_free(enc_module);
curl_free(enc_field);
curl_free(enc_filter);
curl_free(enc_page);
curl_free(enc_per_page);
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 query = HttpUtility.ParseQueryString(string.Empty);
query["module"] = "projects";
query["field"] = "4000003212456";
query["filter"] = "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}";
query["page"] = "1";
query["per_page"] = "10";
var uriBuilder = new UriBuilder("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options") { Query = query.ToString() };
var request = new HttpRequestMessage(HttpMethod.Get, uriBuilder.Uri);
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;
char* enc_module = curl_easy_escape(curl, "projects", 0);
char* enc_field = curl_easy_escape(curl, "4000003212456", 0);
char* enc_filter = curl_easy_escape(curl, "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}", 0);
char* enc_page = curl_easy_escape(curl, "1", 0);
char* enc_per_page = curl_easy_escape(curl, "10", 0);
std::string url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options";
url += "?module=" + std::string(enc_module);
url += "&field=" + std::string(enc_field);
url += "&filter=" + std::string(enc_filter);
url += "&page=" + std::string(enc_page);
url += "&per_page=" + std::string(enc_per_page);
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
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_free(enc_module);
curl_free(enc_field);
curl_free(enc_filter);
curl_free(enc_page);
curl_free(enc_per_page);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}
(require '[clj-http.client :as client])
(let [enc-module (java.net.URLEncoder/encode "projects" "UTF-8")
enc-field (java.net.URLEncoder/encode "4000003212456" "UTF-8")
enc-filter (java.net.URLEncoder/encode "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}" "UTF-8")
enc-page (java.net.URLEncoder/encode "1" "UTF-8")
enc-per_page (java.net.URLEncoder/encode "10" "UTF-8")
url (str "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options" "?module=" enc-module "&field=" enc-field "&filter=" enc-filter "&page=" enc-page "&per_page=" enc-per_page)]
(def response
(client/get url
{:headers {"Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"}
:as :json}))
(println (:body response))
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
req, _ := http.NewRequest("GET", "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options", nil)
q := req.URL.Query()
q.Add("module", "projects")
q.Add("field", "4000003212456")
q.Add("filter", "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}")
q.Add("page", "1")
q.Add("per_page", "10")
req.URL.RawQuery = q.Encode()
req.Header.Add("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
GET https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options?module=projects&field=4000003212456&filter=%7B%22project_id%22%3A%224009238123434%22%2C%22layout_id%22%3A%224000000003003%22%2C%22is_unassociated%22%3A%22true%22%2C%22option_type_filter%22%3A%7B%22criteria%22%3A%5B%7B%22module%22%3A%22projects%22%2C%22field_name%22%3A%22project%22%2C%22module_name%22%3A%22task%22%2C%22criteria_condition%22%3A%22contains%22%2C%22value%22%3A%5B1752587000000097269%5D%7D%5D%2C%22pattern%22%3A%221%22%7D%2C%22options%22%3A%22-%22%2C%22search_term%22%3A%22-%22%2C%22is_client_user%22%3A%22-%22%7D&page=1&per_page=10 HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options?module=projects&field=4000003212456&filter=%7B%22project_id%22%3A%224009238123434%22%2C%22layout_id%22%3A%224000000003003%22%2C%22is_unassociated%22%3A%22true%22%2C%22option_type_filter%22%3A%7B%22criteria%22%3A%5B%7B%22module%22%3A%22projects%22%2C%22field_name%22%3A%22project%22%2C%22module_name%22%3A%22task%22%2C%22criteria_condition%22%3A%22contains%22%2C%22value%22%3A%5B1752587000000097269%5D%7D%5D%2C%22pattern%22%3A%221%22%7D%2C%22options%22%3A%22-%22%2C%22search_term%22%3A%22-%22%2C%22is_client_user%22%3A%22-%22%7D&page=1&per_page=10
Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa
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]/settings/options");
uriBuilder.addParameter("module", "projects");
uriBuilder.addParameter("field", "4000003212456");
uriBuilder.addParameter("filter", "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}");
uriBuilder.addParameter("page", "1");
uriBuilder.addParameter("per_page", "10");
HttpUriRequest requestObj = new HttpGet(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]/settings/options';
const params = new URLSearchParams({
'module': 'projects',
'field': '4000003212456',
'filter': '{"project_id":"4009238123434","layout_id":"4000000003003","is_unassociated":"true","option_type_filter":{"criteria":[{"module":"projects","field_name":"project","module_name":"task","criteria_condition":"contains","value":[1752587000000097269]}],"pattern":"1"},"options":"-","search_term":"-","is_client_user":"-"}',
'page': '1',
'per_page': '10'
});
const options = {
method: 'GET',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa'
}
};
fetch(url + '?' + params.toString(), options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
module = "projects"
field = "4000003212456"
filter = {"project_id":"4009238123434","layout_id":"4000000003003","is_unassociated":"true","option_type_filter":{"criteria":[{"module":"projects","field_name":"project","module_name":"task","criteria_condition":"contains","value":[1752587000000097269]}],"pattern":"1"},"options":"-","search_term":"-","is_client_user":"-"}
page = 1
per_page = 10
import java.net.HttpURLConnection
import java.net.URL
import okhttp3.HttpUrl.Companion.toHttpUrl
fun main() {
val urlBuilder = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options".toHttpUrl().newBuilder()
urlBuilder.addQueryParameter("module", "projects")
urlBuilder.addQueryParameter("field", "4000003212456")
urlBuilder.addQueryParameter("filter", "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}")
urlBuilder.addQueryParameter("page", "1")
urlBuilder.addQueryParameter("per_page", "10")
val url = URL(urlBuilder.build().toString())
val conn = url.openConnection() as HttpURLConnection
conn.requestMethod = "GET"
conn.setRequestProperty("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
val response = conn.inputStream.bufferedReader().readText()
println(response)
}
NSString *encodedModule = [@"projects" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *encodedField = [@"4000003212456" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *encodedFilter = [@"{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *encodedPage = [@"1" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *encodedPer_page = [@"10" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *urlString = [NSString stringWithFormat:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options?module=%@&field=%@&filter=%@&page=%@&per_page=%@", encodedModule, encodedField, encodedFilter, encodedPage, encodedPer_page];
NSURL *url = [NSURL URLWithString:urlString];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"GET"];
[request setValue:@"Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa" forHTTPHeaderField:@"Authorization"];
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 enc_module = Uri.pct_encode "projects" in
let enc_field = Uri.pct_encode "4000003212456" in
let enc_filter = Uri.pct_encode "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}" in
let enc_page = Uri.pct_encode "1" in
let enc_per_page = Uri.pct_encode "10" in
let uri = Uri.of_string ("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options" ^ "?module=" ^ enc_module ^ "&field=" ^ enc_field ^ "&filter=" ^ enc_filter ^ "&page=" ^ enc_page ^ "&per_page=" ^ enc_per_page) in
let headers = Cohttp.Header.init ()
|> fun h -> Cohttp.Header.add h "Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
in
Lwt_main.run (
Client.get ~headers uri >>= fun (_, body) ->
Cohttp_lwt.Body.to_string body >|= fun s ->
print_endline s)
$headers = @{
"Authorization" = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
}
$params = @{
module = "projects"
field = "4000003212456"
filter = "{`"project_id`":`"4009238123434`",`"layout_id`":`"4000000003003`",`"is_unassociated`":`"true`",`"option_type_filter`":{`"criteria`":[{`"module`":`"projects`",`"field_name`":`"project`",`"module_name`":`"task`",`"criteria_condition`":`"contains`",`"value`":[1752587000000097269]}],`"pattern`":`"1`"},`"options`":`"-`",`"search_term`":`"-`",`"is_client_user`":`"-`"}"
page = "1"
per_page = "10"
}
$queryString = ($params.GetEnumerator() | ForEach-Object { "$($_.Key)=$([System.Uri]::EscapeDataString($_.Value))" }) -join "&"
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options" + "?" + $queryString
$response = Invoke-RestMethod -Uri $url -Method GET -Headers $headers
$response | ConvertTo-Json
library(httr)
url <- "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options"
params <- list(
module = "projects",
field = "4000003212456",
filter = "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}",
page = "1",
per_page = "10"
)
response <- GET(
url,
add_headers(Authorization = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"),
query = params
)
content(response, "text")
import Foundation
var components = URLComponents(string: "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options")!
components.queryItems = [
URLQueryItem(name: "module", value: "projects"),
URLQueryItem(name: "field", value: "4000003212456"),
URLQueryItem(name: "filter", value: "{\"project_id\":\"4009238123434\",\"layout_id\":\"4000000003003\",\"is_unassociated\":\"true\",\"option_type_filter\":{\"criteria\":[{\"module\":\"projects\",\"field_name\":\"project\",\"module_name\":\"task\",\"criteria_condition\":\"contains\",\"value\":[1752587000000097269]}],\"pattern\":\"1\"},\"options\":\"-\",\"search_term\":\"-\",\"is_client_user\":\"-\"}"),
URLQueryItem(name: "page", value: "1"),
URLQueryItem(name: "per_page", value: "10")
]
let url = components.url!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.setValue("Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa", forHTTPHeaderField: "Authorization")
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
Create bulk options for a field in a custom module.
OAuth Scope:
ZohoProjects.custom_fields.CREATE
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
requiredEnter the module API name or ID. You can obtain it from the Get Modules API (the "id" field in the response).
String
requiredEnter the field ID. You can obtain it from the Get Fields API (the "id" field in the response).
String
Enter the layout ID. You can obtain it from the Get Layouts API (the "id" field in the response).
JSONObject
max length : 1000Specify the position of the option in the layout.
JSONArray
max length : 7000Enter the role ID details.
JSONArray
max length : 7000Enter the user ID details.
JSONArray
max length : 5000Enter the status ID details.
JSONArray
max length : 10000Specify the custom options with the ID and value.
Request Example
curl -X POST \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa' \
-H 'Content-Type: application/json' \
-d '{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}'
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options";
params = Map();
params.put("module", "projects");
params.put("field", "4000003212456");
params.put("layout_id", "4000003211234");
params.put("position", {"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"});
params.put("roles", [{"id":"4000000062001"}]);
params.put("users", [{"zpuid":"4000000002055"}]);
params.put("statuses", [{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}]);
params.put("custom_options", [{"id":"4000000062001","value":"1752587000000097269"}]);
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]/settings/options');
const payload = JSON.stringify({"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]});
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]/settings/options")
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 = '{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}'
response = http.request(request)
puts response.read_body
<?php
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}',
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]/settings/options"
headers = {
"Authorization": "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type": "application/json",
}
payload = '{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}'
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]/settings/options");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":\"1752587000000097269\"}]}");
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]/settings/options");
request.Content = new StringContent(
@"{""module"":""projects"",""field"":""4000003212456"",""layout_id"":""4000003211234"",""position"":{""before_id"":""4009123452362"",""after_id"":""4009123452345"",""exact_position"":""0"",""known_position"":""first|last""},""roles"":[{""id"":""4000000062001""}],""users"":[{""zpuid"":""4000000002055""}],""statuses"":[{""id"":""4000000062001"",""name"":""Simple Entity"",""color"":""#FFFFFF"",""is_closed_type"":""true"",""transitions"":[{""id"":""4000000062001""}]}],""custom_options"":[{""id"":""4000000062001"",""value"":""1752587000000097269""}]}",
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]/settings/options");
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, "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":\"1752587000000097269\"}]}");
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]/settings/options"
{:headers {"Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" "application/json"}
:body "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":\"1752587000000097269\"}]}"
:as :json}))
(println (:body response))
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader("{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":\"1752587000000097269\"}]}")
req, _ := http.NewRequest("POST", "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options", 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]/settings/options HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options
Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa
Content-Type: application/json
{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}
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]/settings/options");
HttpUriRequest requestObj = new HttpPost(uriBuilder.build());
requestObj.addHeader("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
HttpEntityEnclosingRequestBase requestBase = (HttpEntityEnclosingRequestBase) requestObj;
String requestBody = "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":\"1752587000000097269\"}]}";
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]/settings/options';
const options = {
method: 'POST',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json'
},
body: JSON.stringify({"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]})
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}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]/settings/options")
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("""{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}""") }
val response = conn.inputStream.bufferedReader().readText()
println(response)
}
NSURL *url = [NSURL URLWithString:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options"];
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 = [@"{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":\"1752587000000097269\"}]}" 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]/settings/options" 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|{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}|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 = @'
{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}
'@
$response = Invoke-RestMethod -Uri "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options" -Method POST -Headers $headers -Body $body
$response | ConvertTo-Json
library(httr)
url <- "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options"
response <- POST(
url,
add_headers(Authorization = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"),
content_type_json(),
body = "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":\"1752587000000097269\"}]}"
)
content(response, "text")
import Foundation
let url = URL(string: "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options")!
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 = """
{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":"1752587000000097269"}]}
""".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 or disassociate bulk options for a field.
OAuth Scope:
ZohoProjects.custom_fields.DELETE
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
requiredEnter the module API name or ID. You can obtain it from the Get Modules API (the "id" field in the response).
String
requiredEnter the field ID. You can obtain it from the Get Fields API (the "id" field in the response).
String
Enter the layout ID. You can obtain it from the Get Layouts API (the "id" field in the response).
JSONArray
max length : 7000Enter the role ID details.
JSONArray
max length : 7000Enter the user ID details.
JSONArray
max length : 1000Enter the status ID details.
JSONArray
max length : 1000Specify the custom options with the ID and value.
Request Example
curl -X DELETE \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa' \
-H 'Content-Type: application/json' \
-d '{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}'
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options";
params = Map();
params.put("module", "Risk");
params.put("field", "4000003212456");
params.put("layout_id", "4000003211234");
params.put("roles", [{"id":"4000000062001"}]);
params.put("users", [{"zpuid":"4000000002055"}]);
params.put("statuses", [{"id":"4000000062001"}]);
params.put("custom_options", [{"id":"4000000062001"}]);
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]/settings/options');
const payload = JSON.stringify({"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]});
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]/settings/options")
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 = '{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}'
response = http.request(request)
puts response.read_body
<?php
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => '{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}',
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]/settings/options"
headers = {
"Authorization": "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type": "application/json",
}
payload = '{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}'
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]/settings/options");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"module\":\"Risk\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\"}],\"custom_options\":[{\"id\":\"4000000062001\"}]}");
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]/settings/options");
request.Content = new StringContent(
@"{""module"":""Risk"",""field"":""4000003212456"",""layout_id"":""4000003211234"",""roles"":[{""id"":""4000000062001""}],""users"":[{""zpuid"":""4000000002055""}],""statuses"":[{""id"":""4000000062001""}],""custom_options"":[{""id"":""4000000062001""}]}",
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]/settings/options");
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, "{\"module\":\"Risk\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\"}],\"custom_options\":[{\"id\":\"4000000062001\"}]}");
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]/settings/options"
{:headers {"Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" "application/json"}
:body "{\"module\":\"Risk\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\"}],\"custom_options\":[{\"id\":\"4000000062001\"}]}"
:as :json}))
(println (:body response))
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader("{\"module\":\"Risk\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\"}],\"custom_options\":[{\"id\":\"4000000062001\"}]}")
req, _ := http.NewRequest("DELETE", "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options", 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]/settings/options HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options
Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa
Content-Type: application/json
{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}
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]/settings/options");
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]/settings/options';
const options = {
method: 'DELETE',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json'
},
body: JSON.stringify({"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]})
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}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]/settings/options")
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("""{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}""") }
val response = conn.inputStream.bufferedReader().readText()
println(response)
}
NSURL *url = [NSURL URLWithString:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options"];
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 = [@"{\"module\":\"Risk\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\"}],\"custom_options\":[{\"id\":\"4000000062001\"}]}" 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]/settings/options" 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|{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}|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 = @'
{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}
'@
$response = Invoke-RestMethod -Uri "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options" -Method DELETE -Headers $headers -Body $body
$response | ConvertTo-Json
library(httr)
url <- "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options"
response <- DELETE(
url,
add_headers(Authorization = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"),
content_type_json(),
body = "{\"module\":\"Risk\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\"}],\"custom_options\":[{\"id\":\"4000000062001\"}]}"
)
content(response, "text")
import Foundation
let url = URL(string: "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options")!
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 = """
{"module":"Risk","field":"4000003212456","layout_id":"4000003211234","roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001"}],"custom_options":[{"id":"4000000062001"}]}
""".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
Update existing options for a field. Use this API to rename or reorder options.
OAuth Scope:
ZohoProjects.custom_fields.UPDATE
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
requiredEnter the module API name or ID. You can obtain it from the Get Modules API (the "id" field in the response).
String
requiredEnter the field ID. You can obtain it from the Get Fields API (the "id" field in the response).
String
Enter the layout ID. You can obtain it from the Get Layouts API (the "id" field in the response).
JSONObject
max length : 1000Specify the position of the option in the layout.
JSONArray
max length : 7000Enter the role ID details.
JSONArray
max length : 7000Enter the user ID details.
JSONArray
max length : 5000Enter the status ID details.
JSONArray
max length : 10000Specify the custom options with the ID and value.
Request Example
curl -X PATCH \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa' \
-H 'Content-Type: application/json' \
-d '{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}'
url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options";
params = Map();
params.put("module", "projects");
params.put("field", "4000003212456");
params.put("layout_id", "4000003211234");
params.put("position", {"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"});
params.put("roles", [{"id":"4000000062001"}]);
params.put("users", [{"zpuid":"4000000002055"}]);
params.put("statuses", [{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}]);
params.put("custom_options", [{"id":"4000000062001","value":["1752587000000097269"]}]);
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]/settings/options');
const payload = JSON.stringify({"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]});
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]/settings/options")
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 = '{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}'
response = http.request(request)
puts response.read_body
<?php
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => '{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}',
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]/settings/options"
headers = {
"Authorization": "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
"Content-Type": "application/json",
}
payload = '{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}'
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]/settings/options");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":[\"1752587000000097269\"]}]}");
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]/settings/options");
request.Content = new StringContent(
@"{""module"":""projects"",""field"":""4000003212456"",""layout_id"":""4000003211234"",""position"":{""before_id"":""4009123452362"",""after_id"":""4009123452345"",""exact_position"":""0"",""known_position"":""first|last""},""roles"":[{""id"":""4000000062001""}],""users"":[{""zpuid"":""4000000002055""}],""statuses"":[{""id"":""4000000062001"",""name"":""Simple Entity"",""color"":""#FFFFFF"",""is_closed_type"":""true"",""transitions"":[{""id"":""4000000062001""}]}],""custom_options"":[{""id"":""4000000062001"",""value"":[""1752587000000097269""]}]}",
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]/settings/options");
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, "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":[\"1752587000000097269\"]}]}");
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]/settings/options"
{:headers {"Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
"Content-Type" "application/json"}
:body "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":[\"1752587000000097269\"]}]}"
:as :json}))
(println (:body response))
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader("{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":[\"1752587000000097269\"]}]}")
req, _ := http.NewRequest("PATCH", "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options", 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]/settings/options HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options
Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa
Content-Type: application/json
{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}
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]/settings/options");
HttpUriRequest requestObj = new HttpPatch(uriBuilder.build());
requestObj.addHeader("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa");
HttpEntityEnclosingRequestBase requestBase = (HttpEntityEnclosingRequestBase) requestObj;
String requestBody = "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":[\"1752587000000097269\"]}]}";
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]/settings/options';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa',
'Content-Type': 'application/json'
},
body: JSON.stringify({"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]})
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}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]/settings/options")
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("""{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}""") }
val response = conn.inputStream.bufferedReader().readText()
println(response)
}
NSURL *url = [NSURL URLWithString:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options"];
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 = [@"{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":[\"1752587000000097269\"]}]}" 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]/settings/options" 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|{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}|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 = @'
{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}
'@
$response = Invoke-RestMethod -Uri "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options" -Method PATCH -Headers $headers -Body $body
$response | ConvertTo-Json
library(httr)
url <- "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options"
response <- PATCH(
url,
add_headers(Authorization = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"),
content_type_json(),
body = "{\"module\":\"projects\",\"field\":\"4000003212456\",\"layout_id\":\"4000003211234\",\"position\":{\"before_id\":\"4009123452362\",\"after_id\":\"4009123452345\",\"exact_position\":\"0\",\"known_position\":\"first|last\"},\"roles\":[{\"id\":\"4000000062001\"}],\"users\":[{\"zpuid\":\"4000000002055\"}],\"statuses\":[{\"id\":\"4000000062001\",\"name\":\"Simple Entity\",\"color\":\"#FFFFFF\",\"is_closed_type\":\"true\",\"transitions\":[{\"id\":\"4000000062001\"}]}],\"custom_options\":[{\"id\":\"4000000062001\",\"value\":[\"1752587000000097269\"]}]}"
)
content(response, "text")
import Foundation
let url = URL(string: "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/settings/options")!
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 = """
{"module":"projects","field":"4000003212456","layout_id":"4000003211234","position":{"before_id":"4009123452362","after_id":"4009123452345","exact_position":"0","known_position":"first|last"},"roles":[{"id":"4000000062001"}],"users":[{"zpuid":"4000000002055"}],"statuses":[{"id":"4000000062001","name":"Simple Entity","color":"#FFFFFF","is_closed_type":"true","transitions":[{"id":"4000000062001"}]}],"custom_options":[{"id":"4000000062001","value":["1752587000000097269"]}]}
""".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