You are not logged in.
Pages: 1
Hi guys, I'm tryung to create a ticket in GLPI, using python requests. My code:
from glpi import GLPI
import requests
url = 'https://hd.integrasky.ru/apirest.php/initSession'
auth = ('username', 'password')
headers = {'App-Token': 'token',
'Content-Type': 'application/json'}
requests.get(url, auth=auth, headers=headers)
payload = {'input': {'name': 'Проблема', 'content': 'Не работает компьютер', 'entities_id': 29}}
requests.post('http://hd.integrasky.ru/apirest.php/Ticket', json=payload)
But the ticket is not creating, and there is no exception in my script.
Process finished with exit code 0
What I'm doing wrong? Someone can help me?
And should I use encoding to utf-8 to russian text?
Offline
initsession should return a session_token.
add this session_token to headers to call other endpoints ( .../Ticket)
Trouver la panne avant de réparer...
*GLPI 9.1.6+fusion9.1+1.1+behaviours1.5.0+reports+fields+appliances+pdf+badges+formcreator2.5.2 PHP7.0 Mariadb10
*GLPI 9.3.3(behaviours2.1.1+fusion9.3+1.3+applicatifs2.4.1+dashboard 0.8.9)hebergé sur serveur mutualisé.
*GLPI 9.4.0 en test (ubuntu 18.04 mariadb 10.2.4)
Online
Pages: 1