List Messages
Request URL
GET /messages
Description
List all messages to or from the current user. The maximum number is limited by a configuration parameter.
Snippet Examples
javascript
const axios = require('axios');
const config = {
method: 'GET',
url: '${AMPLIFI_BASE_URL}/messages',
headers: {
'token': "A long random string token received from /token request"
},
};
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/messages" --header "token: A long random string token received from /token request"
Successful Response Examples
200 MESSAGES SUCCESSFUL RESPONSE GET ALL USER MESSAGES
HEADERS
Header | Value |
---|---|
token | A long random string token received from /token request |
REQUEST BODY
RESPONSE BODY
{
"success": true,
"messages": [
{
"toAFiUserId": "qweaurl8kgtlv9pc",
"fromAFiUserId": "AmpliFi Support",
"dtsCreated": "2022-09-27T17:22:03.180Z",
"title": null,
"text": "Welcome to AmpliFi.",
"href": null,
"isRead": false,
"isDelivered": true,
"messagePriorityCode": 3,
"AFiMessageId": "qwemsgl8kgugj0oidfvcgyygqpuiiqaaodsn",
"dedupCode": "ipjujuviff"
},
{
"toAFiUserId": "qweaurl8kgtlv9pc",
"fromAFiUserId": "AmpliFi Support",
"dtsCreated": "2022-09-27T17:22:08.184Z",
"title": "Welcome to AmpliFi!",
"text": "Welcome to AmpliFi! You've got $10 welcome bonus.",
"href": null,
"isRead": false,
"isDelivered": true,
"messagePriorityCode": 1,
"AFiMessageId": "qwemsgl8kguke0qpblvxpsgoghpabtgygccq",
"dedupCode": "jufdvbgzek"
},
{
"toAFiUserId": "qweaurl8kgtlv9pc",
"fromAFiUserId": "AmpliFi Support",
"dtsCreated": "2022-11-22T18:30:43.353Z",
"title": null,
"text": "External 9...9991 card was added successfully",
"href": null,
"isRead": false,
"isDelivered": true,
"messagePriorityCode": null,
"AFiMessageId": "qwemsglasjyh09myepdryzlmtbujdepbcloj",
"dedupCode": "ktpqrajrnh"
},
...,
{
"toAFiUserId": "qweaurl8kgtlv9pc",
"fromAFiUserId": "AmpliFi Support",
"dtsCreated": "2023-12-13T13:56:38.026Z",
"title": "ampliFi",
"text": "Topup amount is too small",
"href": null,
"category": null,
"severity": null,
"page": null,
"extraData": null,
"isRead": false,
"isDelivered": true,
"messagePriorityCode": 3,
"AFiMessageId": "qwemsglq3u4t1muxjczxxbocykqhibanealm",
"dedupCode": "lhhbdmaeft"
},
{
"toAFiUserId": "qweaurl8kgtlv9pc",
"fromAFiUserId": "AmpliFi Support",
"dtsCreated": "2023-12-13T13:57:24.538Z",
"title": null,
"text": "Account top up initiated.",
"href": null,
"category": null,
"severity": null,
"page": null,
"extraData": null,
"isRead": false,
"isDelivered": true,
"messagePriorityCode": 2,
"AFiMessageId": "qwemsglq3u5sxmkyzkgfulszvglwgehxfjnv",
"dedupCode": "faidporjjg"
},
{
"toAFiUserId": "qweaurl8kgtlv9pc",
"fromAFiUserId": "AmpliFi Support",
"dtsCreated": "2023-12-13T14:06:21.187Z",
"title": null,
"text": "-$1 Transaction pending",
"href": null,
"category": null,
"severity": null,
"page": null,
"extraData": null,
"isRead": false,
"isDelivered": true,
"messagePriorityCode": 2,
"AFiMessageId": "qwemsglq3uhb0juehjwkvclbafkumbhdcakq",
"dedupCode": "ukpslqrhzz"
}
]
}