Generate Document
Request URL
POST /akepa/document/generate
Description
This endpoint can be used to generate a document ID in preparation to upload a document file.
Schema
Property table for akepa/document/generate
Property | Description | Required | Schema |
---|---|---|---|
workflow | Type of workflow | Yes | { "type": "string", "enum": [ "BUSINESS", "PERSONAL" ], "$id": "akepa-workflow" } |
name | Name | Yes | { "type": "string", "pattern": "^((?![<>]).)*$", "minLength": 1, "maxLength": 50, "isNotOnlyWhitespace": true, "$id": "common-commonStr50Req" } |
extension | File extension | Yes | { "type": "string", "enum": [ "jpg", "png" ] } |
type | type | Yes | { "type": "string", "enum": [ "contract", "license", "passport", "utility", "other", "internal", "identification_card", "residence_permit", "canada_provincial_id", "indigenous_card", "paystub", "bank_statement", "w2", "1099", "1120", "1065", "t1", "t4" ] } |
note | A note or description | No | { "type": "string", "pattern": "^((?![<>]).)*$", "minLength": 0, "maxLength": 500, "nullable": true, "$id": "common-commonStr500" } |
note_author_agent_email | Email address of the note author | No | { "type": "string", "format": "email", "$id": "customer-email" } |
Request Body
Snippet Examples
javascript
const axios = require('axios');
const data = {
"workflow": "PERSONAL",
"name": "license",
"extension": "jpg",
"type": "license"
};
const config = {
method: 'POST',
url: '${CONNECTFI_BASE_URL}/akepa/document/generate',
headers: {
'Content-Type': "application/json",
'x-connectfi-token': "A long random string token received from /auth/get-token request"
},
data
};
let result;
try {
result = await axios.request(config);
if (result.status === 200) {
console.log(JSON.stringify(result.data));
}
} catch (err) {
console.log({
errCode: err.code,
responseStatus: err.response && err.response.status,
data: err.response && JSON.stringify(err.response.data)
});
}
cURL
curl --location "CONNECTFI_BASE_URL/akepa/document/generate" --data "{\"workflow\":\"PERSONAL\",\"name\":\"license\",\"extension\":\"jpg\",\"type\":\"license\"}" --header "Content-Type: application/json" --header "x-connectfi-token: A long random string token received from /auth/get-token request"
Successful Response Examples
200 AKEPA/DOCUMENT/GENERATE SUCCESSFUL RESPONSE FOR INDIVIDUAL CUSTOMER
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
x-connectfi-token | A long random string token received from /auth/get-token request |
REQUEST BODY
RESPONSE BODY
{
"code": "0",
"data": {
"id": "doc_71YxuRUnKqLhOWriDJFMI2",
"aggregatorId": "CLIENTID",
"uploadStatus": false,
"workflow": "PERSONAL",
"name": "license",
"extension": "jpg",
"type": "license",
"dtsCreatedAt": "2023-11-01T16:44:19.473Z"
},
"requestId": "e70a679078d511eeb5658f28ab5fe311"
}
200 AKEPA/DOCUMENT/GENERATE SUCCESSFUL RESPONSE FOR BUSINESS CUSTOMER
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
x-connectfi-token | A long random string token received from /auth/get-token request |
REQUEST BODY
RESPONSE BODY