curl --request GET \
--url https://api.cnaught.com/v1/project-categories/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cnaught.com/v1/project-categories/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cnaught.com/v1/project-categories/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cnaught.com/v1/project-categories/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cnaught.com/v1/project-categories/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cnaught.com/v1/project-categories/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cnaught.com/v1/project-categories/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "XBfyJ8",
"name": "Oxford Type 1 - Emissions Reductions",
"description": "This category covers a wide range of projects that aim to reduce and avoid emissions versus business as usual. Examples include: renewable energy, destruction of refrigerants that would otherwise be vented to the atmosphere, and capture of methane emitted from landfills.",
"primary_image_url": "https://assets.cnaught.com/64fd900fcf6f93409fc7ff21/6524ae6c0387291e029550f1_64076b4177668a2e4a6a1d31_peter-thomas-TRAYV5rsA9Y-unsplash%25201.jpeg"
}{
"title": "Authorization has been denied for this request",
"status": 401
}{
"type": "https://api.cnaught.com/v1/errors/not-found",
"title": "Could not find category",
"status": 404
}Get Project Category By Id
Returns information about a project category
curl --request GET \
--url https://api.cnaught.com/v1/project-categories/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cnaught.com/v1/project-categories/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cnaught.com/v1/project-categories/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cnaught.com/v1/project-categories/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cnaught.com/v1/project-categories/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cnaught.com/v1/project-categories/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cnaught.com/v1/project-categories/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "XBfyJ8",
"name": "Oxford Type 1 - Emissions Reductions",
"description": "This category covers a wide range of projects that aim to reduce and avoid emissions versus business as usual. Examples include: renewable energy, destruction of refrigerants that would otherwise be vented to the atmosphere, and capture of methane emitted from landfills.",
"primary_image_url": "https://assets.cnaught.com/64fd900fcf6f93409fc7ff21/6524ae6c0387291e029550f1_64076b4177668a2e4a6a1d31_peter-thomas-TRAYV5rsA9Y-unsplash%25201.jpeg"
}{
"title": "Authorization has been denied for this request",
"status": 401
}{
"type": "https://api.cnaught.com/v1/errors/not-found",
"title": "Could not find category",
"status": 404
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the project category to return
"XBfyJ8"
Response
Project Catetgory Details
Details about a project category. Project categories are different classifications of projects - eg by Oxford Type.
Identifier that can be used to retrieve the project category details.
"Fc35bt3"
Name of the project category
"Oxford Type 1 - Emissions Reductions"
Description of the project category
"This category covers a wide range of projects that aim to reduce and avoid emissions versus business as usual."
URL of the primary image for the project category
"https://assets.cnaught.com/64fd900fcf6f93409fc7ff21/6524ae6c0387291e029550f1_64076b4177668a2e4a6a1d31_peter-thomas-TRAYV5rsA9Y-unsplash%25201.jpeg"