@@ -45,6 +45,7 @@ private function _getRequest($reqString, $paramArray = null, $apiUser = 'system'
45
45
http_build_query ($ paramArray )
46
46
);
47
47
48
+ // TODO: move post requests to this auth also
48
49
curl_setopt ($ ch , CURLOPT_HTTPHEADER , [
49
50
"Api-Key: " . $ this ->_apiKey ,
50
51
"Api-Username: $ apiUser "
@@ -91,7 +92,6 @@ private function _putpostRequest($reqString, $paramArray, $apiUser = 'system', $
91
92
$ apiUser
92
93
);
93
94
94
-
95
95
curl_setopt ($ ch , CURLOPT_URL , $ url );
96
96
curl_setopt ($ ch , CURLOPT_POSTFIELDS , http_build_query ($ paramArray ));
97
97
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
@@ -300,6 +300,18 @@ function createCategory($categoryName, $color, $textColor = '000000', $userName
300
300
return $ this ->_postRequest ('/categories ' , $ params , $ userName );
301
301
}
302
302
303
+ /**
304
+ * getTopic
305
+ *
306
+ * @param string $topicId id of topic
307
+ *
308
+ * @return mixed HTTP return code and API return object
309
+ */
310
+ function getTopic ($ topicID )
311
+ {
312
+ return $ this ->_getRequest ('/t/ ' . $ topicID . '.json ' );
313
+ }
314
+
303
315
/**
304
316
* createTopic
305
317
*
@@ -311,7 +323,6 @@ function createCategory($categoryName, $color, $textColor = '000000', $userName
311
323
*
312
324
* @return mixed HTTP return code and API return object
313
325
*/
314
-
315
326
function createTopic ($ topicTitle , $ bodyText , $ categoryId , $ userName , $ replyToId = 0 )
316
327
{
317
328
$ params = array (
@@ -349,7 +360,6 @@ function watchTopic($topicId, $userName = 'system')
349
360
*
350
361
* @return mixed HTTP return code and API return object
351
362
*/
352
-
353
363
function createPost ($ bodyText , $ topicId , $ userName )
354
364
{
355
365
$ params = array (
0 commit comments