Hi there, i'm in trouble with python. I wrote a script that creates a json (properly formatted) with the tickets i need to post on osticket, and by now i'm able to post them launching a php script using subprocess. Now i want to use python module requests, but i can't understand how to use it for os ticket. I mean, once i have the key and the json, how i use request?basicly it should seems something like thatr = requests.post("http://helpdesk.star61.de/api/tickets.json", data=create_json_ticket(json))but i don't know how to pass the key in the right way

I do not know python so I cannot assist you.  Maybe someone else does who can though.Note: Thread moved to Mods and Customizations.

Found the solution:headers = {'X-API-Key': 'yourkey'}    response = requests.post("http://yourdomain.com/api/http.php/tickets.json", data=create_json_ticket(json), headers=headers)maybe someone will find this usefull

2 years later
Write a Reply...