Generate secure document upload URLs
curl --request POST \
--url https://api-stage.karmacheck.io/document/secure/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"documentTypeId": "candidate-disclosures-and-authorizations",
"mimeType": "application/pdf"
}
]
}
'import requests
url = "https://api-stage.karmacheck.io/document/secure/upload"
payload = { "files": [
{
"documentTypeId": "candidate-disclosures-and-authorizations",
"mimeType": "application/pdf"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [
{
documentTypeId: 'candidate-disclosures-and-authorizations',
mimeType: 'application/pdf'
}
]
})
};
fetch('https://api-stage.karmacheck.io/document/secure/upload', 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-stage.karmacheck.io/document/secure/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'documentTypeId' => 'candidate-disclosures-and-authorizations',
'mimeType' => 'application/pdf'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-stage.karmacheck.io/document/secure/upload"
payload := strings.NewReader("{\n \"files\": [\n {\n \"documentTypeId\": \"candidate-disclosures-and-authorizations\",\n \"mimeType\": \"application/pdf\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-stage.karmacheck.io/document/secure/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"documentTypeId\": \"candidate-disclosures-and-authorizations\",\n \"mimeType\": \"application/pdf\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-stage.karmacheck.io/document/secure/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"documentTypeId\": \"candidate-disclosures-and-authorizations\",\n \"mimeType\": \"application/pdf\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"list": [
{
"url": "https://s3.amazonaws.com/dev.private.storage-bin.karmacheck.io/b92fef93-437f-4a05-adb7-182357b8a1f0?AWSAccessKeyId=ASIATUZWO5YBCYMY73ZZ&Content-Type=image%2Fjpeg&Expires=1710031824&Signature=x0e6I7GZFOJLUe%2FTkRmDjoNmNvc%3D&X-Amzn-Trace-Id=Root%3D1-65ecf5c0-4c1e58d24ba6707d02d69e20%3BParent%3D3898fdce19660298%3BSampled%3D0%3BLineage%3De3b20767%3A0&x-amz-security-token=FwoGZXIvYXdzEBEaDLO5SgCTmUgIMZ7bNyK5AUBiY%2B5i0%2B8%2Fcg8Y0XFmpfLWBqhmstkdrK3uF79EMlgDjWpX%2FqgRisuvbPzFFOZ9K1dgSorlUAPgTYIXKGdadO3ZsdsVTaL4kAZDX5qQNa%2FnP%2BFB9SVgqa6F4%2FIaBzA1aDiqs7w%2Ft7tGounuPV42O86V6ig3cuBHcx9%2BUOcd9mbJ2GGytKjDrZ7PBfIJimKy0tMFaFaTSCVIPcMVyqUe1%2BGFTHtc8686WQFpIW34Ff06SzPZmfQTVRcFKKXrs68GMi2QMcUwY0v194kGFN3WaGw1sqIqab3xJLwKXQGR4GbQUwiQHMK6Ws7cg4Hesx4%3D",
"fileKey": "b92fef93-437f-4a05-adb7-182357b8a1f0"
}
]
}Secure Documents
Generate secure document upload URLs
Generates short-lived URLs that can be used to upload one or more secure documents to the KarmaCheck system. This API call is step 1 of 3 when adding a document to the system and linking it to a case.
The returned URLs expire after 1 hour. If an attempt to use an expired URL occurs, the server responds with a 403 HTTP status code.
POST
/
document
/
secure
/
upload
Generate secure document upload URLs
curl --request POST \
--url https://api-stage.karmacheck.io/document/secure/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"documentTypeId": "candidate-disclosures-and-authorizations",
"mimeType": "application/pdf"
}
]
}
'import requests
url = "https://api-stage.karmacheck.io/document/secure/upload"
payload = { "files": [
{
"documentTypeId": "candidate-disclosures-and-authorizations",
"mimeType": "application/pdf"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [
{
documentTypeId: 'candidate-disclosures-and-authorizations',
mimeType: 'application/pdf'
}
]
})
};
fetch('https://api-stage.karmacheck.io/document/secure/upload', 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-stage.karmacheck.io/document/secure/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'documentTypeId' => 'candidate-disclosures-and-authorizations',
'mimeType' => 'application/pdf'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-stage.karmacheck.io/document/secure/upload"
payload := strings.NewReader("{\n \"files\": [\n {\n \"documentTypeId\": \"candidate-disclosures-and-authorizations\",\n \"mimeType\": \"application/pdf\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-stage.karmacheck.io/document/secure/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"documentTypeId\": \"candidate-disclosures-and-authorizations\",\n \"mimeType\": \"application/pdf\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-stage.karmacheck.io/document/secure/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"documentTypeId\": \"candidate-disclosures-and-authorizations\",\n \"mimeType\": \"application/pdf\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"list": [
{
"url": "https://s3.amazonaws.com/dev.private.storage-bin.karmacheck.io/b92fef93-437f-4a05-adb7-182357b8a1f0?AWSAccessKeyId=ASIATUZWO5YBCYMY73ZZ&Content-Type=image%2Fjpeg&Expires=1710031824&Signature=x0e6I7GZFOJLUe%2FTkRmDjoNmNvc%3D&X-Amzn-Trace-Id=Root%3D1-65ecf5c0-4c1e58d24ba6707d02d69e20%3BParent%3D3898fdce19660298%3BSampled%3D0%3BLineage%3De3b20767%3A0&x-amz-security-token=FwoGZXIvYXdzEBEaDLO5SgCTmUgIMZ7bNyK5AUBiY%2B5i0%2B8%2Fcg8Y0XFmpfLWBqhmstkdrK3uF79EMlgDjWpX%2FqgRisuvbPzFFOZ9K1dgSorlUAPgTYIXKGdadO3ZsdsVTaL4kAZDX5qQNa%2FnP%2BFB9SVgqa6F4%2FIaBzA1aDiqs7w%2Ft7tGounuPV42O86V6ig3cuBHcx9%2BUOcd9mbJ2GGytKjDrZ7PBfIJimKy0tMFaFaTSCVIPcMVyqUe1%2BGFTHtc8686WQFpIW34Ff06SzPZmfQTVRcFKKXrs68GMi2QMcUwY0v194kGFN3WaGw1sqIqab3xJLwKXQGR4GbQUwiQHMK6Ws7cg4Hesx4%3D",
"fileKey": "b92fef93-437f-4a05-adb7-182357b8a1f0"
}
]
}Authorizations
Body
application/json