Devices REST API

Devices REST API

Overview

The Devices REST API services allows you to get device information and  manage devices for your company.

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.


Supported Operations

Append to the Base URL: https://fieldconnect.field2base.com/v2/api
  1. GET devices/
    1. Lists of all Devices
  2. GET devices/{activation id}
    1. Get Details of a single Device
  3. GET devices/lookup/{username}
    1. Get all Activated Devices assigned to a User (by Username)
    2. Optional parameter for Activation Status: devices/lookup/{username}/{ActivationStatus}
      1. AllDevices
      2. Activated
      3. ActiveDevices
      4. Deadened
      5. InProvisioning
      6. Ready
  4. POST devices/create
    1. Create a new Device using the Body of a post request as JSON
  5. PUT devices/update/{activation id}
    1. Update a Device using the Activation ID and the Body of a post request as JSON
  6. PUT devices/changeuser/{activation id}/{username}
    1. Change the Device's Assigned User (by Username)
  7. PUT devices/reset/{activation id}
    1. Reset the history for a Device to allow re-activation
  8. DEL devices/delete/{activation id}
    1. Deletes an existing Device

Note: Be sure to add "/" at the end of the call if there is a period in the Username. 

API Samples

Get All Devices (devices)

Request: GET
  1. https://fieldconnect.field2base.com/v2/api/devices
Response: 200 OK
  1. [
  2.     {
  3.         "TabletUUID": "473a005d-145f-423c-8b43-6e66779f9ced",
  4.         "Serial": "F2BPS-3186-332",
  5.         "FriendlyName": "F2BPS332",
  6.         "CompanyID": 3186,
  7.         "PrimaryUser": "38f1b9ab-2036-4e3c-8bb9-435ef1c3e91e",
  8.         "InsertDT": "2023-09-27T08:24:49.223",
  9.         "LastUpdate": "2023-09-27T08:24:59.853",
  10.         "RowStatus": "A",
  11.         "DevicePlatform": "Android",
  12.         "DeviceType": "samsung SM-X200",
  13.         "HardwareSerial": null,
  14.         "AssetTag": null,
  15.         "DeviceMake": "samsung",
  16.         "DeviceModel": "SM-X200",
  17.         "PlatformType": "TIRAMISU 13",
  18.         "ActivationStatus": 2,
  19.         "BillingReference": null,
  20.         "LastSync": "2023-09-27T10:16:25.213",
  21.         "LastContact": "2023-09-27T10:16:25.213",
  22.         "Version": "7.2.16"
  23.     },
  24.     {
  25.         "TabletUUID": "3fee3c50-a556-4a0c-8c72-dd0a8742b427",
  26.         "Serial": "F2BPS-3186-331",
  27.         "FriendlyName": "F2BPS331",
  28.         "CompanyID": 3186,
  29.         "PrimaryUser": "38f1b9ab-2036-4e3c-8bb9-435ef1c3e91e",
  30.         "InsertDT": "2023-09-25T09:52:55.417",
  31.         "LastUpdate": "2023-09-25T10:01:37.737",
  32.         "RowStatus": "A",
  33.         "DevicePlatform": "Apple",
  34.         "DeviceType": "Apple 9.7-inch iPad (Wi-Fi)",
  35.         "HardwareSerial": "iPad",
  36.         "AssetTag": null,
  37.         "DeviceMake": "Apple",
  38.         "DeviceModel": "9.7-inch iPad (Wi-Fi)",
  39.         "PlatformType": "Apple iOS 16.6.1",
  40.         "ActivationStatus": 2,
  41.         "BillingReference": null,
  42.         "LastSync": "2023-09-25T10:17:21.6",
  43.         "LastContact": "2023-09-25T10:17:21.6",
  44.         "Version": "7.2.8"
  45.     }
  46. ]

Get Details of a Single Device

Request: GET
  1. https://fieldconnect.field2base.com/v2/api/devices/F2BPS-3186-332
Response: 200 OK
  1. {   
  2.     "TabletUUID": "423a005d-145f-423c-8b43-6e66779f9ced",
  3.     "Serial": "F2BPS-3186-332",
  4.     "FriendlyName": "F2BPS332",
  5.     "CompanyID": 3186,
  6.     "PrimaryUser": "34f1b9ab-2036-4e3c-8bb9-435ef1c3e91e",
  7.     "InsertDT": "2023-09-27T08:24:49.223",
  8.     "LastUpdate": "2023-09-27T08:24:59.853",
  9.     "RowStatus": "A",
  10.     "DevicePlatform": "Android",
  11.     "DeviceType": "samsung SM-X200",
  12.     "HardwareSerial": null,
  13.     "AssetTag": null,
  14.     "DeviceMake": "samsung",
  15.     "DeviceModel": "SM-X200",
  16.     "PlatformType": "TIRAMISU 13",
  17.     "ActivationStatus": 2,
  18.     "BillingReference": null,
  19.     "LastSync": "2023-09-27T10:16:25.213",
  20.     "LastContact": "2023-09-27T10:16:25.213",
  21.     "Version": "7.2.16"
  22. }

Look Up Device(s) by User 

