xerotic

HF API v2 Writable Field List

Jun 1st, 2020
1,916
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. require_once "hf_api.php";
  4.  
  5. // Initialize api instance
  6. $api = new HF_API();
  7.  
  8. // Set the access token for the specific authorized member
  9. $api->setAccessToken("ACCESS_TOKEN_HERE");
  10.  
  11. // Let's make a post
  12. $write = $api->write([
  13.     "posts" => [ // Posts Write Permissions
  14.         '_tid' => "THREAD_ID",
  15.         '_message' => "POST_MESSAGE",
  16.     ]
  17. ]);
  18.  
  19. // Let's make a thread
  20. $write = $api->write([
  21.     "threads" => [ // Posts Write Permissions
  22.         '_fid' => "FORUM_ID",
  23.         '_subject' => "THREAD_SUBJECT",
  24.         '_message' => "FIRST_POST_MESSAGE",
  25.     ]
  26. ]);
Add Comment
Please, Sign In to add comment