Submit Documents
POST
https://api.sfox.com/v1/enterprise/ddq/upload
Submit a document or set of documents on behalf of an end user.
Document Requirements
The supported MIME types for document submission are
image/jpeg,image/png,application/pdf.File extension must be one of
jpg,jpeg,png,pdf.File names specified in the
file_typesobject must exactly match the file name attached in thefilesarray. (e.g.files=[.../id_front.png]andfile_types={"id_front.png":"ID"})A valid document type must be submitted with the file name in
file_types. Options are:ID: Government issued IDs such as driver's licenses or passports.PoR: Proof of residence documents such as bank statements or utility bills.
Request
Body Parameters (Form Data)
user_id required
string
The unique user ID of the user that you are submitting a document or set of documents on behalf of.
files required
File[]
An array of the files you are uploading. Note, each file must be 10MB or smaller.
file_types required
string (JSON format)
The file name and document type of each file you are uploading in JSON format. e.g. {"<FILE_NAME>":"<DOCUMENT_TYPE>"}
File names MUST include the file extension and MUST exactly match the the corresponding file in files.
Possible document types: ID, PoR
ddq_id
string
The ID of the corresponding EDD request form that this submission is associated with.
Example Requests
// Submit a single document
curl --location 'https://api.sfox.com/v1/enterprise/ddq/upload' \
--header 'Authorization: Bearer ${ENTERPRISE_API_KEY}' \
--form 'files=@"${PATH_TO_FILE}"' \
--form 'user_id="${USER_ID}"' \
--form 'file_types="{\"${FILE_NAME}\":\"${DOCUMENT_TYPE}\"}"'// Submit a single document
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('files', fs.createReadStream('${PATH_TO_FILE}'));
data.append('user_id', '${USER_ID}');
data.append('file_types', '{"${FILE_NAME}":"${DOCUMENT_TYPE}"}');
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.sfox.com/v1/enterprise/ddq/upload',
headers: {
'Authorization': 'Bearer ${ENTERPRISE_API_KEY}'
...data.getHeaders()
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});// Submit a single document
import requests
url = "https://api.sfox.com/v1/enterprise/ddq/upload"
payload = {'user_id': '${USER_ID}',
'file_types': '{"${FILE_NAME}":"${DOCUMENT_TYPE}"}'}
files=[
('files',('${FILE_NAME}',open('${PATH_TO_FILE}','rb'),'${MIME_TYPE}'))
]
headers = {
'Authorization': 'Bearer ${ENTERPRISE_API_KEY}'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)Responses
Last updated