Zoho Projects API Documentation
Text copied
File not found

Record Attachments

Get Attachments

Retrieve all attachments of a record.

GET

/api/v3/portal/[PORTAL_ID]/module/[MODULE_ID]/entity/[ENTITY_ID]/attachments

OAuth Scope:

ZohoProjects.custom_fields.READ

Path Parameters

Param Name
Data Type
Description

Query Parameters

Param Name
Data Type
Description

Request Example

Request Example
  • cURL
  • Deluge
  • Node.js
  • Ruby
  • PHP
  • Python
  • C
  • C#
  • C++
  • Clojure
  • Go
  • HTTP
  • Java
  • JS Fetch
  • JSON
  • Kotlin
  • Objective-C
  • OCaml
  • PowerShell
  • R
  • Swift

curl -X GET \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments?project_id=23806000097545166' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa'

url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments";
params = Map();
params.put("project_id", "23806000097545166");
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]/module/1752587000000097269/entity/1752587000000097299/attachments');
url.searchParams.append('project_id', '23806000097545166');

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]/module/1752587000000097269/entity/1752587000000097299/attachments")
params = {
  "project_id" => "23806000097545166"
}
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 = [
    'project_id' => '23806000097545166',
];
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments" . "?" . 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]/module/1752587000000097269/entity/1752587000000097299/attachments"

params = {
    "project_id": "23806000097545166"
}

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_project_id = curl_easy_escape(curl, "23806000097545166", 0);
        char url[2048];
        snprintf(url, sizeof(url), "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments?project_id=%s", enc_project_id);

        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_project_id);
        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["project_id"] = "23806000097545166";
var uriBuilder = new UriBuilder("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments") { 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_project_id = curl_easy_escape(curl, "23806000097545166", 0);
        std::string url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments";
        url += "?project_id=" + std::string(enc_project_id);

        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_project_id);
        curl_slist_free_all(headers);
        curl_easy_cleanup(curl);
    }
    return 0;
}
(require '[clj-http.client :as client])

(let [enc-project_id (java.net.URLEncoder/encode "23806000097545166" "UTF-8")
      url (str "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments" "?project_id=" enc-project_id)]
(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]/module/1752587000000097269/entity/1752587000000097299/attachments", nil)
    q := req.URL.Query()
    q.Add("project_id", "23806000097545166")
    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]/module/1752587000000097269/entity/1752587000000097299/attachments?project_id=23806000097545166 HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments?project_id=23806000097545166
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]/module/1752587000000097269/entity/1752587000000097299/attachments");
uriBuilder.addParameter("project_id", "23806000097545166");
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]/module/1752587000000097269/entity/1752587000000097299/attachments';

