Skip to content

Take Prospect Data

Request URL

POST /prospect/data

Description

This API is used to submit data from or about a prospect. Typical data is shown in the request body example. The actual data can vary widely. The payload contains a segment-specific set of data required to register the user (e.g. name, address, and other personal info).

Schema

Property table for prospect/data

Property Description Required Schema
deviceTag The device tag (id) Yes {
  "type": "string"
}
preSegment The original category of prospect (ex. teacher, adult) No {
  "type": "string",
  "nullable": true
}
deviceData A device-specific set of data No {
  "additionalProperties": true,
  "type": "object",
  "required": [],
  "nullable": true
}
linkinjected A link to another user No {
  "additionalProperties": true,
  "type": "object",
  "required": [],
  "nullable": true
}
deepLink A code with which family members get linked to each other No {
  "additionalProperties": true,
  "type": "object",
  "required": [],
  "nullable": true
}
referral A code from a friend No {
  "type": "string",
  "nullable": true
}
dtsCollected The current date and time No {
  "type": "string",
  "nullable": true
}
payload A segment-specific set of data required to register the user; e.g. name, address, and other personal info Yes payload object

Property table for payload object

Property Description Required Schema
referral A code from a friend No {
  "type": "string",
  "nullable": true
}
referrerAFiUserId referrerAFiUserId No {
  "type": "string",
  "nullable": true
}
client client No client object

Property table for client object

Property Description Required Schema
email The user's email address Yes {
  "type": "string"
}
mobile The user's mobile phone number Yes {
  "type": "string"
}
isIntroSeen True if the intro should be displayed to this user No {
  "type": "boolean",
  "nullable": true
}
name Name of the entity Yes name object
dob Date of birth Yes dob object
address Address details Yes address object
extra An object containing any additional properties that were requested No extra object
ssn The user's Social Security Number (for US) Yes {
  "type": "string",
  "pattern": "^\d{9}$"
}
document An identification document information object, such as for SSN or Driver's License No document object
languageCode The user's primary language or device language No {
  "type": "string",
  "nullable": true
}

Property table for document object

Property Description Required Schema
type Entity type No {
  "type": "string",
  "nullable": true
}
number number No {
  "type": "string",
  "nullable": true
}
issued issued No {
  "type": "string",
  "nullable": true
}
expires expires No {
  "type": "string",
  "nullable": true
}
issuingState issuingState No {
  "type": "string",
  "nullable": true
}
raw raw No {
  "type": "object",
  "nullable": true
}

Property table for extra object

Property Description Required Schema
sex sex No {
  "type": "string",
  "nullable": true
}
eyeColor eyeColor No {
  "type": "string",
  "nullable": true
}
hairColor hairColor No {
  "type": "string",
  "nullable": true
}
heightMetric Height in cm No {
  "type": "string",
  "nullable": true
}
weightMetric Weight in kg No {
  "type": "string",
  "nullable": true
}

Property table for address object

Property Description Required Schema
addressLine1 addressLine1 Yes {
  "type": "string"
}
addressLine2 addressLine2 No {
  "type": "string",
  "nullable": true
}
city city Yes {
  "type": "string"
}
postalCode postalCode Yes {
  "type": "string"
}
state state Yes {
  "type": "string",
  "minLength": 2,
  "maxLength": 2
}
country Country code Yes {
  "type": "string"
}

Property table for dob object

Property Description Required Schema
day The day of the month Yes {
  "type": "string",
  "pattern": "^\d{2}$"
}
month month Yes {
  "type": "string",
  "pattern": "^\d{2}$"
}
year year Yes {
  "type": "string",
  "pattern": "^\d{4}$"
}

Property table for name object

Property Description Required Schema
firstName First name Yes {
  "type": "string"
}
middleName Middle name No {
  "type": "string",
  "nullable": true
}
lastName Last name Yes {
  "type": "string"
}

Request Body

