You are not logged in.
Pages: 1
Hi,
GLPI 10.0.2
Can you give guidance for the correct syntax for calling the crontask via API. II want to be able to start the mailgate so that it can retrieve emails.
NOTE I specifically want to try API, as calling the normal /front/cron.php is not working as expected.
In automatic notifications the mailgate task would be http://<domain>/front/crontask.form.php?id=9
I have a valid session
C:\curl>c:\curl\bin\curl -H "Content-Type: application/json" -H "Authorization: user_token xxx" -H "App-Token: xxx" -X GET hxxp://<domain>/apirest.php/initSession
{"session_token":"ifa57d204rn5thq42bigbti0pi"}
the following returns an error
C:\curl>c:\curl\bin\curl -H "Content-Type: application/json" -H "Session-Token: ifa57d204rn5thq42bigbti0pi" -H "App-Token: xxx" -d "{"input": {"id": 9}}" -X PUT hxxp://<domain>/apirest.php/CronTask
["ERROR_JSON_PAYLOAD_INVALID","JSON payload seems not valid"]
Offline
Hello, it is not possible to start a CronTask via the API. You can use the API to change the status property of actions but that wouldn't trigger them to start.
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.
Online
Pages: 1