Get the status of your send message
If you need to retreive the log for a specific message here is how you can do it.
Retreive a single log by messageid
If the log exist you will find a Log property in the answer. The return object is Log
static Guid serial = new Guid("CF97C28F-CEAE-4FE3-B5CE-1D65AFF21039");
static Guid APIuser = new Guid("42A24D7D-256C-4671-86C0-3381CFA228DC");
static Guid APIpassword = new Guid("8097AF06-ADAD-4FB5-ADAF-C0AEF84727FF");
static Uri endpoint = new Uri("https://www.secure-exchanges.com/_api/0217/0217.asmx");
// Get the log associated with the message
var answer = LogsHelper.GetLog(
new GetLogArgs(endpoint, serial, APIUser, APIpassword, messageId)
);
// Validate if it's a success
if(answer.Status==200)
{
// The Log is here
var myLog = answer.Log
}
Retreive a single log by tracking id
If the log exist you will find a Log property in the answer. The return object is Log
static Guid serial = new Guid("CF97C28F-CEAE-4FE3-B5CE-1D65AFF21039");
static Guid APIuser = new Guid("42A24D7D-256C-4671-86C0-3381CFA228DC");
static Guid APIpassword = new Guid("8097AF06-ADAD-4FB5-ADAF-C0AEF84727FF");
static Uri endpoint = new Uri("https://www.secure-exchanges.com/_api/0217/0217.asmx");
// Get the log associated with the message
var answer = LogsHelper.GetLog(
new GetLogArgs(endpoint, serial, APIUser, APIpassword) { TrackingID = trackingID }
);
// Validate if it's a success
if(answer.Status==200)
{
// The Log is here
var myLog = answer.Log
}
Retreive logs by range
You can retreive the logs for the API user by calling the GetLogs methods.
That will return a List<Log> of logs.
DateTime from = DateTime.Now.AddMonths(-2);
DateTime to = DateTime.Now;
static Guid serial = new Guid("CF97C28F-CEAE-4FE3-B5CE-1D65AFF21039");
static Guid APIuser = new Guid("42A24D7D-256C-4671-86C0-3381CFA228DC");
static Guid APIpassword = new Guid("8097AF06-ADAD-4FB5-ADAF-C0AEF84727FF");
static Uri endpoint = new Uri("https://www.secure-exchanges.com/_api/0217/0217.asmx");
// Get the log associated with the message
var answer = LogsHelper.GetLogs(
new GetLogArgs(endpoint, serial, APIUser, APIpassword,from,to
);
// Validate if it's a success
if(answer.Status==200)
{
// The Log is here
var myLogs = answer.Logs
}
Retreive log for another user
Note
If the api need to access to the log from another user, the API license must have the role and right to retreive logs from another user
By date range
DateTime from = DateTime.Now.AddMonths(-2);
DateTime to = DateTime.Now;
static Guid serial = new Guid("CF97C28F-CEAE-4FE3-B5CE-1D65AFF21039");
static Guid APIuser = new Guid("42A24D7D-256C-4671-86C0-3381CFA228DC");
static Guid APIpassword = new Guid("8097AF06-ADAD-4FB5-ADAF-C0AEF84727FF");
static Uri endpoint = new Uri("https://www.secure-exchanges.com/_api/0217/0217.asmx");
// Get the log associated with the message
var answer = LogsHelper.GetLogs(
new GetLogArgs(endpoint, serial, APIUser, APIpassword, from, to)
{
UserLogSerial = userSerial // The serial of the user you are lookin to retreived
}
);
// Validate if it's a success
if(answer.Status==200)
{
// The Log is here
var myLogs = answer.Logs
}
By tracking id or message id
static Guid serial = new Guid("CF97C28F-CEAE-4FE3-B5CE-1D65AFF21039");
static Guid APIuser = new Guid("42A24D7D-256C-4671-86C0-3381CFA228DC");
static Guid APIpassword = new Guid("8097AF06-ADAD-4FB5-ADAF-C0AEF84727FF");
static Uri endpoint = new Uri("https://www.secure-exchanges.com/_api/0217/0217.asmx");
// Get the log associated with the message
var answer = LogsHelper.GetLogs(
new GetLogArg(endpoint, serial, APIUser, APIpassword)
{
TrackingID = tracking, // Note that only one can be use trackingID or MessageID
MessageID = msgID, // Note that only one can be use trackingID or MessageID
UserLogSerial = userSerial // The serial of the user you are lookin to retreived
}
);
// Validate if it's a success
if(answer.Status==200)
{
// The Log is here
var myLogs = answer.Logs
}