{"__v":9,"_id":"55bb5f4174f10a0d002209a2","category":{"__v":17,"_id":"5540ce1c31827a0d007ab1d0","pages":["5540ce1d31827a0d007ab1d2","5540ff9dbb9e762d00f59557","554109205cf9682100d61b65","554109c35cf9682100d61b6b","55a635b6249a40190051d9a2","55bb5de0a8400c2d00873e19","55bb5f4174f10a0d002209a2","55bb607374f10a0d002209a6","55bb614f7313650d00c46e88","55bb61d8a8400c2d00873e20","55bb629874f10a0d002209aa","55bb6318a8400c2d00873e23","55bb63a07313650d00c46e8a","55d5dc84988e130d000b4110","5620b53d40e2c30d0002a848","567cfe57221af70d00fc5498","567d01fd221af70d00fc549c"],"project":"5540ce1b31827a0d007ab1cc","version":"5540ce1c31827a0d007ab1cf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-29T12:27:08.888Z","from_sync":false,"order":1,"slug":"remote-api","title":"Remote API"},"parentDoc":null,"project":"5540ce1b31827a0d007ab1cc","user":"5540cdbf5cf9682100d61a97","version":{"__v":31,"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","createdAt":"2015-04-29T12:27:08.390Z","releaseDate":"2015-04-29T12:27:08.390Z","categories":["5540ce1c31827a0d007ab1d0","5540d91bbb9e762d00f594ad","5540e5f131827a0d007ab212","5540e5febb9e762d00f594d3","5540e61331827a0d007ab213","5540e6195cf9682100d61afa","5540e62631827a0d007ab214","5540e63031827a0d007ab215","5540e63531827a0d007ab216","5540e63e5cf9682100d61afc","5540e6445cf9682100d61afd","5540e64a5cf9682100d61afe","55a4ff5b2e70c0250038050f","55acb28318eefd0d0071d504","55ae1abe8576b92300291c80","55ae453ef302af23000ac109","55af586d555b900d0036d296","55af91dac8a85321007a53c3","55b9fee204775a2f00628071","55b9ff0e04775a2f00628072","55b9ff4604775a2f00628073","55b9ff5fd72d1e1900276a38","55b9ff7f04775a2f00628074","55b9ff90eb08801900f833e5","55b9ffa5d72d1e1900276a39","55b9ffca04775a2f00628075","55b9fffdd72d1e1900276a3a","56bc2f033ee9e70d008b46af","56c2f6efbbf9ec2d00e0fe4f","57595bbb18760817001e8bbe","57d8d9793916800e003dde53"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-31T11:42:57.327Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"{\n   \"request\":{\n      \"application\":\"APPLICATION_CODE\",\n      \"push_token\":\"DEVICE_PUSH_TOKEN\",\n      \"language\":\"en\",  // optional\n      \"hwid\": \"hardware device id\",\n      \"timezone\": 3600, // offset in seconds \n      \"device_type\":1\n   }\n}","language":"json"}]},"method":"post","results":{"codes":[{"name":"","code":"{\n   \"status_code\":200,\n   \"status_message\":\"OK\",\n   \"response\": null\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"58ab1e5090d1d20f00b77739","ref":"","in":"body","required":true,"desc":"Your Pushwoosh application ID","default":"","type":"string","name":"request.application"},{"_id":"58ab1e5090d1d20f00b77738","ref":"","in":"body","required":true,"desc":"Push token for the device","default":"","type":"string","name":"request.push_token"},{"_id":"58ab1e5090d1d20f00b77737","ref":"","in":"body","required":false,"desc":"Language locale of the device. Must be a lowercase two-letter code according to [ISO-639-1 standard](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)","default":"","type":"string","name":"request.language"},{"_id":"58ab1e5090d1d20f00b77736","ref":"","in":"body","required":true,"desc":"Unique string to identify the device (IDFV/IDFA on iOS and \"Android Advertising ID\" or ANDROID_ID on Android)","default":"","type":"string","name":"request.hwid"},{"_id":"58ab1e5090d1d20f00b77735","ref":"","in":"body","required":false,"desc":"Timezone offset in seconds for the device","default":"","type":"int","name":"request.timezone"},{"_id":"58ab1e5090d1d20f00b77734","ref":"","in":"body","required":true,"desc":"Device type. See possible values below","default":"","type":"int","name":"request.device_type"}],"url":"/registerDevice"},"isReference":false,"order":3,"body":"Possible device types:\n* 1 – iOS\n* 2 – BB\n* 3 – Android\n* 5 – Windows Phone\n* 7 – OS X\n* 8 – Windows 8\n* 9 – Amazon\n* 10 – Safari \n* 11 – Chrome\n* 12 - Firefox\n\n## Status codes:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status code\",\n    \"h-1\": \"status_code\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"200\",\n    \"0-1\": \"200\",\n    \"1-0\": \"200\",\n    \"1-1\": \"210\",\n    \"2-0\": \"400\",\n    \"2-1\": \"N/A\",\n    \"3-0\": \"500\",\n    \"3-1\": \"500\",\n    \"0-2\": \"Device successfully registered\",\n    \"1-2\": \"Argument error. See status_message for more info\",\n    \"2-2\": \"Malformed request string\",\n    \"3-2\": \"Internal error\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n//see http://gomoob.github.io/php-pushwoosh/register-device.html\\nuse Gomoob\\\\Pushwoosh\\\\Model\\\\Request\\\\RegisterDeviceRequest;\\n\\n// creates request instance\\n$request = RegisterDeviceRequest::create()\\n    ->setDeviceType(DeviceType::iOS())\\n    ->setHwid('HWID')\\n    ->setLanguage('fr')\\n    ->setPushToken('xxxxxxxx')\\n    ->setTimezone(3600);\\n\\n// call '/registerDevice' Web Service\\n$response = $pushwoosh->registerDevice($request);\\n\\nif($response->isOk()) {\\n    print 'Ok, operation successful.';\\n} else {\\n    print 'Oups, the operation failed :-('; \\n    print 'Status code : ' . $response->getStatusCode();\\n    print 'Status message : ' . $response->getStatusMessage();\\n}\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]","excerpt":"Called internally from SDK. Registers device for the application.","slug":"registerdevice","type":"endpoint","title":"/registerDevice"}

