All Downloads are FREE. Search and download functionalities are using the official Maven repository.

infobip.examples.GetSentLogsExample Maven / Gradle / Ivy

There is a newer version: 4.4.0
Show newest version
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;

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 (SMSLog result : response.getResults()) {
            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());
            System.out.println("------------------------------------------------");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy