انتقل إلى المحتوى

Geozones API

getNearestZone

Anchor link to

يتم استدعاؤه داخلياً من SDK. يسترجع معلمات أقرب Geozone والمسافة إليها. يسجل أيضاً موقع الجهاز لإشعارات الدفع الجغرافية (geo push notifications).

POST https://api.pushwoosh.com/json/1.3/getNearestZone

Request body parameters

Anchor link to
ParameterTypeRequiredDescription
applicationstringنعمPushwoosh application code
hwidstringنعمHardware device ID المستخدم في طلب /registerDevice.
latstringنعمخط عرض الجهاز (Latitude).
lngstringنعمخط طول الجهاز (Longitude).

Request example

Anchor link to
{
"request": {
"application": "APPLICATION_CODE",
"hwid": "HWID",
"lat": 10.12345,
"lng": 28.12345
}
}

PHP example

Anchor link to
// See http://gomoob.github.io/php-pushwoosh/get-nearest-zone.html
use Gomoob\Pushwoosh\Model\Request\GetNearestZoneRequest;
// Creates the request instance
$request = GetNearestZoneRequest::create()
->setHwid('HWID')
->setLat(10.12345)
->setLng(28.12345);
// Call the '/getNearestZone' Web Service
$response = $pushwoosh->getNearestZone($request);
if ($response->isOk()) {
print 'Zone name : ' . $response->getResponse()->getName();
print 'Latitude : ' . $response->getResponse()->getLat();
print 'Longitude : ' . $response->getResponse()->getLng();
print 'Range : ' . $response->getResponse()->getRange();
print 'Distance : ' . $response->getResponse()->getDistance();
} else {
print 'Oops, the operation failed :-(';
print 'Status code : ' . $response->getStatusCode();
print 'Status message : ' . $response->getStatusMessage();
}

addGeoZone

Anchor link to

يضيف Geozone إلى تطبيق محدد.

POST https://api.pushwoosh.com/json/1.3/addGeoZone

Request body parameters

Anchor link to
ParameterTypeRequiredDescription
authstringنعمAPI access token من Pushwoosh Control Panel.
applicationstringنعمPushwoosh application code
geozonesarrayنعممعلمات Geozone كمصفوفة JSON.
geozones.namestringنعماسم Geozone.
geozones.latstringنعمخط عرض Geozone.
geozones.lngstringنعمخط طول Geozone.
geozones.cooldownintegerنعمفترة الصمت بعد إرسال إشعار (بالثواني).
geozones.rangeintegerنعمنطاق Geozone (بالأمتار، من 50 إلى 1000).
geozones.contentstring or objectمطلوب إذا كان presetCode فارغاً.محتوى رسالة Geozone.
geozones.presetCodestringمطلوب إذا كان content فارغاً.Push preset للاستخدام بدلاً من content.
geozones.clusterstringلاحدد null لإلغاء ربط Cluster بـ Geozone.
geozones.campaignstringلاحدد null لإلغاء ربط Campaign بـ Geozone. إذا تم حذفه، تظل قيمة Campaign دون تغيير. ملاحظة: له أولوية أعلى من Campaign في Preset.
geozones.timetableobjectلايحدد فترات الجدول الزمني (timetable intervals).

Request example

Anchor link to
{
"request": {
"auth": "yxoPUlwqm............pIyEX4H", // API access token from Pushwoosh Control Panel
"application": "XXXXX-XXXXX", // Pushwoosh application code
"geozones": [{
"name": "Statue of George", // required. Geozone name.
"lat": "40.70087797", // required. Geozone latitude.
"lng": "-73.931851387", // required. Geozone longitude.
"cooldown": 60, // in seconds, required. Silent period after sending a notification
"range": 50, // in meters, from 50 to 1000, required. Range of the geozone.
"content": "Lorem ipsum dolor sit amet,
consectetur adipiscing elit.", // or object
"presetCode": "AAAAA-BBBBB", // optional. Push preset could be used instead of content
"cluster": "GEOZONE CLUSTER CODE", // optional. Cluster's cooldown period will be applied
"campaign": "CAMPAIGN_CODE", // optional. Specify null to unbind Campaign from Geozone
"timetable": { // optional
"timezone": 1234, // in seconds
"Mon": [ // available days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Push sending
{
"start": "04:11",
"stop": "12:00"
}
],
"Sun": [
{ // one or two intervals
"start": "01:11",
"stop": "17:00"
},
{
"start": "18:01",
"stop": "23:59"
}
]
}
}]
}
}

updateGeoZone

Anchor link to

يحدث خصائص Geozone.

POST https://api.pushwoosh.com/json/1.3/updateGeoZone

Request body parameters

Anchor link to
ParameterTypeRequiredDescription
authstringنعمAPI access token من Pushwoosh Control Panel.
geoZoneIdstringنعمGeozone ID من طلب /addGeoZone.
namestringلااسم Geozone الجديد.
cooldownintegerلافترة التهدئة (Cooldown) للتحديث، بالثواني.
statusintegerلا0 - غير مفعل، 1 - مفعل.
contentstringلامحتوى إشعار الدفع لـ Geozone. لا يمكن استخدامه مع presetCode.
clusterstringلااسم Cluster الجديد. حدد null لإلغاء ربط Cluster بـ Geozone.
campaignstringلامعرف Campaign الجديد. حدد null لإلغاء ربط Campaign بـ Geozone. إذا تم حذفه، لن تتغير قيمة Campaign. له أولوية أعلى من Campaign من Preset.
latnumberلاخط عرض Geozone.
lngnumberلاخط طول Geozone.
rangeintegerلاالنطاق الجديد بالأمتار.
timetableobjectلاالجدول الزمني لـ Geozone. انظر المزيد من المعلومات أدناه.

