ActiveCampaign / activecampaign-api-php

MIT License
115 stars 76 forks source link

missing id param in contact delete #65

Closed zx-alioscia closed 7 years ago

zx-alioscia commented 7 years ago

Hello this is the delete request: https://xxx.api-us1.com/admin/api.php?api_key=XXX&api_action=contact_delete&api_output=json&

Note that the "id" field is missing (http://www.activecampaign.com/api/example.php?call=contact_delete)

The delete method in AC_Contact class could accept the contact id to be deleted:

function delete($params, $id) { $request_url = "{$this->url}&api_action=contact_delete&api_output={$this->output}id={$id}"; ... }

and the call could be: $response = $ac->api('contact/delete', $contactId);

pevans commented 7 years ago

I'm not sure what you're asking, here.

zx-alioscia commented 7 years ago

i could not make "contact/delete" working because of the missing "id" field in activecampaign-api-php implementation (delete method in AC_Contact class).. and i suggested a possible fix..

ghost commented 7 years ago

@zx-alioscia In this case the call should work fine. Looking at the example you were providing it's just missing some parameters that's required within the call. As for the second parameter for the api method that's generally held for post data.

If you're doing something similar to say $response = $ac->api('contact/delete', $contactId);

The correct format of this should be similar to $response = $ac->api("contact/delete?id={$contactId}");

zx-alioscia commented 7 years ago

Ok fine, now i see.. thank you for support!