Overview
The Devices REST API services allow Customers the ability to get Device information and directly manage Devices (create, edit, delete, assign, reset) in the Field2Base system.
Base URL
https://fieldconnect.field2base.com/v2/api
Header (Required)
Authorization: Basic {CompanyID}:{Username}:{Password}:{API Sync Key}
Content-Type: application/json
Note: Authorization Header above is the same as all other Mobile Forms REST API calls.
Note: API Developers can use OAuth 2.0 Authentication instead of the Basic Authentication. The OAuth 2.0 Authentication uses the Client Credentials Grant Type and requires the Company have a Client ID and a Client Secret generated in the Mobile Forms Portal to make web service calls to the REST API Endpoints. You can contact the Professional Services team at f2bps@field2base.com to implement OAuth 2.0 Authentication.
F2B API Prerequisites
To use the Devices REST API, you need the following:
- An API Sync Key for the Company
- A User Account with the ability to submit to the API (Mobile Forms Administrator role)
Supported Operations
The following operations are supported by the REST web service.
Devices
Endpoint
|
Method
|
Description
|
devices/
|
GET
|
Lists of all Devices
|
devices/{activation id}
|
GET
|
Get Details of a single Device
|
devices/lookup/{username}
|
GET
|
Look up all Devices assigned to a User (by Username)
|
devices/create
|
POST
|
Create a new Device using the Body of a post request as JSON
|
devices/update/{activation id}
|
PUT
|
Updates a Device using the Activation ID and the Body of a post request as JSON
|
devices/changeuser/{activation id}/{username}
|
PUT
|
Changes the Device's Assigned User (by Username)
|
devices/reset/{activation id}
|
PUT
|
Resets the history for a Device to allow re-activation
|
devices/delete/{activation id}
|
DEL
|
Deletes an existing Device
|
Note: Be sure to add "/" at the end of the call if there is a period in the Username.
JSON Definition
- {
- "TabletUUID": {guid},
- "Serial": {string},
- "FriendlyName": {string},
- "CompanyID": {int},
- "PrimaryUser": {guid},
- "InsertDT": {string},
- "LastUpdate": {string},
- "RowStatus": {string},
- "DevicePlatform": {string},
- "DeviceType": {string},
- "HardwareSerial": {guid},
- "AssetTag": {string},
- "DeviceMake": {string},
- "DeviceModel": {string},
- "PlatformType": {string},
- "ActivationStatus": {int},
- "BillingReference": {string},
- "LastSync": {string},
- "LastContact": {string},
- "Version": {string}
- }
API Samples
Get All Devices (devices)
Request: GET
Get Details of a Single Device
Request: GET
Look Up Device(s) by User
Create a Device with No Activation ID
NOTE: Requires Provisioning by the F2B Support Team and is the recommended method.
Request: POST
- https://fieldconnect.field2base.com/v2/api/devices/create
Body
- {
- "DevicePlatform": "iPad",
- "DeviceMake": "Apple",
- "DeviceModel": "iPad Pro 9.7",
- "DeviceType": "Apple iPad Pro 9.7",
- "HardwareSerial": "123",
- "AssetTag": "F2B",
- "PrimaryUser": "00000000-0000-0000-0000-000000000000", //Must use User Key guid, not Username
- "PlatformType": "Apple iOS",
- "BillingReference": "Small Business",
- "Serial": null
- }
Response: 200 OK
Create a Device with an Activation ID
NOTE: Requires a system-wide unique Activation ID to be used in the Serial value in the JSON Body otherwise the request will fail. For this reason, the previous method is recommended.
Request: POST
Body
- {
- "DevicePlatform": "Android Tablet",
- "DeviceMake": "Samsung",
- "DeviceModel": "Galaxy Tab S4",
- "DeviceType": "Samsung Galaxy Tab S4",
- "HardwareSerial": "456",
- "AssetTag": "Field2Base",
- "PrimaryUser": "00000000-0000-0000-0000-000000000000", //Must use User Key guid, not Username
- "PlatformType": "Android Oreo",
- "BillingReference": "Enterprise",
- "Serial": "123456789"
- }
Response: 200 OK
Change the User Assigned to Device
Request: PUT
Response: 200 OK
Update a Device
Request: PUT
- https://fieldconnect.field2base.com/v2/api/devices/update/{activation id}
Body
- {
- "DevicePlatform": "iPad",
- "DeviceMake": "Apple",
- "DeviceModel": "iPad Air 2",
- "DeviceType": "Apple iPad Air 2",
- "HardwareSerial": "N/A",
- "AssetTag": "Test",
- "PrimaryUser": "00000000-0000-0000-0000-000000000000",
- "PlatformType": "Apple iOS 13",
- "BillingReference": "TEST"
- }
Response: 200 OK
Reset a Device's Activation History
This action is to be used with the Mobile Forms Enterprise App Build only.
Request: PUT
Response: 200 OK
Delete a Device
Request: DEL
Response: 200 OK