icontact subscription/unsubscription using API

940 Views Asked by At

I am using PHP icontact API 2.2. I faced an issue with subscription and unsubscription of contact to specific list using this API. I can subscribe properly but once i un-subscribe a contact then i can't subscribe it again.

I am using the code below

For subscription
$oiContact->subscribeContactToList($contact_id , $list_id ,'normal' );

for unsubscription
$oiContact->subscribeContactToList($contact_id , $list_id ,'unsubscribed' );

I also checked this http://developer.icontact.com/documentation/subscriptions/

Can any one help me to solve this ? they mentioned in this link

https://app.sandbox.icontact.com/icp/a/{accountId}/c/{clientFolderId}/subscriptions/{subscriptionId}

Using this method i wrote a function like

public function subscriptionStatus($subscriptionId,$sStatus = 'normal') {
        // Valid statuses
        $aValidStatuses = array('normal', 'pending', 'unsubscribed');
        // Setup the subscription and make the call
        $aSubscriptions = $this->makeCall("/a/{$this->setAccountId()}/c/{$this->setClientFolderId()}/subscriptions/{$subscriptionId}", 'POST', 

            array('status'    => $sStatus), 'subscriptions');
        // Return the subscription
        return $aSubscriptions;
    }

But it will return "error:Forbidden"

0

There are 0 best solutions below