Syntax For Curl
-
Hi,
I’m running wordpress on a windows machine, I think that the syntax for sending the post request may not work on it. I’ve set up everything, however in the log all I see is this after submitting the form:
[2021-04-14 19:50:35]: Ticket data: array ( 'name' => 'username', 'email' => '[email protected]', 'phone' => '1234567895', 'subject' => 'Testing', 'message' => 'teststa', 'ip' => '192.168.1.1', 'attachments' => array ( ), 'priority' => '2', ) [2021-04-14 19:50:35]: Unable to create ticket:
The attempt doesn’t even show up in the osticket logs so I’m assuming it’s a syntax issue while running the curl command.
I tried replicating the post in a command prompt and the syntax needed to be in this form:
curl -d “{\”name\”:\”name\”, \”subject\”:\”This is a test\”, \”message\”:\”Help\”, \”ip\”:\”192.168.1.1\”, \”email\”:\”[email protected]\”}” -H “X-API-Key: XXXXXXXXXXXXXXXXXXXXXXXXX” https://support.xyz.xyz/api/tickets.json
I was able to create a ticket with that syntax. Any help would be greatly appreciated.
- The topic ‘Syntax For Curl’ is closed to new replies.