Connect Socket
Request URL
POST /prospect/connectsocket
Description
This endpoint requests authorization of a websocket connection to enable efficient 2-way communication with this prospect.
Schema
Property table for prospect/connectsocket
Property | Description | Required | Schema |
---|---|---|---|
halfRef | A long random string | Yes | { "type": "string" } |
deviceTag | The device tag (id) | Yes | { "type": "string" } |
linkinjected | A link to another user | No | { "type": "string", "nullable": true } |
Request Body
{
"halfRef": "l8t0rw2m4zzpi1goeytt597bhtz31ljbf0zo0vz1w2kxeskgwmz36bjafvg8kx1rbwb2bzm4l0xgmux81t",
"deviceTag": "my_deviceTag"
}
Snippet Examples
javascript
const axios = require('axios');
const data = {
"halfRef": "l8t0rw2m4zzpi1goeytt597bhtz31ljbf0zo0vz1w2kxeskgwmz36bjafvg8kx1rbwb2bzm4l0xgmux81t",
"deviceTag": "my_deviceTag"
};
const config = {
method: 'POST',
url: '${AMPLIFI_BASE_URL}/prospect/connectsocket',
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/connectsocket" --data "{ \"halfRef\":\"l8t0rw2m4zzpi1goeytt597bhtz31ljbf0zo0vz1w2kxeskgwmz36bjafvg8kx1rbwb2bzm4l0xgmux81t\", \"deviceTag\":\"my_deviceTag\" }" --header "Content-Type: application/json" --header "token: A long random string token received from /token request"
Successful Response Examples
200 PROSPECT/CONNECTSOCKET SUCCESSFUL RESPONSE
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
token | A long random string token received from /token request |
REQUEST BODY
{
"halfRef": "l8t0rw2m4zzpi1goeytt597bhtz31ljbf0zo0vz1w2kxeskgwmz36bjafvg8kx1rbwb2bzm4l0xgmux81t",
"deviceTag": "my_deviceTag"
}
RESPONSE BODY