Create a Document
curl --request POST \
--url https://api.treasuryprime.com/document \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": {
"date_of_birth": "1980-03-15"
},
"file_id": "file_567890",
"name": "California Drivers License",
"type": "drivers_license"
}
'import requests
url = "https://api.treasuryprime.com/document"
payload = {
"fields": { "date_of_birth": "1980-03-15" },
"file_id": "file_567890",
"name": "California Drivers License",
"type": "drivers_license"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields: {date_of_birth: '1980-03-15'},
file_id: 'file_567890',
name: 'California Drivers License',
type: 'drivers_license'
})
};
fetch('https://api.treasuryprime.com/document', 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.treasuryprime.com/document",
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([
'fields' => [
'date_of_birth' => '1980-03-15'
],
'file_id' => 'file_567890',
'name' => 'California Drivers License',
'type' => 'drivers_license'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.treasuryprime.com/document"
payload := strings.NewReader("{\n \"fields\": {\n \"date_of_birth\": \"1980-03-15\"\n },\n \"file_id\": \"file_567890\",\n \"name\": \"California Drivers License\",\n \"type\": \"drivers_license\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.treasuryprime.com/document")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": {\n \"date_of_birth\": \"1980-03-15\"\n },\n \"file_id\": \"file_567890\",\n \"name\": \"California Drivers License\",\n \"type\": \"drivers_license\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treasuryprime.com/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": {\n \"date_of_birth\": \"1980-03-15\"\n },\n \"file_id\": \"file_567890\",\n \"name\": \"California Drivers License\",\n \"type\": \"drivers_license\"\n}"
response = http.request(request)
puts response.read_body{
"bankdata": {},
"created_at": "2021-03-25T21:31:50Z",
"fields": {
"date_of_birth": "1980-03-15"
},
"file_id": "file_567890",
"id": "doc_123456",
"name": "California Drivers License",
"type": "drivers_license",
"updated_at": "2021-03-25T21:31:50Z",
"userdata": {}
}Document
Create a Document
POST
/
document
Create a Document
curl --request POST \
--url https://api.treasuryprime.com/document \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": {
"date_of_birth": "1980-03-15"
},
"file_id": "file_567890",
"name": "California Drivers License",
"type": "drivers_license"
}
'import requests
url = "https://api.treasuryprime.com/document"
payload = {
"fields": { "date_of_birth": "1980-03-15" },
"file_id": "file_567890",
"name": "California Drivers License",
"type": "drivers_license"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields: {date_of_birth: '1980-03-15'},
file_id: 'file_567890',
name: 'California Drivers License',
type: 'drivers_license'
})
};
fetch('https://api.treasuryprime.com/document', 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.treasuryprime.com/document",
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([
'fields' => [
'date_of_birth' => '1980-03-15'
],
'file_id' => 'file_567890',
'name' => 'California Drivers License',
'type' => 'drivers_license'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.treasuryprime.com/document"
payload := strings.NewReader("{\n \"fields\": {\n \"date_of_birth\": \"1980-03-15\"\n },\n \"file_id\": \"file_567890\",\n \"name\": \"California Drivers License\",\n \"type\": \"drivers_license\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.treasuryprime.com/document")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": {\n \"date_of_birth\": \"1980-03-15\"\n },\n \"file_id\": \"file_567890\",\n \"name\": \"California Drivers License\",\n \"type\": \"drivers_license\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treasuryprime.com/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": {\n \"date_of_birth\": \"1980-03-15\"\n },\n \"file_id\": \"file_567890\",\n \"name\": \"California Drivers License\",\n \"type\": \"drivers_license\"\n}"
response = http.request(request)
puts response.read_body{
"bankdata": {},
"created_at": "2021-03-25T21:31:50Z",
"fields": {
"date_of_birth": "1980-03-15"
},
"file_id": "file_567890",
"id": "doc_123456",
"name": "California Drivers License",
"type": "drivers_license",
"updated_at": "2021-03-25T21:31:50Z",
"userdata": {}
}Authorizations
basicAuthapiKey
Body
application/json
The document to create
Response
200 - application/json
The document created
Was this page helpful?