Skip to content

Get Notification Data

When sending notifications with ReturnMode as RESUME, the response will be a RequestID that you can use to get the notification data.

This service will return information about the number of notifications sent, processed and processing.

JSON Body

{
"hash": "COMPANY_HASH",
"sentId": 00
}
  • hash: Hash of the company where the template is registered
  • sentId: The generated ID when sending notifications in ReturnMode = RESUME

Response

  • The response is a json with the following structure:
{
"success": true,
"message": "OK",
"content": {
"RequestId": 1,
"RequestDate": "2023-06-05T16:00:00",
"RequestStatus": "PROCESSED",
"TotalNumberReceived": 4,
"TotalNumberValid": 4,
"TotalNumberSuccess": 4,
"TotalNumberError": 0,
"TotalNumberWaiting": 0,
"TotalNumberCanceled": 0,
"RequestResult": [
{
"RequestSeq": 1,
"RequestPhoneNumber": "111111111",
"RequestStatus": "sent",
"RequestMessage": "OK",
"RequestSentDatetime": "2024-08-05T16:00:00",
"RequestDeliveryDatetime": "2024-08-05T16:00:00",
"RequestReadDatetime": "2024-08-05T16:00:00",
"RequestHasButton": true,
"RequestUserAnswered": true,
"RequestUserAnswer": "Sim",
"SentKeys": [
{
"Description": "NOME",
"Value": "Giuliano"
}
],
"SentParms": [
{
"Cod": "CPF",
"Value": "11111111111"
},
{
"Cod": "RG",
"Value": "11111111-1"
}
]
},
{
"RequestSeq": 1,
"RequestPhoneNumber": "222222222",
"RequestStatus": "sent",
"RequestMessage": "OK",
"RequestSentDatetime": "2024-08-05T16:00:00",
"RequestDeliveryDatetime": "2024-08-05T16:00:00",
"RequestReadDatetime": "2024-08-05T16:00:00",
"RequestHasButton": true,
"RequestUserAnswered": true,
"RequestUserAnswer": "Sim",
"SentKeys": [
{
"Description": "NOME",
"Value": "Giuliano"
}
],
"SentParms": [
{
"Cod": "CPF",
"Value": "11111111111"
},
{
"Cod": "RG",
"Value": "11111111-1"
}
]
},
{
"RequestSeq": 2,
"RequestPhoneNumber": "333333333",
"RequestStatus": "sent",
"RequestMessage": "OK",
"RequestSentDatetime": "2024-08-05T16:00:00",
"RequestDeliveryDatetime": "2024-08-05T16:00:00",
"RequestReadDatetime": "2024-08-05T16:00:00",
"RequestHasButton": true,
"RequestUserAnswered": true,
"RequestUserAnswer": "Sim",
"SentKeys": [
{
"Description": "NOME",
"Value": "Giuliano"
}
],
"SentParms": [
{
"Cod": "CPF",
"Value": "11111111111"
},
{
"Cod": "RG",
"Value": "11111111-1"
}
]
},
{
"RequestSeq": 2,
"RequestPhoneNumber": "444444444",
"RequestStatus": "sent",
"RequestMessage": "OK",
"RequestSentDatetime": "2024-08-05T16:00:00",
"RequestDeliveryDatetime": "2024-08-05T16:00:00",
"RequestReadDatetime": "2024-08-05T16:00:00",
"RequestHasButton": true,
"RequestUserAnswered": true,
"RequestUserAnswer": "Sim",
"SentKeys": [
{
"Description": "NOME",
"Value": "Giuliano"
}
],
"SentParms": [
{
"Cod": "CPF",
"Value": "11111111111"
},
{
"Cod": "RG",
"Value": "11111111-1"
}
]
}
]
}
}
  • Possible values for base RequestStatus:
    • CANCELED
    • QUEUED
    • PROCESSED
    • PROCESSING
  • Possible values for RequestResult Status:
    • canceled
    • waiting
    • sent
    • delivered
    • failed

Examples

var httpClient = new HttpClient
{
BaseAddress = new Uri("YOUR_ANNA_URL")
};
var result = await httpClient.PostAsJsonAsync("REST/Credentials/GetToken", new
{
hash = "COMPANY_HASH",
user = "USER",
pass = "PASSWORD"
});
var tokenResponse = await result.Content.ReadFromJsonAsync<GetTokenResponse>();
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenResponse?.Data.Token);
var getDataResult = await httpClient.PostAsJsonAsync("REST/Notifications/GetData", new
{
hash = "COMPANY_HASH",
sentId = 00
});
var getDataContent = await getDataResult.Content.ReadAsStringAsync();
return getDataContent;
public class GetTokenResponse
{
[JsonPropertyName("success")]
public bool Success { get; set; }
[JsonPropertyName("message")]
public string Message { get; set; } = string.Empty;
[JsonPropertyName("data")]
public TokenData Data { get; set; } = new();
}
public class TokenData
{
[JsonPropertyName("Token")]
public string Token { get; set; } = string.Empty;
[JsonPropertyName("ExpiresIn")]
public string ExpiresIn { get; set; } = string.Empty;
}