> ## Documentation Index
> Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 机器属性

本页面使用 Lynx API 更新机器的属性。在下面的分步指南中，您将使用以下端点：

[/reference/zh/lynx/machine-attribute/bulk-update-machine-attributes](https://devzone.nayax.com/reference/zh/lynx/machine-attribute/bulk-update-machine-attributes.md)

[/reference/zh/lynx/machine-attribute/update-specific-machine-attribute](https://devzone.nayax.com/reference/zh/lynx/machine-attribute/update-specific-machine-attribute.md)

> [!WARNING]
>
> 验证
>
> 请参阅本文档的[“安全和令牌”](https://devzone.nayax.com/docs/manage-data-operations/lynx-api/security)页面，了解如何访问您的令牌，以及如何正确使用它来验证您的 API 请求。

## 更新机器的属性

使用 [Bulk Update Machine Attributes](https://devzone.nayax.com/reference/zh/lynx/machine-attribute/bulk-update-machine-attributes.md) 端点更新特定的机器属性。请将 `MachineID` 作为路径参数提供，并将您要更改的属性作为正文参数提供，如下例所示：

```sh Request theme={null}
curl -X PUT "https://qa-lynx.nayax.com/operational/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
}'
```

> [!NOTE]
>
> Replace `<MACHINE_ID>` with the actual machine's unique identifier, you want to update the attributes.

下表列出了可供更新的关键属性：

| 姓名 | 类型 | 描述 |
| :- | :- | :- |
| `DeviceAttributeID` | `int64` | 用于标识设备特定属性的唯一 ID。 |
| `MachineID` | `int64` | 与此属性关联的机器的唯一标识符。 |
| `DeviceAttributeValue` | `string` | 分配给该设备属性的值。 |
| `DeviceAttributeCodeID` | `int32` | 用于对设备属性进行分类的代码标识符。 |
| `DeviceAttributeName` | `string` | 正在修改的设备属性的名称。 |
| `DeviceAttributeGroup` | `string` | 设备属性所属的组或类别。 |
| `DeviceAttributeReadOnlyBit` | `boolean` | 指示该设备属性是否为只读。 |

响应将指示更新是否完全成功，或是否存在任何失败情况。

```json Response theme={null}
{
  "isFullySuccess": true,
  "failureItems": [
    {
      "id": "123456",
      "error": "Attribute update failed due to invalid value."
    }
  ]
}
```

在哪里：

* `isFullySuccess` 指示更新是否完全成功（成功为 `true`，若存在任何问题则为 `false`）。
* `failureItems` 是任何失败项的数组，其中每个条目包含：
  * `id`：失败项的标识符（例如属性 ID）。
  * `error`：更新过程中遇到的错误描述。

> [!NOTE]
>
> 如果 `isFullySuccess` 为 `true` 且 `failureItems` 为空。则更新已成功完成，没有任何错误。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.