Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Table of Contents

Register Device

Current Implementation

A device is registered to a user depending on the type of usage the user decided at login time: Normal usage or Guest usage. In the case of Normal usage, the device-user relation is always registered in the server.

Parameters

Base URL: /registerDevice

Parameters:

NameTypeMandatoryDescription
tokenStringYesSecurity Token obtained before.
userIdStringYesThe id of the logged in user.
deviceIdStringYesThe id of the device where we want userId to be registered.
shiftLengthIntNoThe duration of the user's shift in hours. If this parameter is present, a timer will be set to automatically log out the user.

API Sample

curl 'http://192.168.2.102:8080/PresentationServices/registerDevice?deviceId=596a1d880a22eb32&userId=poda&token=d2360c39-637b-41da-988d-f031db5affbb&_=1395133673256' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' --compressed

Result
 {

   "statusFact":{

      "success":true

   }

}

 

 

Fetch Devices By Workspace

 

This operation is used to  fetch all available Devices with associated Assignments for a given workspace.

Parameters

Base URL: /organizations/{organization}/workspaces/{workspace}/getDevices

Request Type: GET

Name
Type
Mandatory
Description
{organizationId} StringYesThe id of the Organization.
tokenStringYesSecurity Token obtained before.
userIdStringYesThe id of the logged in user.
{workspaceId} StringYesThe id of the Workspace. 
Note that ALL the parameters of the specified template must be present in the request.

API Sample

Happy Scenario

http://localhost:8080/PresentationServices/organizations/UNC/workspaces/test_nursery/getDevices?token=a578dbf4-1800-4a82-be24-b212ba43b278&userId=A_pod1 

 

 

Result
 
{"data":[{"workspaceId":"ne_nursery","assignment":"podg","model":"Nexus 5","status":"ACTIVE","stockNumber":4,"imei":"Cognitive-106","serialNumber":"04a4edd425230a17","macAddress":"cc:fa:00:ab:1e:bd"}],"statusFact":{"success":true}}

 

Not enough Permissions

In the case userId doesn't have 'list_devices' permission, the operation returns a 403 (Forbidden) error with the body "Not enough permissions.".

 

Fetch Devices By Facility

 

This operation is used to  fetch all available Devices with associated Assignments for a given facility.

Parameters

Base URL: /organizations/{organization}/facility/{facility}/getDevices

Request Type: GET

Name
Type
Mandatory
Description
{organizationId} StringYesThe id of the Organization.
tokenStringYesSecurity Token obtained before.
userIdStringYesThe id of the logged in user.
{facilityId} StringYesThe id of the Facility. 
Note that ALL the parameters of the specified template must be present in the request.

API Sample

Happy Scenario

http://localhost:8080/PresentationServices/organizations/UNC/facility/NorthEastern/getDevices?token=a578dbf4-1800-4a82-be24-b212ba43b278&userId=A_pod1 

 

 

Result
 
{"data":[{"workspaceId":"ne_nursery","assignment":"podg","model":"Nexus 5","status":"ACTIVE","stockNumber":4,"imei":"Cognitive-106","serialNumber":"04a4edd425230a17","macAddress":"cc:fa:00:ab:1e:bd"}],"statusFact":{"success":true}}

 

Not enough Permissions

In the case userId doesn't have 'list_devices' permission, the operation returns a 403 (Forbidden) error with the body "Not enough permissions.".

 

Fetch Devices By Organization

 

This operation is used to  fetch all available Devices with associated Assignments for a given organization.

Parameters

Base URL: /organizations/{organization}/getDevices

Request Type: GET

Name
Type
Mandatory
Description
{organizationId} StringYesThe id of the Organization.
tokenStringYesSecurity Token obtained before.
userIdStringYesThe id of the logged in user.
{workspaceId} StringYesThe id of the Workspace. 
Note that ALL the parameters of the specified template must be present in the request.

API Sample

Happy Scenario

http://localhost:8080/PresentationServices/organizations/UNC/getDevices?token=a578dbf4-1800-4a82-be24-b212ba43b278&userId=A_pod1 

 

 

Result
 
{"data":[{"workspaceId":"ne_nursery","assignment":"podg","model":"Nexus 5","status":"ACTIVE","stockNumber":4,"imei":"Cognitive-106","serialNumber":"04a4edd425230a17","macAddress":"cc:fa:00:ab:1e:bd"}],"statusFact":{"success":true}}

 

Not enough Permissions

In the case userId doesn't have 'list_devices' permission, the operation returns a 403 (Forbidden) error with the body "Not enough permissions.".

 

Delete Device

This operation is used to delete devices and associated assignments from the database for a particular device id. 

This Delete supports only soft delete that is just updates status to In-Active in Devices table.

Parameters

Base URL: /organizations/{organization}/deleteDevice

Request Type: POST

Name
Type
Mandatory
Description
organizationStringYesThe id of the organization.
roomIdStringYesThe room id to create
deviceIdStringYesThe id of the device.
tokenStringYesSecurity Token obtained before. 
    

Note : 1) ALL the parameters of the specified template must be present in the request.

 

API Sample

Happy Scenario

http://localhost:8080/PresentationServices/organizations/Another1/deleteDevice?token=a578dbf4-1800-4a82-be24-b212ba43b278&userId=A_pod1


 

Result
 
{"statusFact":{"success":true}}

 

Not enough Permissions

In the case userId doesn't have 'delete_devices' permission, the operation returns a 403 (Forbidden) error with the body "Not enough permissions.".

 

Create or Update Device 

This operation is used to add or update devices and associated device assignments.

Parameters

Base URL: /organizations/{organization}/workspaces/{workspace}/CreateOrUpdateDevices

Request Type: POST 

Name
Type
Mandatory
Description
organizationId String YesThe id of the Organization.
roomIdStringNoThe room id to create
userIdStringYesThe id of the logged in user.
tokenStringYesSecurity Token obtained before. 
workspaceStringYesThe id of the workspace. 
deviceIdStringYesThe id of the device.
macAddressStringYesThe mac address of device.
modelStringYesThe model of device.
serialNumStringYesThe serial number of device.
statusStringYesThe status of device.

 

API Sample

Happy Scenario

http://localhost:8080/PresentationServices//organizations/UNC/workspaces/test_nursery/CreateOrUpdateDevices?token=a578dbf4-1800-4a82-be24-b212ba43b278&userId=A_pod1

 

Result
 
{"statusFact":{"success":true}}

 

Not enough Permissions

In the case userId doesn't have 'modify_devices' permission, the operation returns a 403 (Forbidden) error with the body "Not enough permissions.".

  • No labels