Problem with API when deleting user from list
Hi guys,
when i try to use the API to subscribe a user to a list using /subscribe everything is ok.
when i try to delete the user calling /api/subscribers/delete.php i got en error "List ID not passed" even if it is passed.
I also noticed that the param list id has not the same name when calling /subscribe and /api/subscribers/delete.php for a strange reason by the way. list -> list_id
Thanks for your help !
This discussion has been closed.
Comments
Hi,
The parameter for the list's ID is
list_id
, did you use the correct parameter name?Best regards,
Ben
yes i mention that i make you understand that i saw the same parameter change name between the create and delete request.
my create request which work :
Unirest.post(apiUrl + "/subscribe")
.field("api_key", API_KEY)
.field("email", user.getEmail())
.field("name", user.getPrenom() + " " + user.getNom())
.field("list", listEnum.getId())
.asString()
.getBody();
My delete request which does not work :
Unirest.post(apiUrl + "/api/subscribers/delete.php")
.field("api_key", API_KEY)
.field("list_id ", listEnum.getId())
.field("email", user.getEmail())
.asString()
.getBody();
Are you sure /api/subscribers/delete.php work ? There is no bug in it ?
I just tested the
/api/subscribers/delete.php
API and can confirm there are no bugs:Best regards,
Ben
Sorry but which http method did you use ? POST or DELETE ?
very strange...
Ok i found the bug there was a space in my "list_id " > "list_id"
omg...
Thanks for your help !