{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/v1/devices","auth":"required","examples":{"codes":[{"language":"json","code":"{\n    \"device_id\": \"639e21fd64cfdde6\",\n    \"platform\": \"android\",\n    \"sdk_type\": \"android_push\",\n    \"android_id\": \"639e21fd64cfdde6\",\n    \"push_token\": \"fB7XpWH4nso:APA91bFQ7qjoGEoXlMO3Gvvp-Tuas9lck1flTw3wa293AodUv-T59RyRByzMFdpirpMCmOWVSU_jJ_ftMREWCmhb3G4LXp6pFdhx1div2gFxDs-yvY40fhiNy7pgr4w19xQ0tN3hiTff\",\n    \"push_disabled\": true,\n    \"ad_id\": \"d3d22a03-3309-1234-9f57-7f34761acd42\",\n    \"imei\": \"358239059791234\",\n    \"sdk_version\": \"1.6.3\",\n    \"app_version\": \"1.0\",\n    \"os_version\": \"23\",\n    \"store_identifier\": \"mobi.pushapps.demo\",\n    \"timezone\": \"GMT+02:00\",\n    \"country\": \"US\",\n    \"utc_offset\": \"180\",\n    \"language\": \"en\",\n    \"device_description\": \"LGE hammerhead\"\n}"}]},"method":"post","params":[{"name":"device_id","type":"string","default":"","desc":"unique identifier for the device within your app, generated by you or from our SDK","required":true,"in":"body","ref":"","_id":"5771a459c755ca0e00617d61"},{"name":"platform","type":"string","default":"","desc":"the device's platform, must be one of the followings: ```android``` , ```ios```","required":true,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d588"},{"name":"sdk_type","type":"string","default":"","desc":"the type of PushApps SDK, must be one of the following: ```android_push``` , ```ios_push```","required":true,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d587"},{"name":"android_id","type":"string","default":"","desc":"the android id for Android devices, can be equal to the ```device_id```","required":false,"in":"body","ref":"","_id":"5771aace45c7080e00729290"},{"name":"push_token","type":"string","default":"","desc":"the identifier received from Google or Apple for sending push notifications","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d593"},{"name":"push_disabled","type":"boolean","default":"false","desc":"set to ```true``` if the user has disabled the receiving of push notifications","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d592"},{"name":"ad_id","type":"string","default":"","desc":"advertizer identifier such as the [Android AdvertisingId](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient#inherited-method-summary) or","required":false,"in":"body","ref":"","_id":"5771a459c755ca0e00617d60"},{"name":"imei","type":"string","default":"","desc":"device IMEI","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d591"},{"name":"sdk_version","type":"string","default":"","desc":"version of PushApps SDK","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d590"},{"name":"app_version","type":"string","default":"","desc":"version of the application","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d58f"},{"name":"os_version","type":"string","default":"","desc":"version of the device's operating system, such as the API level for Android or ```9.2``` for iOS","required":false,"in":"body","ref":"","_id":"5771a93101e8110e0041ad04"},{"name":"store_identifier","type":"string","default":"","desc":"the package defined in the manifest for Android or the bundle id for iOS","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d58e"},{"name":"timezone","type":"string","default":"","desc":"the current device timezone, relative to the UTC, for example: ```GMT+02:00```","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d58d"},{"name":"country","type":"string","default":"","desc":"country code","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d58c"},{"name":"utc_offset","type":"string","default":"","desc":"the offset in minutes from UTC","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d58b"},{"name":"language","type":"string","default":"","desc":"the default language code of the device","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d58a"},{"name":"device_description","type":"string","default":"","desc":"a description of brand and model of the device, such as ```samsung GT-I9100T``` ,  ```iPhone5```","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d589"},{"name":"ios_env","type":"string","default":"","desc":"if ```platform``` is ```ios```, specify the push provisioning profile. If not empt must be one of the following: ```production```, ```sandbox```","required":false,"in":"body","ref":"","_id":"5771a5da6b1f9a0e00e2d586"}],"results":{"codes":[{"name":"","code":"{\n  \"success\" : true\n}","language":"json","status":200},{"name":"request body not valid","code":"{\n  \"errors\" : [\"The request body is not a valid JSON or doesn't match the expected structure\"]\n}","language":"json","status":400}]},"settings":""},"next":{"description":"","pages":[]},"title":"/devices - register or update a device","type":"endpoint","slug":"devices-register-or-update-a-device","excerpt":"Registers a new device to PushApps. If a device with the same ```device_id``` already exists, this updates the device's information","body":"","updates":[],"order":7,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5771a459c755ca0e00617d5f","user":"56cecbb2e50c9c1b008303eb","__v":4,"editedParams2":true,"githubsync":"","createdAt":"2016-06-27T22:10:33.859Z","parentDoc":null,"version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["56cecbdc44c5700b0095c03e","56d1d2c05ad7ad0b00b7e809","56d1d2fa5ad7ad0b00b7e80a","56d369331660770b00081159","56d3693d1660770b0008115a","56e5361e7990160e002e3fbc","56e5362775eb791700a9c4d2","57a9030947f2f419009188d4","57b4705ee9e4c60e00f6f4c3","5828f5b04774ab0f005179a2"],"_id":"56cecbdc44c5700b0095c03d","project":"56cecbdb44c5700b0095c03a","__v":10,"createdAt":"2016-02-25T09:39:40.121Z","releaseDate":"2016-02-25T09:39:40.121Z"},"category":{"sync":{"isSync":false,"url":""},"pages":["56e590ae69d7890e000ec286","56e590fa3c29b117008dae50","56e6f058d66be417007d2364","56e7eaa8f0fafd36008faf59","56ea8db9ed3ad20e004e5a02","56ea8f3e0252fb17008804ac"],"title":"Server API","slug":"remote-api","order":7,"from_sync":false,"reference":false,"_id":"56e5362775eb791700a9c4d2","__v":6,"createdAt":"2016-03-13T09:43:03.596Z","project":"56cecbdb44c5700b0095c03a","version":"56cecbdc44c5700b0095c03d"},"project":"56cecbdb44c5700b0095c03a","editedParams":true}

post/devices - register or update a device

Registers a new device to PushApps. If a device with the same ```device_id``` already exists, this updates the device's information

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

device_id:
required
string
unique identifier for the device within your app, generated by you or from our SDK
platform:
required
string
the device's platform, must be one of the followings: ```android``` , ```ios```
sdk_type:
required
string
the type of PushApps SDK, must be one of the following: ```android_push``` , ```ios_push```
android_id:
string
the android id for Android devices, can be equal to the ```device_id```
push_token:
string
the identifier received from Google or Apple for sending push notifications
push_disabled:
booleanfalse
set to ```true``` if the user has disabled the receiving of push notifications
ad_id:
string
advertizer identifier such as the [Android AdvertisingId](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient#inherited-method-summary) or
imei:
string
device IMEI
sdk_version:
string
version of PushApps SDK
app_version:
string
version of the application
os_version:
string
version of the device's operating system, such as the API level for Android or ```9.2``` for iOS
store_identifier:
string
the package defined in the manifest for Android or the bundle id for iOS
timezone:
string
the current device timezone, relative to the UTC, for example: ```GMT+02:00```
country:
string
country code
utc_offset:
string
the offset in minutes from UTC
language:
string
the default language code of the device
device_description:
string
a description of brand and model of the device, such as ```samsung GT-I9100T``` , ```iPhone5```
ios_env:
string
if ```platform``` is ```ios```, specify the push provisioning profile. If not empt must be one of the following: ```production```, ```sandbox```

Examples


Result Format