Get Projects for Current vote | Climes API
This endpoint fetches all the projects available for voting for that partner_order_id
.
caution
This will send only those projects which are available. Any of the projects can be removed subject to availability.
Request Parameters
Request Query Schema
Name | Description | Type | Optional |
---|---|---|---|
partnerOrderId | This partner_order_id is the same which was used while creating an order. | string | required |
Endpoint
/v3/integrations/vote/projects?partnerOrderId=PARTNER_ORDER_ID
tip
Replace PARTNER_ORDER_ID
with the partner_order_id
that you sent while placing an order.
Method
GET
Headers
{
'x-api-key' : 'API_KEY'
}
Response Parameters
Response Schema
Each response is an array which has individual project object
Project Schema
Name | Description | Type |
---|---|---|
title | This is the title of project. | string |
project_id | This is the unique id of the project which can be used while sending orders to send climes of that order to selected project. | string |
type | It is the type of the project. | string |
location | This is the location at which the project is located. | string |
main_image | This is the url of the main image for the project. | string |
project_developer | This is the developer of the project. | string |
registry_name | This is the registry name which have verified the generation of credit. | string |
Status Code
200
Response Data
[
{
"title": "Making biodiverse forests financially viable for farmers",
"project_id": "farmers-for-forests",
"type": "Reforestation",
"location": "Ahmednagar, Maharashtra",
"main_image": "https://cdn.images.climes.io/projects-new/f4f_cardimage.png?ik-sdk-version=javascript-1.4.3&updatedAt=1656931774908",
"project_developer": "By Farmers for Forests",
"registry_name": "Climes"
},
{
"title": "Agroforestry to combat land degradation in Karnataka",
"project_id": "say-trees",
"type": "Reforestation",
"location": "Tumakuru, Karnataka",
"main_image": "https://cdn.images.climes.io/projects-new/SayTrees_cardimage.png?ik-sdk-version=javascript-1.4.3&updatedAt=1656931775394",
"project_developer": "By SayTrees",
"registry_name": "Climes"
},
{
"title": "Waste to Energy by Mahindra WES LTD",
"project_id": "waste-to-energy-mahindra",
"type": "Waste to Energy",
"location": "Maharashtra",
"main_image": "https://cdn.images.climes.io/projects-new/WTE_Mahindra_cardimage.png?ik-sdk-version=javascript-1.4.3&updatedAt=1656931774926",
"project_developer": "By Mahindra Wes Ltd.",
"registry_name": "Verra"
}
]
Sample Request
- cURL
- NodeJs
- Axios
- Python
- Php
curl --location --request GET 'BASE_URL/v3/integrations/vote/projects?partnerOrderId=876287372837786837'
--header 'x-api-key: API_KEY'
const fetch = require('node-fetch');
const apiKey = 'API_KEY';
const url = 'BASE_URL/v3/integrations/projects?partnerOrderId=876287372837786837';
const headers = {
'x-api-key': apiKey
};
fetch(url, { headers })
.then(response => response.json())
.then(data => {
console.log(data); // Handle the response data here
})
.catch(error => {
console.error(error); // Handle any errors that occur during the request
});
var axios = require('axios');
var config = {
method: 'get',
url: 'BASE_URL/v3/integrations/vote/projects?partnerOrderId=876287372837786837',
headers: {
'x-api-key': 'API_KEY'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
url = "BASE_URL/v3/integrations/vote/projects?partnerOrderId=876287372837786837"
payload={}
headers = {
'x-api-key': 'API_KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('BASE_URL/v3/integrations/vote/projects?partnerOrderId=876287372837786837');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => 'API_KEY'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Sample Response
Below are sample responses for the above sample request.
Responses
- Success - 200
- Failure - 400
[
{
"title": "Making biodiverse forests financially viable for farmers",
"project_id": "farmers-for-forests",
"type": "Reforestation",
"location": "Ahmednagar, Maharashtra",
"main_image": "https://cdn.images.climes.io/projects-new/f4f_cardimage.png?ik-sdk-version=javascript-1.4.3&updatedAt=1656931774908",
"project_developer": "By Farmers for Forests",
"registry_name": "Climes"
},
{
"title": "Agroforestry to combat land degradation in Karnataka",
"project_id": "say-trees",
"type": "Reforestation",
"location": "Tumakuru, Karnataka",
"main_image": "https://cdn.images.climes.io/projects-new/SayTrees_cardimage.png?ik-sdk-version=javascript-1.4.3&updatedAt=1656931775394",
"project_developer": "By SayTrees",
"registry_name": "Climes"
},
{
"title": "Waste to Energy by Mahindra WES LTD",
"project_id": "waste-to-energy-mahindra",
"type": "Waste to Energy",
"location": "Maharashtra",
"main_image": "https://cdn.images.climes.io/projects-new/WTE_Mahindra_cardimage.png?ik-sdk-version=javascript-1.4.3&updatedAt=1656931774926",
"project_developer": "By Mahindra Wes Ltd.",
"registry_name": "Verra"
}
]
{
"message": "Failed to get projects."
}