[comment]: # translation:outdated

[comment]: # ({cc00d3db-cc00d3db})
# itemprototype.update

[comment]: # ({/cc00d3db-cc00d3db})

[comment]: # ({63442cbb-63442cbb})
### Leírás

`object itemprototype.update(object/array itemPrototypes)`

Ez a módszer lehetővé teszi a meglévő cikkprototípusok frissítését.

::: noteclassic
Ez a módszer csak az *Admin* és a *Kiemelt rendszergazda* számára érhető el
felhasználói típusok. A metódus meghívására vonatkozó engedélyek felhasználói szerepkörben visszavonhatók
beállítások. Lásd: [User
roles](/manual/web_interface/frontend_sections/administration/user_roles)
további információért.
:::

[comment]: # ({/63442cbb-63442cbb})

[comment]: # ({3b327914-16fcb884})
### Paraméterek

`(objektum/tömb)` Frissítendő elem prototípus tulajdonságai.

Az "itemid" tulajdonságot minden egyes cikk prototípushoz meg kell határozni, az összes többihez
a tulajdonságok nem kötelezőek. Csak az átadott tulajdonságok frissülnek
a többi változatlan marad.

A [standard item prototype
property](object#item_prototype), a metódus a következőket fogadja el
paramétereket.

|Paraméter|[Típus](/manual/api/reference_commentary#data_types)|Leírás|
|--|--|------|
|preprocessing|array|Elem prototípus [előfeldolgozás](/manual/api/reference/itemprototype/object#item_prototype_preprocessing) opciók a jelenlegi előfeldolgozási beállítások helyettesítésére.|
|tags|array|Elem prototípus [címkék](/manual/api/reference/itemprototype/object#item_prototype_tag).|

[comment]: # ({/3b327914-16fcb884})

[comment]: # ({f7f1feb9-f7f1feb9})
### Visszatérési értékek

`(object)` A frissített elem azonosítóit tartalmazó objektumot ad vissza
prototípusok az "itemids" tulajdonság alatt.

[comment]: # ({/f7f1feb9-f7f1feb9})

[comment]: # ({b41637d2-b41637d2})
### Példák

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({c90dddc6-48cea947})
#### Egy cikk prototípusának felületének megváltoztatása

Módosítsa a felderített elemek által használt gazdagép felületet.

Kérés:

``` json
{
    "jsonrpc": "2.0",
    "method": "itemprototype.update",
    "params": {
        "itemid": "27428",
        "interfaceid": "132"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Válasz:

``` json
{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "27428"
        ]
    },
    "id": 1
}
```

[comment]: # ({/c90dddc6-48cea947})

[comment]: # ({new-e1d8fc73})
#### Update dependent item prototype

Update Dependent item prototype with new Master item prototype ID. Only
dependencies on same host (template/discovery rule) are allowed,
therefore Master and Dependent item should have same hostid and ruleid.

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "itemprototype.update",
    "params": {
        "master_itemid": "25570",
        "itemid": "189030"
    },
    "auth": "700ca65537074ec963db7efabda78259",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "189030"
        ]
    },
    "id": 1
}
```

[comment]: # ({/new-e1d8fc73})

[comment]: # ({new-d7fe7206})
#### Update HTTP agent item prototype

Change query fields and remove all custom headers.

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "itemprototype.update",
    "params": {
        "itemid":"28305",
        "query_fields": [
            {
                "random": "qwertyuiopasdfghjklzxcvbnm"
            }
        ],
        "headers": []
    }
    "auth": "700ca65537074ec963db7efabda78259",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "28305"
        ]
    },
    "id": 1
}
```

[comment]: # ({/new-d7fe7206})

[comment]: # ({new-e5fc44e0})
#### Updating item preprocessing options

Update an item prototype with item preprocessing rule “Custom
multiplier”.

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "itemprototype.update",
    "params": {
        "itemid": "44211",
        "preprocessing": [
            {
                "type": 1,
                "params": "4",
                "error_handler": 2,
                "error_handler_params": "5"
            }
        ]
    },
    "auth": "700ca65537074ec963db7efabda78259",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "44211"
        ]
    },
    "id": 1
}
```

[comment]: # ({/new-e5fc44e0})

[comment]: # ({new-15ba4525})
#### Updating a script item prototype

Update a script item prototype with a different script and remove
unnecessary parameters that were used by previous script.

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "itemprototype.update",
    "params": {
        "itemid": "23865",
        "parameters": [],
        "script": "Zabbix.Log(3, 'Log test');\nreturn 1;"
    },
    "auth": "700ca65537074ec963db7efabda78259",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "23865"
        ]
    },
    "id": 1
}
```

[comment]: # ({/new-15ba4525})

[comment]: # ({bc6956c2-bc6956c2})
### Forrás

CItemPrototype::update() in
*ui/include/classes/api/services/CItemPrototype.php*.

[comment]: # ({/bc6956c2-bc6956c2})
