You are not logged in.
Pages: 1
Hi
I have successfully created tickets using API but now I need to create ticket using API only for certain entity (different from the current default entity on the user)
So I need to config the entity for when the ticket will be created
is there any way to do it?
the current code i used for create ticket is:
ticket = dict()
ticket['type'] = ticket_type_id
ticket['itilcategories_id'] = ticket_cat_id
ticket['locations_id'] = ticket_loc_id
ticket['name'] = ' ticket_title_text
ticket['content'] = ticket_desc_text
then I call PUT request using Add_Item API with ticket dict() as the data and item_type = Ticket
Thanks
Offline
You need to specify the "entities_id" field in the ticket input.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Hello everyone,
I am trying to use the Rest API
Actually I am not sure about which parameters I need to send in the request
Please Where can I find an exemple of a POST request for creating a ticket with a description of parameters?
Offline
post moved to API section
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
You need to specify the "entities_id" field in the ticket input.
thanks!
Offline
Please Where can I find an exemple of a POST request for creating a ticket with a description of parameters?
I never find any, but here:
curl -X POST -H 'Content-Type: application/json' -H "Session-Token: xxxxxxxx" -d '{"input": {"name": "Ticket Name", "content": "Ticket Desc"}}' 'http://glpiserver/apirest.php/Ticket/'
the URL is: http://xxx/apirest.php/Ticket/
for the input:
name: ticket title
content: ticket description
itilcategories_id: ticket category id
type: ticket type id
locations_id : location id
you get session token from initsession:
$ curl -X GET \
-H 'Content-Type: application/json' \
-H "Authorization: Basic base64({login}:{password})" \
-H "App-Token: f7g3csp8mgatg5ebc5elnazakw20i9fyev1qopya7" \
'http://xxx/apirest.php/initSession'
Last edited by ila (2022-06-30 04:22:12)
Offline
Pages: 1