Upload documents to a profile
1 min
POST
https://api.detected.app/api/v2/public/profiles/{uuid}/documents/{libraryId}
Path Parameters
- uuidstringrequiredDescription
- libraryIdintegerrequiredDescription
Form Parameters
- documentsmap<string, BinaryFile>requiredDescription
Responses
200
- DocumentViewResponse[]
- idnumberrequiredDescription
- profile_idstringrequiredDescription
- document_idstringrequiredDescription
- categorystringrequiredDescription
- namestringrequiredDescription
- linkstringrequiredDescription
- file_typestringrequiredDescription
- link_expires_atstringrequiredDescription
- fraud_checkobjectDescription
- processed_atstringDescription
- analysisobjectDescription
- scorestringDescription
- document_typestringDescription
- meta_dataobjectDescription
- producerstringDescription
- creatorstringDescription
- creation_datestringDescription
- mod_datestringDescription
- authorstringDescription
- keywordsstringDescription
- subjectstringDescription
- titlestringDescription
- indicatorsobject[]Description
- typestringDescription
- categorystringDescription
- titlestringDescription
- descriptionstringDescription
- translationobjectDescription
- statusstringDescription
- linkstringDescription
- file_typestringDescription
- link_expires_atstringDescription
- extractedstringDescription
- ocrobjectDescription
- extractedstringDescription
- updated_atstringrequiredDescription
- created_atstringrequiredDescription
400
- object
- messagestringDescription
401
- object
- messagestringDescription
422
- object
- messagestringDescription
- example_fieldstring[]Description
429
- object
- messagestringDescription
curl
curl --request POST \
--url https://api.detected.app/api/v2/public/profiles/{uuid}/documents/{libraryId} \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form 'documents="map"'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "multipart/form-data");
var formdata = new FormData();
formdata.append("documents", "map");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("https://api.detected.app/api/v2/public/profiles/{uuid}/documents/{libraryId}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "net/http"
url = URI("https://api.detected.app/api/v2/public/profiles/{uuid}/documents/{libraryId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "multipart/form-data"
form_data = [['documents', File.open('undefined')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
python
import requests
url = "https://api.detected.app/api/v2/public/profiles/{uuid}/documents/{libraryId}"
payload = {}
files=[
]
headers = {
'accept': 'application/json',
'content-type': 'multipart/form-data'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
200
// OK. The documents were uploaded, and the response lists them.
[
{
"id": 0,
"profile_id": "",
"document_id": "",
"category": "",
"name": "",
"link": "",
"file_type": "",
"link_expires_at": "",
"fraud_check": {
"processed_at": "",
"analysis": {
"score": "",
"document_type": "",
"meta_data": {
"producer": "",
"creator": "",
"creation_date": "",
"mod_date": "",
"author": "",
"keywords": "",
"subject": "",
"title": ""
},
"indicators": [
{
"type": "",
"category": "",
"title": "",
"description": ""
}
]
}
},
"translation": {
"status": "",
"link": "",
"file_type": "",
"link_expires_at": "",
"extracted": ""
},
"ocr": {
"extracted": ""
},
"updated_at": "",
"created_at": ""
}
]400
// Bad Request. The request could not be processed because it is invalid. The message field explains why.
{
"message": ""
}401
// Unauthorized. The access token is missing, invalid or has expired.
{
"message": ""
}422
// Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.
{
"message": "",
"example_field": [
""
]
}429
// Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the Retry-After header before trying again.
{
"message": ""
}