GetResponseAPI is an API wrapper for the GetResponse API 3.0 that allows you to use basic API methods such as listning, adding, and removing contacts as well as fetching the list of your campaigns.
To use the library you need to have an active GetResponse account with assosicated Developer API Key.
This library is using CocoaPods to maintain library dependencies.
We use AFNetworking for the communication layer and JSONModel for modeling the response objects.
- Add
pod 'GetResponseAPI'
to your Podfile - Run
pod install
- Add
#import "GRApi.h"
from your bridging header, prefix header, or wherever you want to use the library
First, set an API key:
[[GRApi sharedInstance] setupWithApiKey:DEVELOPER_API_KEY];
From now on, you can use the shared instance of the GRApi
object in your project to make API calls.
The API comes with following set of helper methods:
[[GRApi sharedInstance] setVerbose:(BOOL)]; //Enable logging
[[GRApi sharedInstance] setResultsPerPage:(NSNumber]; //Self-explanatory
The setVerbose
method will enable the underlying AFNetworkActivityLogger
library in debug mode.
[[GRApi sharedInstance] getContactByEmail:@"[email protected]" inCampaign:@"existing_campaign_name" completion:^(GRContact *contact, NSError *error) {
if (!error) {
NSLog(@"Got contact with name: %@ for email %@", contact.name, contact.email);
//Do anything you want with the GRContact model.
}
}];
Some of the methods come with the paging mechanism that is returning a totalPages
parameter after the first call. You can set the number of results per page as described in sections above.
[[GRApi sharedInstance] getContactsWithPageNumber:nil completion:^(NSArray *contactsArray, NSNumber *totalPages, NSError *error) {
if (!error) {
NSLog(@"Got %li contacts. Total pages: %i", contactsArray.count, totalPages.intValue);
//Do anything you want with contactsArray that consists of GRContact models
}
}];
You can inspect a set of examples that are included in the Samples directory.
We've attached a sample application called ApiWrapper
that utilizes almost every method created in the API wrapper so far and we strongly reccomends you to take a look.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Add your changes & test them.
- Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
This library is using a series of unit tests to ensure it is working properly.
For more information about testing, see the Testing page in our wiki.
See LICENSE.TXT