Skip to content

Take Prospect Image

Request URL

POST /prospect/image

Description

This endpoint is used to upload an image for a prospect. The image may be a driver's license, a passport, or a face image. It should be in a common file format such as png and is base 64 encoded.

Schema

Property table for prospect/image

Property Description Required Schema
deviceTag The device tag (id) Yes {
  "type": "string"
}
AFiImageId User-generated image id Yes {
  "type": "string"
}
imageBase64 The image itself, base 64 encoded Yes {
  "type": "string"
}
type Entity type No {
  "type": "string",
  "nullable": true
}
dtsCreated Date/time entity was created No {
  "type": "string",
  "nullable": true
}

Request Body

{
    "deviceTag": "o1vd1oc0nw8",
    "AFiImageId": "l4mwddbcgiu0hq1h0gp",
    "type": "Face image",
    "preSegment": "demo_uoiuqwehflkipahgoqq",
    "imageBase64": "a+very+long+b64+encoded_string",
        "dtsCreated": "2022-06-20T15:33:22.529+00:00"
  }

Snippet Examples

javascript

const axios = require('axios');
const data = {
    "deviceTag": "o1vd1oc0nw8",
    "AFiImageId": "l4mwddbcgiu0hq1h0gp",
    "type": "Face image",
    "preSegment": "demo_uoiuqwehflkipahgoqq",
    "imageBase64": "a+very+long+b64+encoded_string",
        "dtsCreated": "2022-06-20T15:33:22.529+00:00"
  };
const config = {
  method: 'POST',
  url: '${AMPLIFI_BASE_URL}/prospect/image',
  headers: {
    'Content-Type': "application/json",
    'token': "A long random string token received from /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 "AMPLIFI_BASE_URL/prospect/image" --data "{    \"deviceTag\":\"o1vd1oc0nw8\",   \"AFiImageId\":\"l4mwddbcgiu0hq1h0gp\",   \"type\":\"Face image\",   \"preSegment\":\"demo_uoiuqwehflkipahgoqq\",   \"imageBase64\":\"a+very+long+b64+encoded_string\",       \"dtsCreated\":\"2022-06-20T15:33:22.529+00:00\"  }" --header "Content-Type: application/json" --header "token: A long random string token received from /token request" 

Successful Response Examples

200 PROSPECT/IMAGE SUCCESSFUL RESPONSE UPLOADING PROSPECT IMAGE

HEADERS

Header Value
Content-Type application/json
token A long random string token received from /token request

REQUEST BODY

{
    "deviceTag": "o1vd1oc0nw8",
    "AFiImageId": "l4mwddbcgiu0hq1h0gp",
    "type": "Face image",
    "preSegment": "demo_uoiuqwehflkipahgoqq",
    "imageBase64": "a+very+long+b64+encoded_string",
        "dtsCreated": "2022-06-20T15:33:22.529+00:00"
  }

RESPONSE BODY

{
    "success": true
}