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

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