Machine Attributes

This page uses the Lynx API to update an attribute of a machine. In the step-by-step guide below, you'll use the following endpoint:

🚧

Authentication

Refer to the Security & Token page of this documentation to learn how to access your tokens, and how to properly use it to authenticate your API requests.

Updating Machine's Attribute

Use the Bulk Update Machine Attributes endpoint to update specific machine attributes. Provide the MachineID as a path parameter, along with the attributes you want to change as body parameters, as exemplified below:

curl -X PUT "https://lynx.nayax.com/operational/api/v1/machines/<MACHINE_ID>/attributes" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
  "DeviceAttributeID": 1001,
  "MachineID": 942488501,
  "DeviceAttributeValue": "Updated Vending Machine Name",
  "DeviceAttributeCodeID": 3002,
  "DeviceAttributeName": "MachineName",
  "DeviceAttributeGroup": "General",
  "DeviceAttributeReadOnlyBit": false
}'

📘

Replace <MACHINE_ID> with the actual machine's unique identifier, you want to update the attributes.

This table outlines the key attributes available for update:

NameTypeDescription
DeviceAttributeIDint64A unique ID that identifies the specific attribute of the device.
MachineIDint64The unique identifier of the machine associated with this attribute.
DeviceAttributeValuestringThe value assigned to the device attribute.
DeviceAttributeCodeIDint32The code identifier that categorizes the device attribute.
DeviceAttributeNamestringThe name of the device attribute being modified.
DeviceAttributeGroupstringThe group or category to which the device attribute belongs.
DeviceAttributeReadOnlyBitbooleanIndicates whether the device attribute is read-only.

The response will indicate whether the update was entirely successful or if there were any failures.

{
  "isFullySuccess": true,
  "failureItems": [
    {
      "id": "123456",
      "error": "Attribute update failed due to invalid value."
    }
  ]
}

Where:

  • isFullySuccess indicates whether the update was entirely successful (true if successful, false if there were any issues).
  • failureItems is an array of any failed items, where each entry includes:
    • id: The identifier of the failed item (e.g., attribute ID).
    • error: A description of the error encountered during the update.

📘

If isFullySuccess is true and failureItems is empty. The update was completed successfully without any errors.