Skip to content

Commit

Permalink
Merge pull request #6 from zf-fr/update
Browse files Browse the repository at this point in the history
Update to latest API
  • Loading branch information
bakura10 committed Oct 20, 2013
2 parents c8a1a6e + 9cd37a6 commit eeb212f
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 1.2.0

* Added "GetProfile" method (allow to retrieve information about the profile that owns the API key)
* Added "GetListSegments", "AddListSegment", "DeleteListSegment", "UpdateListSegment" and "TestListSegment"

## 1.1.1

* Missing "id" parameter for "UpdateListMember" method.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ LIST RELATED METHODS:
* array addInterestGroup(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-group-add.php)
* array addInterestGrouping(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-grouping-add.php)
* array addListMergeVar(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-var-add.php)
* array addListSegment(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/segment-add.php)
* array addListWebhook(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/webhook-add.php)
* array batchSubscribe(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/batch-subscribe.php)
* array batchUnsubscribe(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/batch-unsubscribe.php)
* array deleteInterestGroup(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-group-del.php)
* array deleteInterestGrouping(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-grouping-del.php)
* array deleteListMergeVar(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-var-del.php)
* array deleteListSegment(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/segment-del.php)
* array deleteListWebhook(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/webhook-del.php)
* array getAbuseReports(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/abuse-reports.php)
* array getInterestGroupings(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-groupings.php)
Expand All @@ -134,15 +136,18 @@ LIST RELATED METHODS:
* array getListMembers(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/members.php)
* array getListMembersActivity(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/member-activity.php)
* array getListMembersInfo(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/member-info.php)
* array getListSegments(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/segments.php)
* array getListStaticSegments(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/static-segments.php)
* array getListWebhooks(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/webhooks.php)
* array resetListMergeVar(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-var-reset.php)
* array setListMergeVar(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/merge-var-set.php)
* array subscribe(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php)
* array testListSegment(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/segment-test.php)
* array unsubscribe(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/unsubscribe.php)
* array updateInterestGroup(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-group-update.php)
* array updateInterestGrouping(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/interest-grouping-update.php)
* array updateListMember(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/update-member.php)
* array updateListSegment(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/lists/segment-update.php)

ECOMM RELATED METHODS:

