Geozones API
getNearestZone
Anchor link toSDK 에서 내부적으로 호출됩니다. 가장 가까운 Geozone 의 파라미터와 거리를 검색합니다. 또한 지리적 위치 기반 푸시 알림(geo push notifications)을 위해 디바이스 위치를 기록합니다.
POST https://api.pushwoosh.com/json/1.3/getNearestZoneRequest body parameters
Anchor link to| Parameter | Type | Required | Description |
|---|---|---|---|
| application | string | Yes | Pushwoosh 애플리케이션 코드 |
| hwid | string | Yes | /registerDevice 요청에서 사용된 하드웨어 디바이스 ID. |
| lat | string | Yes | 디바이스의 위도. |
| lng | string | Yes | 디바이스의 경도. |
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/addGeoZoneRequest body parameters
Anchor link to| Parameter | Type | Required | Description |
|---|---|---|---|
| auth | string | Yes | Pushwoosh 제어판(Control Panel)의 API 액세스 토큰. |
| application | string | Yes | Pushwoosh 애플리케이션 코드 |
| geozones | array | Yes | JSON 배열 형태의 Geozone 파라미터. |
| geozones.name | string | Yes | Geozone 이름. |
| geozones.lat | string | Yes | Geozone 위도. |
| geozones.lng | string | Yes | Geozone 경도. |
| geozones.cooldown | integer | Yes | 알림 전송 후 침묵 기간(초 단위). |
| geozones.range | integer | Yes | Geozone 범위(미터 단위, 50에서 1000 사이). |
| geozones.content | string or object | Required if presetCode is empty. | Geozone 메시지 내용. |
| geozones.presetCode | string | Required if content is empty. | content 대신 사용할 푸시 프리셋. |
| geozones.cluster | string | No | Geozone 에서 클러스터를 해제하려면 null 을 지정합니다. |
| geozones.campaign | string | No | Geozone 에서 캠페인을 해제하려면 null 을 지정합니다. 생략하면 캠페인 값은 변경되지 않습니다. 참고: 프리셋의 캠페인보다 우선 순위가 높습니다. |
| geozones.timetable | object | No | 타임테이블 간격을 설정합니다. |
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 toGeozone 속성을 업데이트합니다.
POST https://api.pushwoosh.com/json/1.3/updateGeoZoneRequest body parameters
Anchor link to| Parameter | Type | Required | Description |
|---|---|---|---|
| auth | string | Yes | Pushwoosh 제어판(Control Panel)의 API 액세스 토큰. |
| geoZoneId | string | Yes | /addGeoZone 요청의 Geozone ID. |
| name | string | No | 새로운 Geozone 이름. |
| cooldown | integer | No | 업데이트할 쿨다운(초 단위). |
| status | integer | No | 0 - 비활성화됨, 1 - 활성화됨. |
| content | string | No | Geozone 푸시 알림의 내용입니다. presetCode 와 함께 사용할 수 없습니다. |
| cluster | string | No | 새로운 클러스터 이름입니다. Geozone 에서 클러스터를 해제하려면 null 을 지정합니다. |
| campaign | string | No | 새로운 캠페인 ID입니다. Geozone 에서 캠페인을 해제하려면 null 을 지정합니다. 생략하면 캠페인 값은 변경되지 않습니다. 프리셋의 캠페인보다 우선 순위가 높습니다. |
| lat | number | No | Geozone 위도. |
| lng | number | No | Geozone 경도. |
| range | integer | No | 미터 단위의 새로운 범위. |
| timetable | object | No | 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앱에서 Geozone 을 제거합니다.
POST https://api.pushwoosh.com/json/1.3/deleteGeoZoneRequest body parameters
Anchor link to| Parameter | Type | Required | Description |
|---|---|---|---|
| auth | string | Yes | Pushwoosh 제어판(Control Panel)의 API 액세스 토큰. |
| application | string | Yes | Pushwoosh 애플리케이션 코드 |
| geozones | string | Yes | 제거할 Geozone 의 ID 배열 또는 단일 ID. |
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 클러스터를 추가합니다.
POST https://api.pushwoosh.com/json/1.3/addGeoZoneClusterRequest body parameters
Anchor link to| Parameter | Type | Required | Description |
|---|---|---|---|
| auth | string | Yes | Pushwoosh 제어판(Control Panel)의 API 액세스 토큰. |
| application | string | Yes | Pushwoosh 애플리케이션 코드 |
| name | string | Yes | 클러스터 이름. |
| cooldown | integer | Yes | 단일 사용자가 Geozone 클러스터로부터 동일한 메시지를 수신하기 전의 지연 시간(초 단위). |
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 클러스터를 제거합니다.
POST https://api.pushwoosh.com/json/1.3/deleteGeoZoneClusterRequest body parameters
Anchor link to| Parameter | Type | Required | Description |
|---|---|---|---|
| auth | string | Yes | Pushwoosh 제어판(Control Panel)의 API 액세스 토큰. |
| application | string | Yes | Pushwoosh 애플리케이션 코드 |
| geoZoneCluster | string | Yes | 제거할 Geozone 클러스터의 ID. |
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앱의 Geozone 목록을 검색합니다.
POST https://api.pushwoosh.com/json/1.3/listGeoZonesRequest body parameters
Anchor link to| Parameter | Type | Required | Description |
|---|---|---|---|
| auth | string | Yes | Pushwoosh 제어판(Control Panel)의 API 액세스 토큰. |
| application | string | Yes | Pushwoosh 애플리케이션 코드 |
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 클러스터 목록을 검색합니다.
POST https://api.pushwoosh.com/json/1.3/listGeoZoneClustersRequest body parameters
Anchor link to| Parameter | Type | Required | Description |
|---|---|---|---|
| auth | string | Yes | Pushwoosh 제어판(Control Panel)의 API 액세스 토큰. |
| application | string | Yes | Pushwoosh 애플리케이션 코드 |
Request example
Anchor link to{ "request": { "auth": "yxoPUlwqm............pIyEX4H", // required, API access token from Pushwoosh Control "application": "XXXXX-XXXXX" // required, Pushwoosh application code }}