infobip.examples.GetSentLogsExample Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infobip-api-java-client Show documentation
Show all versions of infobip-api-java-client Show documentation
API client in Java for Infobip's API (http://dev.infobip.com/).
package infobip.examples;
import infobip.api.client.GetSentSmsLogs;
import infobip.api.config.BasicAuthConfiguration;
import infobip.api.model.sms.mt.logs.SMSLog;
import infobip.api.model.sms.mt.logs.SMSLogsResponse;
/**
* Created by milosmilakovic on 9/24/15.
*/
public class GetSentLogsExample extends Example {
public static void main(String[] args) {
GetSentSmsLogs client = new GetSentSmsLogs(new BasicAuthConfiguration(USERNAME, PASSWORD));
SMSLogsResponse response = client.execute(null, null, null, null, null, null, null, 10, null, null);
for (int i = 0; i < response.getResults().size(); ++i) {
SMSLog result = response.getResults().get(i);
System.out.println("Message ID: " + result.getMessageId());
System.out.println("Sent at: " + result.getSentAt());
System.out.println("Sender: " + result.getFrom());
System.out.println("Receiver: " + result.getTo());
System.out.println("Message text: " + result.getText());
System.out.println("Status: " + result.getStatus().getName());
System.out.println("Price: " + result.getPrice().getPricePerMessage() + " " + result.getPrice().getCurrency());
}
}
}