Auth API
Authenticate API requests to CSVBox using a secure header-based scheme that validates both your API Key and Secret API Key.
Last updated
{
"message": "successfully authenticated",
"data": {
"name": "John Doe",
"email": "abc@xyz.com",
"profile_photo_url": "<url_string>"
}
}CSVBOX_API_KEY=your_api_key
CSVBOX_SECRET_API_KEY=your_secret_keycurl -i -X GET "https://api.csvbox.io/1.1/auth" \
-H "Accept: application/json" \
-H "x-csvbox-api-key: <your-api-key>" \
-H "x-csvbox-secret-api-key: <your-secret-key>"$.ajax({
url: "https://api.csvbox.io/1.1/auth",
headers: {
"x-csvbox-api-key": "<api-key>",
"x-csvbox-secret-api-key": "<secret-key>"
},
success: (data) => console.log("Authenticated:", data),
error: (xhr) => console.error("Error:", xhr.status, xhr.responseJSON)
});<?php
$ch = curl_init("https://api.csvbox.io/1.1/auth");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Accept: application/json",
"x-csvbox-api-key: " . getenv('CSVBOX_API_KEY'),
"x-csvbox-secret-api-key: " . getenv('CSVBOX_SECRET_API_KEY')
]);
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code === 200) {
echo "Authenticated successfully:\n" . $response;
} else {
echo "Authentication failed (HTTP $code):\n" . $response;
}import axios from "axios";
async function testAuth() {
try {
const res = await axios.get("https://api.csvbox.io/1.1/auth", {
headers: {
"Accept": "application/json",
"x-csvbox-api-key": process.env.CSVBOX_API_KEY,
"x-csvbox-secret-api-key": process.env.CSVBOX_SECRET_API_KEY
},
});
console.log("Authenticated:", res.data);
} catch (err) {
console.error("Error:", err.response?.data || err.message);
}
}
testAuth();