Generic Prospect
Request URL
POST /prospect/generic
Description
This API is used to present an arbitrary request that will be interpreted by the system for a specific user.
Schema
Property table for schema 1 for prospect/generic
Property | Description | Required | Schema |
---|---|---|---|
type | Entity type | Yes | { "type": "string", "enum": [ "adult account recovery" ] } |
deviceData | A device-specific set of data | Yes | deviceData object |
The user's email address | Yes | { "type": "string" } |
|
mobile | The user's mobile phone number | Yes | { "type": "string" } |
Property table for schema 2 for prospect/generic
Property | Description | Required | Schema |
---|---|---|---|
type | Entity type | Yes | { "type": "string", "enum": [ "adult account recovery confirm" ] } |
AFiUserId | ampliFi ID for the user | Yes | { "type": "string" } |
recoveryCode | A recovery code | Yes | { "type": "string" } |
Property table for schema 3 for prospect/generic
Property | Description | Required | Schema |
---|---|---|---|
type | Entity type | Yes | { "type": "string", "enum": [ "adult2 signup" ] } |
deviceTag | The device tag (id) | Yes | { "type": "string" } |
deepLinkCode | A code with which family members get linked to each other | Yes | { "type": "string" } |
deviceData | A device-specific set of data | Yes | deviceData object |
firstName | First name | No | { "type": "string", "nullable": true } |
middleName | Middle name | No | { "type": "string", "nullable": true } |
lastName | Last name | No | { "type": "string", "nullable": true } |
dob | Date of birth | No | { "type": "string", "nullable": true } |
Property table for data object
Property | Description | Required | Schema |
---|---|---|---|
platform | The device platform | Yes | { "type": "string" } |
pushMessToken | A message token to push | Yes | { "type": "string" } |
Property table for deviceData object
Property | Description | Required | Schema |
---|---|---|---|
data | data | Yes | data object |
deviceTag | The device tag (id) | Yes | { "type": "string" } |
platform | The device platform | No | { "type": "string", "nullable": true } |
Request Body
{
"newCard": {
"AFiUserId": "qweaurl8kgtlv9pc",
"payload": [{
"typeId": "virtual",
"AFiAccountId": "qwegal8kgtmysmels",
"deliveryAddress": "test",
"name": "Virtual"
}]
}
}
Snippet Examples
javascript
const axios = require('axios');
const data = {
"newCard": {
"AFiUserId": "qweaurl8kgtlv9pc",
"payload": [{
"typeId": "virtual",
"AFiAccountId": "qwegal8kgtmysmels",
"deliveryAddress": "test",
"name": "Virtual"
}]
}
};
const config = {
method: 'POST',
url: '${AMPLIFI_BASE_URL}/prospect/generic',
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/generic" --data "{\"newCard\":{\"AFiUserId\":\"qweaurl8kgtlv9pc\", \"payload\":[{ \"typeId\":\"virtual\", \"AFiAccountId\":\"qwegal8kgtmysmels\", \"deliveryAddress\":\"test\", \"name\":\"Virtual\" }]}}" --header "Content-Type: application/json" --header "token: A long random string token received from /token request"
Successful Response Examples
200 PROSPECT/GENERIC SUCCESSFUL RESPONSE
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
token | A long random string token received from /token request |
REQUEST BODY
{
"newCard": {
"AFiUserId": "qweaurl8kgtlv9pc",
"payload": [{
"typeId": "virtual",
"AFiAccountId": "qwegal8kgtmysmels",
"deliveryAddress": "test",
"name": "Virtual"
}]
}
}
RESPONSE BODY