Expand Down Expand Up @@ -180,6 +185,7 @@ USERS RELATED METHODS:
* array inviteUser(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/invite.php)
* array getInvitations(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/invites.php)
* array getLogins(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/logins.php)
* array getProfile(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/profile.php)
* array reinviteUser(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/invite-resend.php)
* array revokeLogin(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/login-revoke.php)
* array revokeUserInvitation(array $args = array()) [doc](http://apidocs.mailchimp.com/api/2.0/users/invite-revoke.php)
Expand Down
6 changes: 6 additions & 0 deletions src/ZfrMailChimp/Client/MailChimpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@
* @method array addInterestGroup(array $args = array()) {@command MailChimp AddInterestGroup}
* @method array addInterestGrouping(array $args = array()) {@command MailChimp AddInterestGrouping}
* @method array addListMergeVar(array $args = array()) {@command MailChimp AddListMergeVar}
* @method array addListSegment(array $args = array()) {@command MailChimp AddListSegment}
* @method array addListWebhook(array $args = array()) {@command MailChimp AddListWebhook}
* @method array batchSubscribe(array $args = array()) {@command MailChimp BatchSubscribe}
* @method array batchUnsubscribe(array $args = array()) {@command MailChimp BatchUnsubscribe}
* @method array deleteInterestGroup(array $args = array()) {@command MailChimp DeleteInterestGroup}
* @method array deleteInterestGrouping(array $args = array()) {@command MailChimp DeleteInterestGrouping}
* @method array deleteListMergeVar(array $args = array()) {@command MailChimp DeleteListMergeVar}
* @method array deleteListSegment(array $args = array()) {@command MailChimp DeleteListSegment}
* @method array deleteListWebhook(array $args = array()) {@command MailChimp DeleteListWebhook}
* @method array getAbuseReports(array $args = array()) {@command MailChimp GetAbuseReports}
* @method array getInterestGroupings(array $args = array()) {@command MailChimp GetInterestGroupings}
Expand All @@ -67,15 +69,18 @@
* @method array getListMembers(array $args = array()) {@command MailChimp GetListMembers}
* @method array getListMembersActivity(array $args = array()) {@command MailChimp GetListMembersActivity}
* @method array getListMembersInfo(array $args = array()) {@command MailChimp GetListMembersInfo}
* @method array getListSegments(array $args = array()) {@command MailChimp GetListSegments}
* @method array getListStaticSegments(array $args = array()) {@command MailChimp GetListStaticSegments}
* @method array getListWebhooks(array $args = array()) {@command MailChimp GetListWebhooks}
* @method array resetListMergeVar(array $args = array()) {@command MailChimp ResetListMergeVar}
* @method array setListMergeVar(array $args = array()) {@command MailChimp SetListMergeVar}
* @method array subscribe(array $args = array()) {@command MailChimp Subscribe}
* @method array testListSegment(array $args = array()) {@command MailChimp TestListSegment}
* @method array unsubscribe(array $args = array()) {@command MailChimp Unsubscribe}
* @method array updateInterestGroup(array $args = array()) {@command MailChimp UpdateInterestGroup}
* @method array updateInterestGrouping(array $args = array()) {@command MailChimp UpdateInterestGrouping}
* @method array updateListMember(array $args = array()) {@command MailChimp UpdateListMember}
* @method array updateListSegment(array $args = array()) {@command MailChimp UpdateListSegment}
*
* ECOMM RELATED METHODS:
*
Expand Down Expand Up @@ -113,6 +118,7 @@
* @method array inviteUser(array $args = array()) {@command MailChimp InviteUser}
* @method array getInvitations(array $args = array()) {@command MailChimp GetInvitations}
* @method array getLogins(array $args = array()) {@command MailChimp GetLogins}
* @method array getProfile(array $args = array()) {@command MailChimp GetProfile}
* @method array reinviteUser(array $args = array()) {@command MailChimp ReinviteUser}
* @method array revokeLogin(array $args = array()) {@command MailChimp RevokeLogin}
* @method array revokeUserInvitation(array $args = array()) {@command MailChimp RevokeUserInvitation}
Expand Down
163 changes: 163 additions & 0 deletions src/ZfrMailChimp/Client/ServiceDescription/MailChimp-2.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,34 @@
)
),

'AddListSegment' => array(
'httpMethod' => 'POST',
'uri' => 'lists/segment-add.json',
'summary' => 'Save a segment against a list',
'documentationUrl' => 'http://apidocs.mailchimp.com/api/2.0/lists/segment-add.php',
'parameters' => array(
'api_key' => array(
'description' => 'MailChimp API key',
'location' => 'json',
'type' => 'string',
'sentAs' => 'apikey',
'required' => true
),
'id' => array(
'description' => 'The list id to connect to',
'location' => 'json',
'type' => 'string',
'required' => true
),
'opts' => array(
'description' => 'Options for the new segment',
'location' => 'json',
'type' => 'array',
'required' => false
)
)
),

'AddListWebhook' => array(
'httpMethod' => 'POST',
'uri' => 'lists/webhook-add.json',
Expand Down Expand Up @@ -824,6 +852,34 @@
)
),

'DeleteListSegment' => array(
'httpMethod' => 'POST',
'uri' => 'lists/segment-del.json',
'summary' => 'Delete a list segment',
'documentationUrl' => 'http://apidocs.mailchimp.com/api/2.0/lists/segment-del.php',
'parameters' => array(
'api_key' => array(
'description' => 'MailChimp API key',
'location' => 'json',
'type' => 'string',
'sentAs' => 'apikey',
'required' => true
),
'id' => array(
'description' => 'The list id to connect to',
'location' => 'json',
'type' => 'string',
'required' => true
),
'seg_id' => array(
'description' => 'The segment id to delete',
'location' => 'json',
'type' => 'integer',
'required' => true
)
)
),