Request example

Anchor link to
{
"request": {
"auth": "yxoPUlwqm............pIyEX4H", // required, API access token from Pushwoosh Control
"geoZoneId": 100016750, // required, from /addGeoZone method
"name": "new geozone name", // optional
"cooldown": 222, // in seconds, optional
"status": 0, // optional, 0 - deactivated, 1 - activated
"presetCode": "BBBBB-AAAAA", // optional, cannot be used along with "content"
"content": "new geozone content", // optional, cannot be used along with "presetCode"
"cluster": "GEOZONE CLUSTER CODE", // optional. Specify null to unbind cluster from Geozone
"campaign": "CAMPAIGN_CODE", // optional. Specify null to unbind Campaign from Geozone
"lat": 10.56, // optional, geozone latitude
"lng": 12.523, // optional, geozone longitude
"range": 500, // optional, geozone range
"timetable": { // optional
"timezone": 1234, // in seconds
"Mon": [ // available days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Push sending
{
"start": "04:11",
"stop": "12:00"
}
],
"Sun": [
{ // one or two intervals
"start": "01:11",
"stop": "17:00"
},
{
"start": "18:01",
"stop": "23:59"
}
]
}
}
}

deleteGeoZone

Anchor link to

يزيل Geozones من التطبيق.

POST https://api.pushwoosh.com/json/1.3/deleteGeoZone

Request body parameters

Anchor link to
ParameterTypeRequiredDescription
authstringنعمAPI access token من Pushwoosh Control Panel.
applicationstringنعمPushwoosh application code
geozonesstringنعممصفوفة من المعرفات أو معرف واحد لـ Geozone المراد إزالته.

Request example

Anchor link to
{
"request": {
"auth": "yxoPUlwqm............pIyEX4H", // required, API access token from Pushwoosh Control
"application": "XXXXX-XXXXX", // required, Pushwoosh application code
"geozones": [550, 526] // required, geozones IDs
}
}

addGeoZoneCluster

Anchor link to

يضيف Geozone Cluster إلى التطبيق.

POST https://api.pushwoosh.com/json/1.3/addGeoZoneCluster

Request body parameters

Anchor link to
ParameterTypeRequiredDescription
authstringنعمAPI access token من Pushwoosh Control Panel.
applicationstringنعمPushwoosh application code
namestringنعماسم Cluster.
cooldownintegerنعمتأخير قبل أن يتمكن مستخدم واحد من تلقي نفس الرسالة من Geozone Cluster، بالثواني.

Request example

Anchor link to
{
"request": {
"auth": "yxoPUlwqm............pIyEX4H", // required, API access token from Pushwoosh Control
"application": "XXXXX-XXXXX", // required, Pushwoosh application code
"name": "Raccoon city", // required, cluster name
"cooldown": 3210 // required, in seconds
}
}

deleteGeoZoneCluster

Anchor link to

يزيل Geozone Cluster من التطبيق.

POST https://api.pushwoosh.com/json/1.3/deleteGeoZoneCluster

Request body parameters

Anchor link to
ParameterTypeRequiredDescription
authstringنعمAPI access token من Pushwoosh Control Panel.
applicationstringنعمPushwoosh application code
geoZoneClusterstringنعممعرف Geozone cluster المراد إزالته.

Request example

Anchor link to
{
"request": {
"auth": "yxoPUlwqm............pIyEX4H", // required, API access token from Pushwoosh Control
"application": "XXXXX-XXXXX", // required, Pushwoosh application code
"geoZoneCluster": "EA1CE-69405" // required, cluster ID obtained from the /addGeoZoneCluster request
}
}

listGeoZones

Anchor link to

يسترجع قائمة بـ Geozones للتطبيق.

POST https://api.pushwoosh.com/json/1.3/listGeoZones

Request body parameters

Anchor link to
ParameterTypeRequiredDescription
authstringنعمAPI access token من Pushwoosh Control Panel.
applicationstringنعمPushwoosh application code

Request example

Anchor link to
{
"request": {
"auth": "yxoPUlwqm............pIyEX4H", // required, API access token from Pushwoosh Control
"application": "XXXXX-XXXXX" // required, Pushwoosh application code
}
}

listGeoZoneClusters

Anchor link to

يسترجع قائمة بـ Geozone clusters للتطبيق.

POST https://api.pushwoosh.com/json/1.3/listGeoZoneClusters

Request body parameters

Anchor link to
ParameterTypeRequiredDescription
authstringنعمAPI access token من Pushwoosh Control Panel.
applicationstringنعمPushwoosh application code

Request example

Anchor link to
{
"request": {
"auth": "yxoPUlwqm............pIyEX4H", // required, API access token from Pushwoosh Control
"application": "XXXXX-XXXXX" // required, Pushwoosh application code
}
}