const params = new URLSearchParams({
  'project_id': '23806000097545166'
});

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));
project_id = "23806000097545166"
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]/module/1752587000000097269/entity/1752587000000097299/attachments".toHttpUrl().newBuilder()
    urlBuilder.addQueryParameter("project_id", "23806000097545166")
    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 *encodedProject_id = [@"23806000097545166" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *urlString = [NSString stringWithFormat:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments?project_id=%@", encodedProject_id];
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_project_id = Uri.pct_encode "23806000097545166" in
  let uri = Uri.of_string ("https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments" ^ "?project_id=" ^ enc_project_id) 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 = @{
    project_id = "23806000097545166"
}
$queryString = ($params.GetEnumerator() | ForEach-Object { "$($_.Key)=$([System.Uri]::EscapeDataString($_.Value))" }) -join "&"
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachments" + "?" + $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]/module/1752587000000097269/entity/1752587000000097299/attachments"

params <- list(
  project_id = "23806000097545166"
)

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]/module/1752587000000097269/entity/1752587000000097299/attachments")!
components.queryItems = [
    URLQueryItem(name: "project_id", value: "23806000097545166")
]
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

project_id : "23806000097545166"

Sample Response

200{ "comment_attachments" : [ { "created_time" : "1767540051974", "associated_time_long" : "1767540053894", "third_party_file_id" : "k58sx8a7bc1c8b21945fea00fe125de5f643a", "parentFolderId" : "la6u1ca30e51816c944c8892d1cb9bd377398", "app_domain" : "workdrive", "type" : "image/jpeg", "entity_id" : "108250000001866007", "created_by" : "67336035", "uploadedZpuid" : "108250000000051003", "app_name" : "", "permanent_url" : "https://workdrive.zoho.com/file/k58sx8a7bc1c8b21945fea00fe125de5f643a?authId=%7B%22module%22%3A%22risk%22%2C%22entity_id%22%3A%220_108250000001866007%22%7D", "entity_type" : "custom_module_comment", "size" : "18236", "associated_by" : "67336035", "preview_url" : "https://previewengine.zoho.com/thumbnail/WD/k58sx8a7bc1c8b21945fea00fe125de5f643a?x-cli-msg=eyJtb2R1bGUiOiJyaXNrIiwiZW50aXR5X2lkIjoiMF8xMDgyNTAwMDAwMDE4NjYwMDcifQ&size=l", "attachment_id" : "108250000001866029", "name" : "Image 679x679 04-01-2026 20:50:50:900.jpg", "associated_by_name" : "Reece Turner", "download_url" : "https://download.zoho.com/v1/workdrive/download/k58sx8a7bc1c8b21945fea00fe125de5f643a?x-cli-msg=%7B%22module%22%3A%22risk%22%2C%22entity_id%22%3A%220_108250000001866007%22%7D", "app_id" : "1", "trashed" : false } ], "total_attachments_count" : 2, "third_party_attachments" : [ { "created_time" : "1767539456391", "associated_time_long" : "1767539456767", "third_party_file_id" : "k58sx61bc5a2f6446435bb30239a60aa3102f", "parentFolderId" : "la6u1ca30e51816c944c8892d1cb9bd377398", "app_domain" : "workdrive", "type" : "image/jpeg", "entity_id" : "108250000001866001", "created_by" : "67336035", "uploadedZpuid" : "108250000000051003", "app_name" : "", "permanent_url" : "https://workdrive.zoho.com/file/k58sx61bc5a2f6446435bb30239a60aa3102f?authId=%7B%22module%22%3A%22risk%22%2C%22entity_id%22%3A%220_108250000001866001%22%7D", "entity_type" : "custom_module", "size" : "18236", "associated_by" : "67336035", "preview_url" : "https://previewengine.zoho.com/thumbnail/WD/k58sx61bc5a2f6446435bb30239a60aa3102f?x-cli-msg=eyJtb2R1bGUiOiJyaXNrIiwiZW50aXR5X2lkIjoiMF8xMDgyNTAwMDAwMDE4NjYwMDEifQ&size=l", "attachment_id" : "108250000001866023", "name" : "Image 679x679.jpg", "associated_by_name" : "Reece Turner", "download_url" : "https://download.zoho.com/v1/workdrive/download/k58sx61bc5a2f6446435bb30239a60aa3102f?x-cli-msg=%7B%22module%22%3A%22risk%22%2C%22entity_id%22%3A%220_108250000001866001%22%7D", "app_id" : "1", "trashed" : false } ] }

Get Attachments Count

Retrieve the count of attachments from a record.

GET

/api/v3/portal/[PORTAL_ID]/module/[MODULE_ID]/entity/[ENTITY_ID]/attachmentcount

OAuth Scope:

ZohoProjects.custom_fields.READ

Path Parameters

Param Name
Data Type
Description

Request Example

Request Example
  • cURL
  • Deluge
  • Node.js
  • Ruby
  • PHP
  • Python
  • C
  • C#
  • C++
  • Clojure
  • Go
  • HTTP
  • Java
  • JS Fetch
  • Kotlin
  • Objective-C
  • OCaml
  • PowerShell
  • R
  • Swift

curl -X GET \
'https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount' \
-H 'Authorization: Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa'

url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount";
response = invokeUrl
[
    url: url
    type: GET
    connection: "projects"
];
info response;
const https = require('https');
const url = new URL('https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount');

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]/module/1752587000000097269/entity/1752587000000097299/attachmentcount")

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
$url = "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount";

$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]/module/1752587000000097269/entity/1752587000000097299/attachmentcount"

headers = {
    "Authorization": "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa",
}

response = requests.get(url, headers=headers)

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");

        curl_easy_setopt(curl, CURLOPT_URL, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount");
        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_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.Get, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount");

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");

        curl_easy_setopt(curl, CURLOPT_URL, "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount");
        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_slist_free_all(headers);
        curl_easy_cleanup(curl);
    }
    return 0;
}
(require '[clj-http.client :as client])

(def response
  (client/get "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount"
    {:headers {"Authorization" "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"}
     :as :json}))

(println (:body response))
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount", nil)
    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]/module/1752587000000097269/entity/1752587000000097299/attachmentcount HTTP/1.1
Host: https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount
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]/module/1752587000000097269/entity/1752587000000097299/attachmentcount");
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]/module/1752587000000097269/entity/1752587000000097299/attachmentcount';

const options = {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa'
  }
};

fetch(url, options)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));
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]/module/1752587000000097269/entity/1752587000000097299/attachmentcount")
    val conn = url.openConnection() as HttpURLConnection
    conn.requestMethod = "GET"
    conn.setRequestProperty("Authorization", "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")

    val response = conn.inputStream.bufferedReader().readText()
    println(response)
}
NSURL *url = [NSURL URLWithString:@"https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount"];
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 uri = Uri.of_string "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount" 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"
}

$response = Invoke-RestMethod -Uri "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount" -Method GET -Headers $headers

$response | ConvertTo-Json
library(httr)

url <- "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount"

response <- GET(
  url,
  add_headers(Authorization = "Bearer 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa")
)

content(response, "text")
import Foundation

let url = URL(string: "https://projects.zoho.com/api/v3/portal/[PORTAL_ID]/module/1752587000000097269/entity/1752587000000097299/attachmentcount")!
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 Response

200{ "attachment_count" : "6" }
AI Tools
ChatGPT Open in ChatGPT ↗ Open in ChatGPT to ask questions about this page
Claude Open in Claude ↗ Open in Claude to ask questions about this page
Copy as Markdown Copy this page as markdown to use with AI assistants
View as Markdown ↗ Open this page as markdown in a new tab
Copy OpenAPI Spec Copy the OpenAPI YAML to the clipboard
View as YAML ↗ Open the OpenAPI spec in a new tab
Download YAML Save the OpenAPI spec as a .yaml file