Create a ticket with REST API
-
Hi, I am trying to create a ticket when a button is clicked.
I am using AJAX by calling a function that contains the following line of code:
$request=wp_remote_post(‘http://starcatalogo.com/wp-json/wpas-api/v1/tickets’, array(‘status’ => ‘publish’, ‘title’ => ‘test’, ‘content’ => ‘test’));
$http_code = wp_remote_retrieve_response_code( $request);
edit: the url above is without the ‘’’, I do not know why this number appears when publishing the comment.
However, no new tickets are created. When retrieving the http code the result is 400
I would deeply aprreciate your help.
The topic ‘Create a ticket with REST API’ is closed to new replies.