{
    "deviceTag": "o1vd1oc0nw8",
    "preSegment": "demo_uoiuqwehflkipahgoqq",
    "dtsCollected": "2022-06-20T15:33:22.726Z",
    "linkinjected": "null",
    "payload": {
        "referrerAFiUserId": "qweaurl4zdpfo2hu",
        "client": {
            "email": "test.email@abc.test",
            "mobile": "5556667777",
            "isIntroSeen": "true",
            "name": {
                "firstName": "John",
                "middleName": "Quincy",
                "lastName": "Smith"
            },
            "dob": {
                "day": "01",
                "month": "01",
                "year": "1975"
            },
            "address": {
                "addressLine1": "123 Main Str.",
                "city": "Harrisburg",
                "postalCode": "12345",
                "state": "PA",
                "country": "USA"
            },
            "extra": {
                "sex": "M",
                "eyeColor": "BRO",
                "hairColor": "BLK",
                "heightMetric": "181",
                "weightMetric": "85"
            },
            "ssn": "123456789",
            "document": {
                "type": "US driving license",
                "number": "99999999",
                "issued": "10052015",
                "expires": "08042027",
                "issuingState": "PA",
                "raw": {}
            },
            "languageCode": "en"
        }
    },
    "deviceData": {  
        "platform": "android",
        "build": "0.0.01"
    },
    "deepLink": "null",
    "referral": "BBQFCHQXN"
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
    "deviceTag": "o1vd1oc0nw8",
    "preSegment": "demo_uoiuqwehflkipahgoqq",
    "dtsCollected": "2022-06-20T15:33:22.726Z",
    "linkinjected": "null",
    "payload": {
        "referrerAFiUserId": "qweaurl4zdpfo2hu",
        "client": {
            "email": "test.email@abc.test",
            "mobile": "5556667777",
            "isIntroSeen": "true",
            "name": {
                "firstName": "John",
                "middleName": "Quincy",
                "lastName": "Smith"
            },
            "dob": {
                "day": "01",
                "month": "01",
                "year": "1975"
            },
            "address": {
                "addressLine1": "123 Main Str.",
                "city": "Harrisburg",
                "postalCode": "12345",
                "state": "PA",
                "country": "USA"
            },
            "extra": {
                "sex": "M",
                "eyeColor": "BRO",
                "hairColor": "BLK",
                "heightMetric": "181",
                "weightMetric": "85"
            },
            "ssn": "123456789",
            "document": {
                "type": "US driving license",
                "number": "99999999",
                "issued": "10052015",
                "expires": "08042027",
                "issuingState": "PA",
                "raw": {}
            },
            "languageCode": "en"
        }
    },
    "deviceData": {  
        "platform": "android",
        "build": "0.0.01"
    },
    "deepLink": "null",
    "referral": "BBQFCHQXN"
}
;
const config = {
  method: 'POST',
  url: '${AMPLIFI_BASE_URL}/prospect/data',
  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/data" --data "{    \"deviceTag\":\"o1vd1oc0nw8\",   \"preSegment\":\"demo_uoiuqwehflkipahgoqq\",   \"dtsCollected\":\"2022-06-20T15:33:22.726Z\",   \"linkinjected\":\"null\",   \"payload\":{        \"referrerAFiUserId\":\"qweaurl4zdpfo2hu\",       \"client\":{            \"email\":\"test.email@abc.test\",           \"mobile\":\"5556667777\",           \"isIntroSeen\":\"true\",           \"name\":{                \"firstName\":\"John\",               \"middleName\":\"Quincy\",               \"lastName\":\"Smith\"            },           \"dob\":{                \"day\":\"01\",               \"month\":\"01\",               \"year\":\"1975\"            },           \"address\":{                \"addressLine1\":\"123 Main Str.\",               \"city\":\"Harrisburg\",               \"postalCode\":\"12345\",               \"state\":\"PA\",               \"country\":\"USA\"            },           \"extra\":{                \"sex\":\"M\",               \"eyeColor\":\"BRO\",               \"hairColor\":\"BLK\",               \"heightMetric\":\"181\",               \"weightMetric\":\"85\"            },           \"ssn\":\"123456789\",           \"document\":{                \"type\":\"US driving license\",               \"number\":\"99999999\",               \"issued\":\"10052015\",               \"expires\":\"08042027\",               \"issuingState\":\"PA\",               \"raw\":{}            },           \"languageCode\":\"en\"        }    },   \"deviceData\":{          \"platform\":\"android\",       \"build\":\"0.0.01\"    },   \"deepLink\":\"null\",   \"referral\":\"BBQFCHQXN\"}" --header "Content-Type: application/json" --header "token: A long random string token received from /token request" 

Successful Response Examples

200 PROSPECT/DATA SUCCESSFUL RESPONSE

HEADERS

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

REQUEST BODY

{
    "deviceTag": "o1vd1oc0nw8",
    "preSegment": "demo_uoiuqwehflkipahgoqq",
    "dtsCollected": "2022-06-20T15:33:22.726Z",
    "linkinjected": "null",
    "payload": {
        "referrerAFiUserId": "qweaurl4zdpfo2hu",
        "client": {
            "email": "test.email@abc.test",
            "mobile": "5556667777",
            "isIntroSeen": "true",
            "name": {
                "firstName": "John",
                "middleName": "Quincy",
                "lastName": "Smith"
            },
            "dob": {
                "day": "01",
                "month": "01",
                "year": "1975"
            },
            "address": {
                "addressLine1": "123 Main Str.",
                "city": "Harrisburg",
                "postalCode": "12345",
                "state": "PA",
                "country": "USA"
            },
            "extra": {
                "sex": "M",
                "eyeColor": "BRO",
                "hairColor": "BLK",
                "heightMetric": "181",
                "weightMetric": "85"
            },
            "ssn": "123456789",
            "document": {
                "type": "US driving license",
                "number": "99999999",
                "issued": "10052015",
                "expires": "08042027",
                "issuingState": "PA",
                "raw": {}
            },
            "languageCode": "en"
        }
    },
    "deviceData": {  
        "platform": "android",
        "build": "0.0.01"
    },
    "deepLink": "null",
    "referral": "BBQFCHQXN"
}

RESPONSE BODY

{
    "success": true
}