'DeleteListWebhook' => array(
'httpMethod' => 'POST',
'uri' => 'lists/webhook-del.json',
Expand Down Expand Up @@ -1171,6 +1227,35 @@
)
),

'GetListSegments' => array(
'httpMethod' => 'POST',
'uri' => 'lists/segments.json',
'summary' => 'Get all the segments for a given list',
'documentationUrl' => 'http://apidocs.mailchimp.com/api/2.0/lists/segments.php',
'parameters' => array(
'api_key' => array(
'description' => 'MailChimp API key',
'location' => 'json',
'type' => 'string',
'sentAs' => 'apikey',
'required' => true
),
'id' => array(
'description' => 'The list id to connect to',
'location' => 'json',
'type' => 'string',
'required' => true
),
'type' => array(
'description' => 'Should be either "static" or "saved"',
'location' => 'json',
'type' => 'string',
'required' => false,
'enum' => array('static', 'saved')
)
)
),

'GetListStaticSegments' => array(
'httpMethod' => 'POST',
'uri' => 'lists/static-segments.json',
Expand Down Expand Up @@ -1344,6 +1429,34 @@
)
),

'TestListSegment' => array(
'httpMethod' => 'POST',
'uri' => 'lists/segment-test.json',
'summary' => 'Allow to test segmentation rules before creating a campaign using them',
'documentationUrl' => 'http://apidocs.mailchimp.com/api/2.0/lists/segment-test.php',
'parameters' => array(
'api_key' => array(
'description' => 'MailChimp API key',
'location' => 'json',
'type' => 'string',
'sentAs' => 'apikey',
'required' => true
),
'list_id' => array(
'description' => 'The list id to test segmentation on',
'location' => 'json',
'type' => 'string',
'required' => true
),
'options' => array(
'description' => 'Options for testing the segment',
'location' => 'json',
'type' => 'array',
'required' => false
)
)
),

'Unsubscribe' => array(
'httpMethod' => 'POST',
'uri' => 'lists/unsubscribe.json',
Expand Down Expand Up @@ -1512,6 +1625,40 @@
)
),

'UpdateListSegment' => array(
'httpMethod' => 'POST',
'uri' => 'lists/segment-update.json',
'summary' => 'Update an existing segment (the list and type can not be changed)',
'documentationUrl' => 'http://apidocs.mailchimp.com/api/2.0/lists/segment-update.php',
'parameters' => array(
'api_key' => array(
'description' => 'MailChimp API key',
'location' => 'json',
'type' => 'string',
'sentAs' => 'apikey',
'required' => true
),
'id' => array(
'description' => 'The list id to connect to',
'location' => 'json',
'type' => 'string',
'required' => true
),
'seg_id' => array(
'description' => 'The segment id to update',
'location' => 'json',
'type' => 'integer',
'required' => true
),
'opts' => array(
'description' => 'Options for the new segment',
'location' => 'json',
'type' => 'array',
'required' => false
)
)
),

/**
* --------------------------------------------------------------------------------
* ECOMM RELATED OPERATIONS
Expand Down Expand Up @@ -2131,6 +2278,22 @@
)
),

'GetProfile' => array(
'httpMethod' => 'POST',
'uri' => 'users/profile.json',
'summary' => 'Retrieve the profile for the login owning the provided API Key',
'documentationUrl' => 'http://apidocs.mailchimp.com/api/2.0/users/profile.php',
'parameters' => array(
'api_key' => array(
'description' => 'MailChimp API key',
'location' => 'json',
'type' => 'string',
'sentAs' => 'apikey',
'required' => true
)
)
),

'ReinviteUser' => array(
'httpMethod' => 'POST',
'uri' => 'users/invite-resend.json',
Expand Down

0 comments on commit eeb212f

Please sign in to comment.