Created
February 28, 2014 17:56
-
-
Save saltlakeryan/9276148 to your computer and use it in GitHub Desktop.
RT Request Tracker API Call in PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//set POST variables | |
$url = 'https://myhost/rt-path/REST/1.0/search/ticket'; | |
$fields = array( | |
'user' => ('rtuser'), | |
'pass' => ('rtpass'), | |
'format' => ('l'), //long format | |
'query' => ("Queue='mysupportqueue' and status !='resolved' and Created > '2013-03-10'") | |
); | |
//open connection | |
$ch = curl_init(); | |
//set the url, number of POST vars, POST data | |
curl_setopt($ch,CURLOPT_URL, $url); | |
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, 2); //man in the middle attack here | |
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false); //man in the middle attack here | |
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields); | |
//execute post | |
$result = curl_exec($ch); | |
//close connection | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment