method
path
Path Parameters
Below are the query parameters available for customizing the response:string
required
Identifier of the post to be upvoted.
string
required
Email address of the user performing the upvote.
string | undefined
Name of the user performing the upvote (optional).
// Replace API_KEY with your api key
curl --location --request POST 'https://api.supahub.com/api/v1/votes/upvote_post' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer API_KEY' \
--data-urlencode 'postId=clryjbggw000g12evcnbcv0cqa' \
--data-urlencode '[email protected]' \
--data-urlencode 'name=user name'
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", "Bearer API_KEY"); // Replace API_KEY with your api key
const urlencoded = new URLSearchParams();
urlencoded.append("postId", "clryjbggw000g12evcnbcv0cqa");
urlencoded.append("email", "[email protected]");
urlencoded.append("name", "user name");
const requestOptions = {
method: "POST",
headers: myHeaders,
body: urlencoded,
redirect: "follow",
};
fetch("https://api.supahub.com/api/v1/votes/upvote_post", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
const axios = require('axios');
const qs = require('qs');
let data = qs.stringify({
'postId': 'clryjbggw000g12evcnbcv0cqa',
'email': '[email protected]',
'name': 'user name'
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.supahub.com/api/v1/votes/upvote_post',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer API_KEY' // Replace API_KEY with your api key
}
data : data
};
async function makeRequest() {
try {
const response = await axios.request(config);
console.log(JSON.stringify(response.data));
}
catch (error) {
console.log(error);
}
}
makeRequest();
import requests
url = "https://api.supahub.com/api/v1/votes/upvote_post"
payload = 'postId=clryjbggw000g12evcnbcv0cqa&email=useremail%40example.com&name=user%20name'
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer API_KEY' # Replace API_KEY with your key.
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)