src/XQueue/Maileon/API/Contacts/ContactsService.php
function unsubscribeContactById($id, $mailingId = "", $reasons = null)
    {
        $queryParameters = array(
            'id' => $id
        );

        if (!empty($mailingId)) {
            $queryParameters['mailingId'] = $mailingId;
        }
        if (!empty($reasons)) {
            if (is_array($reasons)) {
                $queryParameters = $this->appendArrayFields($queryParameters, 'reason', $reasons);
            } else {
                $queryParameters['reason'] = urlencode($reasons);
            }
        }

        return $this->delete("contacts/contact/unsubscribe", $queryParameters);
    }
function unsubscribeContactById($id, $mailingId = "", $reasons = null)
    {
        $queryParameters = array(
            'id' => $id
        );

        if (!empty($mailingId)) {
            $queryParameters['mailingId'] = $mailingId;
        }
        if (!empty($reasons)) {
            if (is_array($reasons)) {
                $queryParameters = $this->appendArrayFields($queryParameters, 'reason', $reasons);
            } else {
                $queryParameters['reason'] = urlencode($reasons);
            }
        }

        return $this->delete("contacts/contact/unsubscribe", $queryParameters);
    }
function unsubscribeContactById ( $ id , $ mailingId = "" , $ reasons = null ) { $ queryParameters = array ( 'id' => $ id ) ; if ( ! empty ( $ mailingId ) ) { $ queryParameters [ 'mailingId' ] = $ mailingId ; } if ( ! empty ( $ reasons ) ) { if ( is_array ( $ reasons ) ) { $ queryParameters = $ this -> appendArrayFields ( $ queryParameters , 'reason' , $ reasons ) ; } else { $ queryParameters [ 'reason' ] = urlencode ( $ reasons ) ; } } return $ this -> delete ( "contacts/contact/unsubscribe" , $ queryParameters ) ; }
This method unsubscribes a contact from Maileon using the Maileon id.

@param int $id
@param long $mailingId The ID of the mailing to assign the unsubscribe to. the mailing must have been sent, i.e. be sealed.
@param array $reasons an array of reasons or a single reason (string). Unsubscription reasons have two layers
of information, see http://dev.maileon.com/api/rest-api-1-0/contacts/unsubscribe-contacts-by-maileon-id for more details about the format.
The parameter(s) will be url-encoded by the client, you do not need to provide urlencoded strings.
@return \em com_maileon_api_MaileonAPIResult
the result object of the API call
@throws com_maileon_api_MaileonAPIException
if there was a connection problem or a server error occurred
This method unsubscribes a contact from Maileon using the Maileon id .