PUT_engage_sites_{siteReference}_readerdefaults

Update Reader Default Settings by Site

PUT /engage/sites/{siteReference}/readerdefaults

This API updates reader default settings in the requested site. The API accepts the settings to be updated as data parameters.

Authentication

Basic Authentication, must be a partner managed account type.

URI Parameters

siteReference = string (required)

Reference ID of the site

Data Parameters

Timestamp = string (required)

The most recent value on record. If the supplied value is out of date, the request will not be successful.

Timestamp is used to prevent concurrency issue.

Timestamp can be obtained from GET site reader defaults API.

Settings = array

Reader’s key settings

Sample PUT request:

{"timestamp":"636540315746752940","settings":[{"key":"proxConfHID","value":"0"},{"key":"proxConfGE4001","value":"1]}

Response

HTTP status code 200

  • OK – FriendlyName successfully changed

Content:

Sample PUT response:

{"Timestamp":"636543502367485696","Settings":[{"Key":"proxConfHID","Value":"0"},{"Key":"proxConfGE4001","Value":"1"},
{"Key":"proxConfGE4002","Value":"1"},{"Key":"proxConfAWID","Value":"1"},{"Key":"proxGECASI","Value":"1"},
{"Key":"uid14443","Value":"0"},{"Key":"mi14443","Value":"1"},{"Key":"noc14443","Value":"1"},{"Key":"uid15693","Value":"1"},
{"Key":"iClsUID40b","Value":"0"},{"Key":"mip14443","Value":"1"},{"Key":"rdrSense","Value":"norm"}]}

HTTP status code 400

Scenario: Invalid token or Unauthorized user.

Code: 401 Unauthorized
Content: { "Message": "Authentication failed." }

Scenario: If site reference not valid.

Code: 400 Bad Request.
Content: "Invalid SiteReference."

Scenario: If site reference is not found in Database.

Code: 400 Bad Request
Content: "Invalid Facility Reference.”

Scenario: If any of the mandatory parameters in request model of PUT is not passed, then the respective model validation error is thrown. Example: If timestamp is not specified then;

Code: 400 Bad Request.
Content: {"Message": "The Timestamp field is required."}

Similarly, for other required fields.

Scenario: To prevent concurrency issue, the timestamp validation exists. Hence if the timestamp passed in request model doesn’t match existing timestamp. (Latest timestamp can be obtained from GET site defaults call).

Code: 404 Bad Request
Content: "The timestamp of the site default reader settings to update does not match the existing timestamp.”

Scenario: Trying to update the device default before creating.

Code: 404 Not Found.
Content: “Site reader defaults not found.”

Scenario: Passing empty array of settings in request model or empty Defaults array.

Code: 400 Bad Request.
Content: {"Message": "Reader Defaults Request Model is not valid."}

Scenario: Empty key or invalid Key.

Code: 404 Not found.
Content: “Reader setting not found.”