Deregister a recipient from a group (v2)
Purpose
Removes a recipient from a given group.
URL
Sandbox
https://sandbox.httpush.com/ACCOUNT_KEY/v2/group/registration.json
https://sandbox.httpush.com/ACCOUNT_KEY/v2/group/registration.xml
Production
https://production.httpush.com/ACCOUNT_KEY/v2/group/registration.json
https://production.httpush.com/ACCOUNT_KEY/v2/group/registration.xml
Find your ACCOUNT_KEY on
the dashboard at the management web site.
HTTP Method
DELETE
Formats
JSON, XML
Requires Authentication
Yes (about Authentication)
Parameters
Send the parameters as either JSON or XML data as the body of your request.
a: Theapplication_hash. Provided by the management site. Identifies under which application the recipient should be created.g: Thegroup_hash. Provided by the management site. Identifies under which group the recipient should be created.r: Arecipient_key(an application wide unique identifier for a given recipient). Can be anything you want but you should hash therecipient_keyto make its encoding save for the web. You should use a SHA-1 hash on therecipient_key. The max. length is 128 characters. Therecipient_keyshould be unique.
Usage Notes
recipient_key should be URL encoded.
Example JSON data
{"a": "05673b6d12c796afc0cb74849e60573949bf2521", "g": "8373b6d12c796afc0cb74849e60573949bf2521","r": "test"}
Example XML data
<?xml version="1.0" encoding="UTF-8"?> <deregister> <a>05673b6d12c796afc0cb74849e60573949bf2521</a> <g>849275d12c796afc0cb74849e60573949849275</g> <r>test</r> </deregister>
Response
See return codes for all codes, here are specific ones:
400 {"error" : "error parsing the input"}
400 {"error" : "application_hash is missing"}
400 {"error" : "application_hash has wrong length"}
400 {"error" : "group_hash is missing"}
400 {"error" : "group_hash has wrong length"}
400 {"error" : "recipient is missing"}
400 {"error" : "recipient is too long (128 chars max)"}
400 {"error" : "application_hash not found"}
XML returns the same errors string like JSON.
<?xml version="1.0" encoding="UTF-8"?> <errors> <error>application_hash has wrong length</error> </errors>
Usage examples
cURL (about cURL)
curl -k -X DELETE -d '{"a": "05673b6d12c796afc0cb74849e60573949bf2521", "g": "849275d12c796afc0cb74849e60573949849275", "r": "test"}' -u 'c3bb3b10864278055b3873503629904b98862895:1ab182418e3bca321dab504f96dd0339869eef0c' https://sandbox.httpush.com/ACCOUNT_KEY/v2/group/registration.json
curl -k -X DELETE -d '<?xml version="1.0" encoding="UTF-8"?><register><a>05673b6d12c796afc0cb74849e60573949bf2521</a><g>849275d12c796afc0cb74849e60573949849275</g><r>test</r></register>' -u 'c3bb3b10864278055b3873503629904b98862895:1ab182418e3bca321dab504f96dd0339869eef0c' https://sandbox.httpush.com/ACCOUNT_KEY/v2/group/registration.xml
Do you have an example to share in the language of your choice? Please share!