fields icon indicating copy to clipboard operation
fields copied to clipboard

Update using API

Open AAponciano opened this issue 2 months ago • 5 comments

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • [x] I have searched the existing issues

GLPI Version

11.0.4

Plugin version

1.23.1

Bug description

Hello,

I am experiencing difficulty updating information in additional/custom fields since migrating from V10 to V11.

In V10, I successfully used the following payload structure to update a specific field:

{"input": {"numticketdevopfield": "1612"}}

However, I have been unable to find the correct method for V11. I have attempted various approaches, including using the full field name, the field ID, and referencing the associated table, but without success.

Could you please provide guidance or an example of the correct API structure/payload required to update custom field information in V11?

Any hint or documentation link would be greatly appreciated.

Thank you for your time.

Relevant log output

No logs since I get every time a 200 ok

Page URL

No response

Steps To reproduce

every put or patch that I tried yelded the same result.

Your GLPI setup information

GLPI information
GLPI: 11.0.4 ( => /var/www/html/glpi)
Installation mode: TARBALL
Current language: pt_BR
Source Integrity: 10 files changed
  A: inc/downstream.php
  M: public/pics/logos/logo-G-100-black.png
  M: public/pics/logos/logo-G-100-grey.png
  M: public/pics/logos/logo-G-100-white.png
  M: public/pics/logos/logo-GLPI-100-black.png
  M: public/pics/logos/logo-GLPI-100-grey.png
  M: public/pics/logos/logo-GLPI-100-white.png
  M: public/pics/logos/logo-GLPI-250-black.png
  M: public/pics/logos/logo-GLPI-250-grey.png
  M: public/pics/logos/logo-GLPI-250-white.png
Server
Operating system: Linux azpcscitsm 6.14.0-1014-azure #​14~24.04.1-Ubuntu SMP Fri Oct  3 20:52:11 UTC 2025 x86_64

PHP: 8.3.6 apache2handler

PHP extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, random, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, igbinary, imap, intl, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, soap, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlrpc, xmlwriter, xsl, zip, Zend OPcache

Setup: disable_functions="" max_execution_time="60" max_input_vars="5000" memory_limit="256M" post_max_size="20M" session.cookie_secure="0" session.cookie_httponly="1" session.cookie_samesite="" session.save_handler="files" upload_max_filesize="20M"

Web server: Apache/2.4.58 (Ubuntu) (Apache/2.4.58 (Ubuntu) Server at hubtechhml.nstech.com.br Port 80)

User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0

Database:

Server Software: (Ubuntu)

Server Version: 8.0.44-0ubuntu0.24.04.1

Server SQL Mode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

Parameters: glpi@localhost/glpi

Host info: Localhost via UNIX socket

Requirements: PHP version (8.3.6) is supported. OS and PHP are relying on 64 bits integers. Sessions configuration is OK. Allocated memory is sufficient. Following extensions are installed: dom, fileinfo, filter, libxml, simplexml, tokenizer, xmlreader, xmlwriter. mysqli extension is installed curl extension is installed gd extension is installed intl extension is installed mbstring extension is installed zlib extension is installed bcmath extension is installed The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present. openssl extension is installed Database engine version (8.0.44) is supported. The log file has been created successfully. Write access to /var/lib/glpi/_cache has been validated. Write access to /var/lib/glpi/_cron has been validated. Write access to /var/lib/glpi has been validated. Write access to /var/lib/glpi/_graphs has been validated. Write access to /var/lib/glpi/_lock has been validated. Write access to /var/lib/glpi/_pictures has been validated. Write access to /var/lib/glpi/_plugins has been validated. Write access to /var/lib/glpi/_rss has been validated. Write access to /var/lib/glpi/_sessions has been validated. Write access to /var/lib/glpi/_tmp has been validated. Write access to /var/lib/glpi/_uploads has been validated.

Sessions configuration is secured. exif extension is installed ldap extension is installed Following extensions are installed: bz2, Phar, zip. Zend OPcache extension is installed Following extensions are installed: ctype, iconv, sodium. Write access to /var/www/html/glpi/marketplace has been validated. Timezones seems loaded in database.

