GET mobileDevice {#get}
Get data on a specific mobile device.
Members can get data of their own mobile device.
Parameters
Parameters | Detail
----------------------------------- | -----------------------------------
format
optional |Specifies returned data format
Accepted value: "json", "xml"
Resource Information
Authentication
: See Access Permission
HTTP Methods
: GET
Request URL Format
: https://{api_domain}/api3/mobileDevice/{id}
Access Permission {#GetPermission}
Access to data varies base on system setting and requester roles. See Authentication for details on authentication.
Private WebStorms: Requester must authenticate to get data.
Public WebStorms: No authentication required to get data.
Errors
- Invalid device token or invalid object id
Example Request
- Method: GET
- Header: Authorization=Bearer 85f7b2462570acdde9a458ba6495b8763dcd040c
URL:
https://example.brightidea.com/api3/mobileDevice/11111111-1111-1111-1111-111111111111
~~~ { "mobileDevice": { "deviceid": "222EDD52-9FCA-4FAF-8263-88BC787E5A63" "devicetoken": "11111111-1111-1111-1111-111101010101", "badge_count":0, }, } ~~~
LIST mobileDevice {#list}
Get data on a list of mobile devices.
On retrieving large set of data, requester should use pagination parameters such as page
and page_size
to manage multiple requests.
Parameters
Parameters | Detail
----------------------------------- | -----------------------------------
app_id
optional |Filter return by app ID
Sample value: "bi.mobile.app.com"
device_token
optional |Filter return by ID of device token of mobile device
Sample value: "11111111-1111-1111-1111-111111111111"
page_size
optional |Specifies number of records returns per page. Default: 20. Minimum: 1. Maximum: 100
Sample value: 50
page
optional |Specifies which page of records to return. Default: 1. Minimum: 1. Maximum: {page_count}
Sample value: 5
partial_match
optional |Enables partial word search.
Sample value: "1: Enable, 0: Disable".
format
optional |Specifies returned data format
Accepted value: "json", "xml"
Resource Information
Authentication
: See Access Permission
HTTP Methods
: GET
Request URL Format
: https://{api_domain}/api3/mobileDevice
Access Permission {#listPermission}
Access to data varies base on system setting and requester roles. See Authentication for details on authentication.
Private WebStorms: Requester must authenticate to get data.
Public WebStorms: No authentication required to get data.
Errors
- Invalid device token or missing required parameter
Example Request
- Method: GET
- Header: Authorization=Bearer 85f7b2462570acdde9a458ba6495b8763dcd040c
URL:
https://example.brightidea.com/api3/mobileDevice
~~~ { "mobileDevicelist": [ { "deviceid": "222EDD52-9FCA-4FAF-8263-88BC787E5A63" "devicetoken": "11111111-1111-1111-1111-111101010101", "badgecount":0, }, { "deviceid": "2E1543C0-1D07-47DD-889E-C1460B89E2A7" "devicetoken": "11111111-1111-1111-1111-1111111000", "badge_count":0, },
], "stats": { "total": "2", "page_count": 1, "current_page": 1 }
} ~~~
CREATE mobileDevice {#create}
Register a mobile device.
Requester must have access to the Campaign in order to register mobile device in it.
Parameters
Parameters | Detail
----------------------------------- | -----------------------------------
app_id
required |This is the app ID of the mobile device
Sample value: "bi.mobile.app.com"
device_token
required |This is the device token of the mobile device
Sample Value: "11111111-1111-1111-1111-111111111111"
format
optional |Specifies returned data format
Accepted value: "json", "xml"
Resource Information
Authentication
: Required. See Authentication for details on authentication.
HTTP Methods
: POST
Request URL Format
: https://{api_domain}/api3/mobileDevice
Access Permission
Requester must have access to the Campaign in order to register their mobile device in it. See Authentication for details on authentication.
Requester can only register and modify his own mobile device.
Errors
Invalid device token
Missing required parameter
Example Request
- Method: POST
- Header: Authorization=Bearer 85f7b2462570acdde9a458ba6495b8763dcd040c
- URL:
https://example.brightidea.com/api3/mobileDevice
Form data:
- app_id=bi.mobile.app.com
- device_token=11111111-1111-1111-1111-111101010101
~~~ { "mobileDevice": { "deviceid": "222EDD52-9FCA-4FAF-8263-88BC787E5A63" "devicetoken": "11111111-1111-1111-1111-111101010101", "badge_count":0, }, } ~~~
UPDATE mobileDevice {#update}
Update a mobileDevice object.
Requester must have access to the Campaign in order to update a mobile device.
Parameters
Parameters | Detail
----------------------------------- | -----------------------------------
reset_badge
optional |This is the flag to reset badge
Accepted Values: "0 for false", "1 for true"
Resource Information
Authentication
: Required. See Authentication for details on authentication.
HTTP Methods
: PUT
Request URL Format
: https://{api_domain}/api3/mobileDevice/11111111-1111-1111-1111-111111111111
Access Permission
Requester must have access to the Campaign in order to update a mobile device. See Authentication for details on authentication.
Requester can only update his own mobile device.
Errors
Invalid device token
Invalid object id recieved
Example Request
- Method: PUT
- Header: Authorization=Bearer 85f7b2462570acdde9a458ba6495b8763dcd040c
- URL:
https://example.brightidea.com/api3/mobileDevice/11111111-1111-1111-1111-111111111111
Form data:
- reset_badge=1
~~~ { "mobileDevice": { "deviceid": "222EDD52-9FCA-4FAF-8263-88BC787E5A63" "devicetoken": "11111111-1111-1111-1111-111101010101", "badge_count":0, }, } ~~~
DELETE mobileDevice {#delete}
Delete a mobileDevice object.
Requester can delete his own mobileDevice.
Parameters
Parameters | Detail
----------------------------------------| -----------------------------------
format
optional |Specifies returned data format
Accepted value: "json", "xml"
Resource Information
Authentication
: Required. See Authentication for details on authentication.HTTP Methods
: DELETERequest URL Format
: https://{api_domain}/api3/mobileDevice
Access Permission
Requester can delete his own mobile device.
Errors
- Invalid device token
Example Request
- Method: DELETE
- Header: Authorization=Bearer 85f7b2462570acdde9a458ba6495b8763dcd040c
URL:
https://example.brightidea.com/api3/mobileDevice/11111111-1111-1111-1111-111111111111
~~~ { "message": "success", "code": 200 } ~~~
FAQ {#faq}
Question: LIST mobileDevice only return 100 objects maximum per request. How do I retrieve more results.
Answer: LIST mobileDevice response is automatically paginated. You can specify which page of the result a request should return. For example, if you requested for 100 mobile devices in the initial request, pass "page_size=100&page=2" to get the next 100. page_count
is returned with every LIST request so your application can figure out when it hits the end.