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

infobip.examples.GetInboxLogsExample Maven / Gradle / Ivy

There is a newer version: 4.4.0
Show newest version
package infobip.examples;

import infobip.api.client.GetReceivedSmsLogs;
import infobip.api.config.BasicAuthConfiguration;
import infobip.api.model.sms.mo.logs.MOLog;
import infobip.api.model.sms.mo.logs.MOLogsResponse;

/**
 * Created by milosmilakovic on 9/23/15.
 */
public class GetInboxLogsExample extends Example {

    public static void main(String[] args) {
        GetReceivedSmsLogs client = new GetReceivedSmsLogs(new BasicAuthConfiguration(USERNAME, PASSWORD));

        MOLogsResponse response = client.execute(null, null, null, 10, null);

        for (int i = 0; i < response.getResults().size(); ++i) {
            MOLog result = response.getResults().get(i);
            System.out.println("Message ID: " + result.getMessageId());
            System.out.println("Received at: " + result.getReceivedAt());
            System.out.println("Sender: " + result.getFrom());
            System.out.println("Receiver: " + result.getTo());
            System.out.println("Message text: " + result.getText());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy