1

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"

Charles
  • 50,943
  • 13
  • 104
  • 142
Jobin
  • 8,238
  • 1
  • 33
  • 52
  • nothing added in error_log it return like this array(1) { [0]=> string(9) "Forbidden" } string(19) "{"status":"normal"}" string(24) "{"errors":["Forbidden"]}" – Jobin Oct 04 '12 at 07:18
  • 2
    it means "You are logged in, but do not have permission to perform that action" from iContact http://developer.icontact.com/documentation/http-status-codes/ – GBD Oct 04 '12 at 07:55
  • thanks for your response .ok , i saw the error codes but i can do all other action like adding new contact etc ..even unsubscription ? – Jobin Oct 04 '12 at 08:25

0 Answers0