Geozones
API methods to manage Geozones

getNearestZone

post
https://cp.pushwoosh.com/json/1.3
/getNearestZone
/getNearestZone
Example
1
{
2
"request": {
3
"application": "APPLICATION_CODE", // Pushwoosh application code
4
"hwid": "HWID", // hardware device ID used in /registerDevice function call
5
"lat": 10.12345, // latitude of the device
6
"lng": 28.12345 // longitude of the device
7
}
8
}
Copied!
1
<?php
2
//see http://gomoob.github.io/php-pushwoosh/get-nearest-zone.html
3
use Gomoob\Pushwoosh\Model\Request\GetNearestZoneRequest;
4
5
// Creates the request instance
6
$request = GetNearestZoneRequest::create()
7
->setHwid('HWID')
8
->setLat(10.12345)
9
->setLng(28.12345);
10
11
// Call the '/getNearestZone' Web Service
12
$response = $pushwoosh->getNearestZone($request);
13
14
if($response->isOk()) {
15
print 'Zone name : ' . $response->getResponse()->getName();
16
print 'Latitude : ' . $response->getResponse()->getLat();
17
print 'Longitude : ' . $response->getResponse()->getLng();
18
print 'Range : ' . $response->getResponse()->getRange();
19
print 'Distance : ' . $response->getResponse()->getDistance();
20
} else {
21
print 'Oups, the operation failed :-(';
22
print 'Status code : ' . $response->getStatusCode();
23
print 'Status message : ' . $response->getStatusMessage();
24
}
Copied!

addGeoZone

post
https://cp.pushwoosh.com/json/1.3
/addGeoZone
/addGeoZone
Example
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"application": "XXXXX-XXXXX", // Pushwoosh application code
5
"geozones": [{
6
"name": "Statue of George", // required. Geozone name.
7
"lat": "40.70087797", // required. Geozone latitude.
8
"lng": "-73.931851387", // required. Geozone longitude.
9
"cooldown": 60, // in seconds, required. Silent period after sending a notification.
10
"range": 50, // in meters, from 50 to 1000, required. Range of the geozone.
11
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", // or array, required is 'presetCode' field is empty.
12
"presetCode": "AAAAA-BBBBB", // optional. Push preset could be used instead of content field. Note: REQUIRED if content field is empty
13
"cluster": "GEOZONE CLUSTER CODE", // optional. Cluster's cooldown period will be applied. Specify null to unbind cluster from GeoZone.
14
"campaign": "CAMPAIGN_CODE", // optional. Specify null to unbind Campaign from GeoZone. If omit then Campaign value will not be changed. Has higher priority than Campaign from preset
15
"timetable": { // optional
16
"timezone": 1234, // in seconds
17
"Mon": [ // available days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Push sending stopped for missing day in list
18
{
19
"start": "04:11",
20
"stop": "12:00"
21
}
22
],
23
"Sun": [
24
{ // one or two intervals
25
"start": "01:11",
26
"stop": "17:00"
27
},
28
{
29
"start": "18:01",
30
"stop": "23:59"
31
}
32
]
33
}
34
}]
35
}
36
}
Copied!

updateGeoZone

post
https://cp.pushwoosh.com/json/1.3
/updateGeoZone
/updateGeoZone
For Private Offering subscriptions only.
Example
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"geoZoneId": 100016750, // from /addGeoZone method
5
"name": "new geozone name",
6
"cooldown": 222, // in seconds
7
"status": 0, // 0 - deactivated, 1 - activated
8
"presetCode": "BBBBB-AAAAA", // cannot be used along with "content"
9
"content": "new geozone content", // cannot be used along with "presetCode"
10
"cluster": "GEOZONE CLUSTER CODE", // Specify null to unbind cluster from GeoZone
11
"campaign": "CAMPAIGN_CODE", // Specify null to unbind Campaign from GeoZone. If omit then Campaign value will not be changed. Has higher priority than Campaign from preset
12
"lat" : 10.56, //geozone latitude
13
"lng" : 12.523,//geozone longitude
14
"range" : 500, ////geozone range
15
"timetable": {
16
"timezone": 1234, // in seconds
17
"Mon": [ // available days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Push sending stopped for missing day in list
18
{
19
"start": "04:11",
20
"stop": "12:00"
21
}
22
],
23
"Sun": [
24
{ // one or two intervals
25
"start": "01:11",
26
"stop": "17:00"
27
},
28
{
29
"start": "18:01",
30
"stop": "23:59"
31
}
32
]
33
}
34
}
35
}
Copied!

deleteGeoZone

post
https://cp.pushwoosh.com/json/1.3
/deleteGeoZone
/deleteGeoZone
For Private Offering subscriptions only.
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"application": "XXXXX-XXXXX", // Pushwoosh application code
5
"geozones": [550,526] // geozones IDs
6
}
7
}
Copied!

addGeoZoneCluster

post
https://cp.pushwoosh.com/json/1.3
/addGeoZoneCluster
/addGeoZoneCluster
For Private Offering subscriptions only.
Example
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"application": "XXXXX-XXXXX", // Pushwoosh application code
5
"name": "Raccoon city", // cluster name
6
"cooldown": 3210 // in seconds
7
}
8
}
Copied!

deleteGeoZoneCluster

post
https://cp.pushwoosh.com/json/1.3
/deleteGeoZoneCluster
/deleteGeoZoneCluster
For Private Offering subscriptions only.
Example
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"application": "XXXXX-XXXXX", // Pushwoosh application code
5
"geoZoneCluster": "EA1CE-69405" // cluster ID
6
}
7
}
Copied!

listGeoZones

post
https://cp.pushwoosh.com/json/1.3
/listGeoZones
/listGeoZones
For Private Offering subscriptions only.
Example
1
{
2
"request":{
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"application": "XXXXX-XXXXX" // Pushwoosh application code
5
}
6
}
Copied!

listGeoZonesClusters

post
https://cp.pushwoosh.com/json/1.3
/listGeoZoneClusters
/listGeoZoneClusters
For Private Offering subscriptions only.
Example
1
{
2
"request":{
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"application": "XXXXX-XXXXX" // Pushwoosh application code
5
}
6
}
Copied!
Last modified 1mo ago