Get token for a recipient_key (v2)
Purpose
Get the token for a recipient_key in a given application.
URL
Sandbox
https://sandbox.httpush.com/ACCOUNT_KEY/v2/APP_HASH/recipient/RECIPIENT_KEY/exists.json
https://sandbox.httpush.com/ACCOUNT_KEY/v2/APP_HASH/recipient/RECIPIENT_KEY/exists.xml
Production
https://production.httpush.com/ACCOUNT_KEY/v2/APP_HASH/recipient/RECIPIENT_KEY/exists.json
https://production.httpush.com/ACCOUNT_KEY/v2/APP_HASH/recipient/RECIPIENT_KEY/exists.xml
Find your ACCOUNT_KEY on
the dashboard at the management web site.
The RECIPIENT_KEY must be
escaped. “big curl” (note the space) would be
“big+curl”.
HTTP Method
GET
Formats
JSON, XML
Requires Authentication
Yes (about Authentication)
Parameters
Send the parameters ACCOUNT_KEY, APP_HASH and RECIPIENT_KEY as part of the
URL.
APP_HASH: Theapplication_hash. Provided by the management site. Identifies under which application the recipient should be created.RECIPIENT_KEY: Arecipient_key(an application wide unique identifier for a given recipient). Must be escaped. “big curl” (note the space) would be “big+curl”.
Usage Notes
recipient_key must be escaped. “big curl”
(note the space) would be “big+curl”.
Example Data
Example JSON data
https://sandbox.httpush.com/ACCOUNT_KEY/v2/05673b6d12c796afc0cb74849e60573949bf2521/recipient/test/exists.json
Example XML data
https://sandbox.httpush.com/ACCOUNT_KEY/v2/05673b6d12c796afc0cb74849e60573949bf2521/recipient/test/exists.xml
Response
See return codes for all codes, here are specific ones:
JSON
200 {"token" : "05673b6d12c796afc0cb74849e60573949bf2521"}
400 {"error" : "application_hash not found"}
400 {"error" : "recipient not found"}
XML
XML returns the same errors string like JSON:
<?xml version="1.0" encoding="UTF-8"?> <recipient> <token>05673b6d12c796afc0cb74849e60573949bf2521</token> </recipient> <?xml version="1.0" encoding="UTF-8"?> <errors> <error>application_hash not found</error> </errors>
Usage examples
cURL (about cURL)
curl -k -u 'c3bb3b10864278055b3873503629904b98862895:1ab182418e3bca321dab504f96dd0339869eef0c' https://sandbox.httpush.com/ACCOUNT_KEY/v2/05673b6d12c796afc0cb74849e60573949bf2521/recipient/test/exists.json
curl -k -u 'c3bb3b10864278055b3873503629904b98862895:1ab182418e3bca321dab504f96dd0339869eef0c' https://sandbox.httpush.com/ACCOUNT_KEY/v2/05673b6d12c796afc0cb74849e60573949bf2521/recipient/test/exists.xml
Do you have an example to share in the language of your choice? Please share!