POST push/update
Update a Push notification that has not yet been delivered (i.e.- scheduled Pushes).
URL:
http://mobileroadie.com/api/push/update
Formats
XML, JSON, HTML
Requirements
SSL, API Secret, White-Listed IP Address
HTTP Method(s):
POST
URL Parameter(s):
-
key
-
Required
-
POST Parameters:
-
secret
-
Required.
-
-
id
-
Required. Id of existing entry from push/getAll or push/create
-
-
platform
-
Required. Possible values: “all”, “iphone”, “android”.
-
-
when
-
Required. Date and time message is to be sent. Format: YYYY-MM-DD hh:mm:ss.
-
-
timezones
-
A special code that defines which timezone the “when” date applies to, if different than PST. See table below for a list of codes.
-
-
description
-
Required. The body of the Push message.
-
-
type
-
Required. Possible values: “all”, “radius”. “all” sends to all users, “radius” allows you to send to a specific geographic area defined by the “location” and “radius” parameters below.
-
-
location
-
Required when type = radius. Zipcode or City, State.
-
-
radius
-
Required when type = radius. Number of miles.
-
-
url
-
URL that user is directed to when push message is opened.
-
Usage Example
<?php $data = array( 'secret' => 'your_secret_key', 'id' => '12345', 'platform' => 'all', 'when' => '2012-01-01 00:00:00', 'timezones' => 'UM8', 'description' => 'Happy New Year, Beverly Hills!', 'type' => 'radius', 'location' => '90211', 'radius' => '5', 'url' => 'http://mobileroadie.com/', ); $handle = curl_init("https://mobileroadie.com/api/push/update/key/4d4ba30d73b77f7"); curl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($handle, CURLOPT_POST, true); curl_setopt($handle, CURLOPT_POSTFIELDS, $data); $response = curl_exec($handle); curl_close($handle); ?>
Success Response
<xml> <id>1234567890</id> </xml>
Response when Missing Required Fields
<xml> <error>[FieldName1] is required. [FieldNameX] is required.</error> </xml>
Timezone Codes
Code Timezone ---- -------------------------------------------------------------- UM12 (UTC - 12:00) Enitwetok, Kwajalien UM11 (UTC - 11:00) Nome, Midway Island, Samoa UM10 (UTC - 10:00) Hawaii UM9 (UTC - 9:00) Alaska UM8 (UTC - 8:00) Pacific Time UM7 (UTC - 7:00) Mountain Time UM6 (UTC - 6:00) Central Time, Mexico City UM5 (UTC - 5:00) Eastern Time, Bogota, Lima, Quito UM4 (UTC - 4:00) Atlantic Time, Caracas, La Paz UM25 (UTC - 3:30) Newfoundland UM3 (UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is. UM2 (UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena UM1 (UTC - 1:00) Azores, Cape Verde Islands UTC (UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia UP1 (UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome UP2 (UTC + 2:00) Kaliningrad, South Africa, Warsaw UP3 (UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi UP25 (UTC + 3:30) Tehran UP4 (UTC + 4:00) Adu Dhabi, Baku, Muscat, Tbilisi UP35 (UTC + 4:30) Kabul UP5 (UTC + 5:00) Islamabad, Karachi, Tashkent UP45 (UTC + 5:30) Bombay, Calcutta, Madras, New Delhi UP6 (UTC + 6:00) Almaty, Colomba, Dhaka UP7 (UTC + 7:00) Bangkok, Hanoi, Jakarta UP8 (UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei UP9 (UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk UP85 (UTC + 9:30) Adelaide, Darwin UP10 (UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok UP11 (UTC + 11:00) Magadan, New Caledonia, Solomon Islands UP12 (UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island
Comments
0 comments
Please sign in to leave a comment.