Request: GET
  1. https://fieldconnect.field2base.com/v2/api/devices/lookup/first.last@email.com/

Response: 200 OK

  1.     {
  2.         "TabletUUID": "6066baf9-438f-42ac-9342-323ffa9ebec5",
  3.         "Serial": "F2BPS-3136-327",
  4.         "FriendlyName": "F2BPS327",
  5.         "CompanyID": 3136,
  6.         "PrimaryUser": "2f4a70a1-03fb-4928-8249-55381808ad0e",
  7.         "InsertDT": "2023-08-30T11:04:27.617",
  8.         "LastUpdate": "2023-08-30T12:56:58.86",
  9.         "RowStatus": "A",
  10.         "DevicePlatform": "Apple",
  11.         "DeviceType": "Apple iPad 10.2-Inch 7th Gen (Wi-Fi Only)",
  12.         "HardwareSerial": "iPad",
  13.         "AssetTag": null,
  14.         "DeviceMake": "Apple",
  15.         "DeviceModel": "iPad 10.2-Inch 7th Gen (Wi-Fi Only)",
  16.         "PlatformType": "Apple iOS 16.6",
  17.         "ActivationStatus": 2,
  18.         "BillingReference": null,
  19.         "LastSync": "2023-09-25T17:38:03.163",
  20.         "LastContact": "2023-09-25T17:38:03.16",
  21.         "Version": "7304"
  22.     },
  23.     {
  24.         "TabletUUID": "1156ddbf-4097-4b6a-820e-985f87901b52",
  25.         "Serial": "F2BPS-3136-324",
  26.         "FriendlyName": "F2BPS324",
  27.         "CompanyID": 3136,
  28.         "PrimaryUser": "2f4a70a1-03fb-4928-8249-55381808ad0e",
  29.         "InsertDT": "2023-08-23T13:26:23.293",
  30.         "LastUpdate": "2023-08-23T13:26:47.367",
  31.         "RowStatus": "A",
  32.         "DevicePlatform": "Android",
  33.         "DeviceType": "samsung SM-T500",
  34.         "HardwareSerial": null,
  35.         "AssetTag": null,
  36.         "DeviceMake": "samsung",
  37.         "DeviceModel": "SM-T500",
  38.         "PlatformType": "S 12",
  39.         "ActivationStatus": 2,
  40.         "BillingReference": null,
  41.         "LastSync": "2023-09-26T10:48:41.937",
  42.         "LastContact": "2023-09-26T10:48:41.937",
  43.         "Version": "7.2.16"
  44.     }
  45. ]

Create a Device with No Activation ID 

NOTE: Requires Provisioning by the F2B Support Team and is the recommended method.

Request: POST

  1. https://fieldconnect.field2base.com/v2/api/devices/create
Body
  1. {
  2.       "DevicePlatform": "iPad",
  3.       "DeviceMake": "Apple",
  4.       "DeviceModel": "iPad Pro 9.7",
  5.       "DeviceType": "Apple iPad Pro 9.7",
  6.       "HardwareSerial": "123",
  7.       "AssetTag": "F2B",
  8.       "PrimaryUser": "00000000-0000-0000-0000-000000000000",      //Must use User Key guid, not Username
  9.       "PlatformType": "Apple iOS",
  10.       "BillingReference": "Small Business",
  11.       "Serial": null
  12. }


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
  1. https://fieldconnect.field2base.com/v2/api/devices/create

Body

  1. {
  2.       "DevicePlatform": "Android Tablet",
  3.       "DeviceMake": "Samsung",
  4.       "DeviceModel": "Galaxy Tab S4",
  5.       "DeviceType": "Samsung Galaxy Tab S4",
  6.       "HardwareSerial": "456",
  7.       "AssetTag": "Field2Base",
  8.       "PrimaryUser": "00000000-0000-0000-0000-000000000000",      //Must use User Key guid, not Username
  9.       "PlatformType": "Android Oreo",
  10.       "BillingReference": "Enterprise",
  11.       "Serial": "123456789"
  12. }


Change the User Assigned to Device

Request: PUT
  1. https://fieldconnect.field2base.com/v2/api/devices/changeuser/{activation id}/{username}/


Update a Device

Request: PUT
  1. https://fieldconnect.field2base.com/v2/api/devices/update/{activation id}
Body
  1. {
  2.       "DevicePlatform": "iPad",
  3.       "DeviceMake": "Apple",
  4.       "DeviceModel": "iPad Air 2",
  5.       "DeviceType": "Apple iPad Air 2",
  6.       "HardwareSerial": "N/A",
  7.       "AssetTag": "Test",
  8.       "PrimaryUser": "00000000-0000-0000-0000-000000000000",
  9.       "PlatformType": "Apple iOS 13",
  10.       "BillingReference": "TEST"
  11. }


Reset a Device's Activation History 

Warning: This action is to be used with the Mobile Forms Enterprise App Build only.

Request: PUT
  1. https://fieldconnect.field2base.com/v2/api/devices/reset/{activation id}


Delete a Device 

Request: DEL
  1. https://fieldconnect.field2base.com/v2/api/devices/delete/{activation id}