Get Voting Link | Climes API
This endpoint gets the voting link for the specified order.
Request Parameters
Endpoint
/v3/integrations/vote/link?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
Name | Description | Type |
---|---|---|
link | This link is the link for the Map based selection of projects available on Climes Platform. Your user can vote using this link. | string |
Status Code
200
Response Data
{
"link": "https://climes.io/app/brands/YOUR_SLUG?action=vote&orderId=PARTNER_ORDER_ID"
}
tip
YOUR_SLUG
and PARTNER_ORDER_ID
will be auto populated and pre filled into the link before sending.
Sample Request
- cURL
- NodeJs
- Axios
- Python
- Php
curl --location --request GET 'BASE_URL/v3/integrations/vote/link?partnerOrderId=876287372837786837'
--header 'x-api-key: API_KEY'
const fetch = require('node-fetch');
const apiKey = 'API_KEY';
const url = 'BASE_URL/v3/integrations/vote/link?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/link?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/link?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/link?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
{
"link": "https://climes.io/app/brands/brand-slug?action=vote&orderId=876287372837786837"
}
{
"message": "Failed to get vote link."
}