Deregister a recipient (v2)

Purpose

Removes a recipient from a given application.

URL

Sandbox

https://sandbox.httpush.com/ACCOUNT_KEY/v2/recipient/registration.json
https://sandbox.httpush.com/ACCOUNT_KEY/v2/recipient/registration.xml

Production

https://production.httpush.com/ACCOUNT_KEY/v2/recipient/registration.json
https://production.httpush.com/ACCOUNT_KEY/v2/recipient/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.

Usage Notes

recipient_key should be URL encoded.

Example JSON data

{"a": "05673b6d12c796afc0cb74849e60573949bf2521", "r": "test"}

Example XML data

<?xml version="1.0" encoding="UTF-8"?>
<deregister>
  <a>05673b6d12c796afc0cb74849e60573949bf2521</a>
  <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" : "user_name is missing"}
400   {"error" : "user_name is too long (100 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", "r": "test"}' -u 'c3bb3b10864278055b3873503629904b98862895:1ab182418e3bca321dab504f96dd0339869eef0c' https://sandbox.httpush.com/ACCOUNT_KEY/v2/recipient/registration.json
curl -k -X DELETE -d '<?xml version="1.0" encoding="UTF-8"?><register><a>05673b6d12c796afc0cb74849e60573949bf2521</a><r>test</r></register>' -u 'c3bb3b10864278055b3873503629904b98862895:1ab182418e3bca321dab504f96dd0339869eef0c' https://sandbox.httpush.com/ACCOUNT_KEY/v2/recipient/registration.xml

Do you have an example to share in the language of your choice? Please share!