GLPI constants
GLPI_ROOT: "/var/www/html/glpi"
GLPI_VERSION: "11.0.4"
GLPI_SCHEMA_VERSION: "11.0.4@9065df1ff6b8ff1d77b519d1c4856507d18258b0"
GLPI_FILES_VERSION: "11.0.4-1d4fbe9a"
GLPI_MIN_PHP: "8.2"
GLPI_MAX_PHP: "8.5"
GLPI_YEAR: "2025"
GLPI_I18N_DIR: "/var/www/html/glpi/locales"
GLPI_CONFIG_DIR: "/etc/glpi/"
GLPI_VAR_DIR: "/var/lib/glpi"
GLPI_DOC_DIR: "/var/lib/glpi"
GLPI_CACHE_DIR: "/var/lib/glpi/_cache"
GLPI_CRON_DIR: "/var/lib/glpi/_cron"
GLPI_GRAPH_DIR: "/var/lib/glpi/_graphs"
GLPI_LOCAL_I18N_DIR: "/var/lib/glpi/_locales"
GLPI_LOCK_DIR: "/var/lib/glpi/_lock"
GLPI_PICTURE_DIR: "/var/lib/glpi/_pictures"
GLPI_PLUGIN_DOC_DIR: "/var/lib/glpi/_plugins"
GLPI_RSS_DIR: "/var/lib/glpi/_rss"
GLPI_SESSION_DIR: "/var/lib/glpi/_sessions"
GLPI_TMP_DIR: "/var/lib/glpi/tmp"
GLPI_UPLOAD_DIR: "/var/lib/glpi/uploads"
GLPI_INVENTORY_DIR: "/var/lib/glpi/inventories"
GLPI_THEMES_DIR: "/var/lib/glpi/themes"
GLPI_LOG_DIR: "/var/log/glpi"
GLPI_ENVIRONMENT_TYPE: "production"
GLPI_MARKETPLACE_DIR: "/var/www/html/glpi/marketplace"
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["~^\n                        (http|https|feed)://
# protocol\n (\n (?:\n
(?:xn--[a-z0-9-]++\.)*+xn--[a-z0-9-]++ # a domain name using punycode\n
|\n (?:[\pL\pN\pS\pM\-\
]++\.)+[\pL\pN\pM]++ # a multi-level domain name\n |\n [a-z0-9\-\
]++
# a single-level domain name\n )\.?\n |
# or\n \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
# an IP address\n | # or\n \[\n
(?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))\n \] # an IPv6 address\n
)\n (?:/ (?:[\pL\pN\pS\pM\-.
\~!$&'()+,;=:@]|%[0-9A-Fa-f]{2}) )* # a path\n
(?:\? (?:[\pL\pN\-.
\~!$&'\\+,;=:@/?]|%[0-9A-Fa-f]{2}) )? # a query (optional)\n
$~ixuD"] GLPI_DISALLOWED_UPLOADS_PATTERN: "/\.(php\d*|phar)$/i" GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org" GLPI_INSTALL_MODE: "TARBALL" GLPI_NETWORK_MAIL: "[email protected]" GLPI_NETWORK_SERVICES: "https://services.glpi-network.com" GLPI_MARKETPLACE_ENABLE: 3 GLPI_MARKETPLACE_PRERELEASES: false GLPI_MARKETPLACE_ALLOW_OVERRIDE: true GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true GLPI_USER_AGENT_EXTRA_COMMENTS: "" GLPI_DOCUMENTATION_ROOT_URL: "https://links.glpi-project.org" GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1" GLPI_LOG_LVL: "warning" GLPI_SKIP_UPDATES: false GLPI_STRICT_ENV: false GLPI_AJAX_DASHBOARD: "1" GLPI_CALDAV_IMPORT_STATE: 0 GLPI_CENTRAL_WARNINGS: "1" GLPI_SYSTEM_CRON: false GLPI_TEXT_MAXSIZE: "4000" GLPI_WEBHOOK_ALLOW_RESPONSE_SAVING: "0" GLPI_WEBHOOK_CRA_MANDATORY: false GLPI_ALTCHA_MODE: "interactive" GLPI_ALTCHA_MAX_NUMBER: 50000 GLPI_ALTCHA_EXPIRATION_INTERVAL: "PT20M" GLPI_PLUGINS_DIRECTORIES: ["/var/www/html/glpi/marketplace","/var/www/html/glpi/plugins"] GLPI_NETWORK_API_URL: "https://services.glpi-network.com/api" GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/" GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/"
Réplicas SQL
Not active
Notifications
Way of sending emails: PHP
Plugins list
webapplications      Name: Appliance dashboard            Version: 5.1.3      State: Habilitado
Install Method: Marketplace fields Name: Campos adicionais Version: 1.23.1 State: Habilitado
Install Method: Marketplace behaviors Name: Comportamentos Version: 3.0.1 State: Instalado / não ativado
Install Method: Marketplace escalade Name: Escalonamento Version: 2.10.0 State: Habilitado
Install Method: Marketplace formcreator Name: Formcreator End-of-Life Update Version: 3.0.1 State: Instalado / não ativado
Install Method: Marketplace datainjection Name: Importação de dados Version: 2.15.2 State: Habilitado
Install Method: Marketplace singlesignon Name: Single Sign-on Version: 1.5.1 State: Habilitado
Install Method: Manual tag Name: Tag Management Version: 2.14.2 State: Habilitado
Install Method: Marketplace

Anything else?

No response

AAponciano avatar Dec 15 '25 00:12 AAponciano

I'm still using API V1.

AAponciano avatar Dec 15 '25 00:12 AAponciano

Me too. I'm unable to update the field content.

Wy979565895 avatar Dec 17 '25 07:12 Wy979565895

Can you try again by adding a specific key (c_id) to indicate to the plugin which container should be updated?

{
  "c_id": 3,
  "my_spcific_field": "foobar"
}

stonebuzz avatar Dec 19 '25 13:12 stonebuzz

@stonebuzz not working

curl -X PUT
https://glpi.exemplo.com/apirest.php/Ticket/123456
-H "Content-Type: application/json"
-H "Session-Token: SESSION_TOKEN_EXEMPLO"
-H "App-Token: APP_TOKEN_EXEMPLO"
-d '{ "input": { "id": 123456, "name": "[TEST API] Ticket updated via API", "c_id": 12, "zabbixeventstfield": 0, "zabbixeventdatefield": "2025-01-01 10:00:00" } }'

Result:

  • HTTP 200 OK
  • Ticket title is updated successfully
  • Plugin Fields values are NOT updated
  • No error returned by the API

paulohasseatua-star avatar Dec 19 '25 17:12 paulohasseatua-star

Can you now update the fields through the API normally?

Wy979565895 avatar Dec 24 '25 00:12 Wy979565895

Can you now update the fields through the API normally?

I can update using the API the external ID Filed for example. But not the addicional fields.

AAponciano avatar Dec 29 '25 13:12 AAponciano

Hello, I’m experiencing the same issue on my v11 test environment, which is why I haven’t migrated my production yet.

Note that with the Legacy API (v1), this returns a 200 OK, but nothing is actually upgraded.

I would like to switch to API v2.1, but there doesn’t seem to be any documentation available.

Moreover, when going to https://myglpi.domain.tld/api.php/v2.1/doc

the plugin does not appear there and does not seem to be compatible with the new API.

  • GLPI 11.0.4
  • Fields 1.23.2

tetsumaki avatar Jan 13 '26 17:01 tetsumaki

Hello, I've also tried to use c_id in the post during the creation of a ticket and patch / put trying to update and it still dosen't work

Image

AAponciano avatar Jan 21 '26 17:01 AAponciano

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

github-actions[bot] avatar Feb 06 '26 08:02 github-actions[bot]