post/registerDevice

Called internally from SDK. Registers device for the application.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

request.application:
required
string
Your Pushwoosh application ID
request.push_token:
required
string
Push token for the device
request.language:
string
Language locale of the device. Must be a lowercase two-letter code according to [ISO-639-1 standard](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
request.hwid:
required
string
Unique string to identify the device (IDFV/IDFA on iOS and "Android Advertising ID" or ANDROID_ID on Android)
request.timezone:
integer
Timezone offset in seconds for the device
request.device_type:
required
integer
Device type. See possible values below

Examples


Result Format


Documentation

Possible device types: * 1 – iOS * 2 – BB * 3 – Android * 5 – Windows Phone * 7 – OS X * 8 – Windows 8 * 9 – Amazon * 10 – Safari * 11 – Chrome * 12 - Firefox ## Status codes: [block:parameters] { "data": { "h-0": "HTTP Status code", "h-1": "status_code", "h-2": "Description", "0-0": "200", "0-1": "200", "1-0": "200", "1-1": "210", "2-0": "400", "2-1": "N/A", "3-0": "500", "3-1": "500", "0-2": "Device successfully registered", "1-2": "Argument error. See status_message for more info", "2-2": "Malformed request string", "3-2": "Internal error" }, "cols": 3, "rows": 4 } [/block] [block:code] { "codes": [ { "code": "<?php\n//see http://gomoob.github.io/php-pushwoosh/register-device.html\nuse Gomoob\\Pushwoosh\\Model\\Request\\RegisterDeviceRequest;\n\n// creates request instance\n$request = RegisterDeviceRequest::create()\n ->setDeviceType(DeviceType::iOS())\n ->setHwid('HWID')\n ->setLanguage('fr')\n ->setPushToken('xxxxxxxx')\n ->setTimezone(3600);\n\n// call '/registerDevice' Web Service\n$response = $pushwoosh->registerDevice($request);\n\nif($response->isOk()) {\n print 'Ok, operation successful.';\n} else {\n print 'Oups, the operation failed :-('; \n print 'Status code : ' . $response->getStatusCode();\n print 'Status message : ' . $response->getStatusMessage();\n}", "language": "php" } ] } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}