Skip to content

Latest commit

 

History

History
73 lines (43 loc) · 1.79 KB

README.md

File metadata and controls

73 lines (43 loc) · 1.79 KB

Constant Contact JAVA SDK

Installation

In order to use the Constant Contact SDK you have to follow these steps:

  1. Add the constantcontact-2.0.jar library to classpath of your project.

Also add this libraries to classpath of project: jackson-annotations-2.1.1.jar jackson-core-2.1.1.jar jackson-databind-2.1.3.jar constant-contact-httpclient-4.2.3.jar

  1. Place your credentials in app.config file.

APIKey=APIkey
ConsumerSecret=ConsumerSecret
Password=password
Username=username
RedirectURL=RedirectURL

Usage

  1. In the file you wish to use the SDK include the following code in your file:

import com.constantcontact.*;
import com.constantcontact.components.contacts.*;
import com.constantcontact.services.*;
import com.constantcontact.authentication.*;
import com.constantcontact.util.*;

  1. Create a ConstantContact object

In order to use credentials defined in app.config file you can use this constructor:

ConstantContact constantContact = new ConstantContact();

Otherwise the credentials can be specified as constructor parameters

ConstantContact constantContact = new ConstantContact("username", "password", "apiKey", "redirectUrl");

  1. Use the functions of the SDK using the created object.

######Example for getting an contact

Contact contact = constantContact.getContact(int contactId);

######Example for getting contact list

ResultSet<Contact> contactList = constantContact.getContacts();

4)Usage in Android

In order to use the Constant Contact SDK for Android you have to include constant contact SDK sources and libraries.