-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathexample.php
47 lines (34 loc) · 1.54 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* File: example.php
* Project: freshdesk-solutions
* User: blake, http://www.blakerobertson.com
* Date: 5/15/13
* Time: 7:07 PM
*/
require_once("FreshdeskRest.php");
// SET THE FOLLOWING
$URL = "changeme.freshdesk.com";
$API_USER = "[email protected]";
$API_PASS = "[email protected]";
$CATEGORY_NAME = "General";
$FOLDER_NAME = "Installation";
$fd = new FreshdeskRest($URL, $API_USER, $API_PASS);
// Uncomment this and it'll create TEST CATEGORY, put a folder under it called Test_Folder, and then create an article (if it doesn't exist... or update otherwise)
// print "\n\n==== SOLUTIONS EXAMPLES =======\n");
//$fd->createOrUpdateArticle("TEST CATEGORY", "Test_Folder", "Test Article Title", "The <u>HTML</u> has been changed AGAIN!<P>Paragraph 2</P>");
//$fd->getCategoryId("TEST CATEGORY");
//$fd->getFolderId($, "Test_Folder");
print "\n\n===== USER EXAMPLES =======\n";
$USER_EMAIL = "[email protected]";
$userArray = $fd->getUserByEmail($USER_EMAIL);
print "User Object: \n" . print_r($userArray, true);
print "Here's how you'd get the user_role from the array: " . $userArray['user_role'] . "\n";
print "User ID: " . $fd->getUserId($USER_EMAIL);;
// The following can be used to determine the forum category id's and and such which can be passed in to monitor topic.
//print $fd->forumListCategories();
// You'll need to put your id's in.
//print $fd->forumListForums("33267");
//print "\n\n TOPICS \n\n";
//print $fd->forumListTopics("33267", "131622");
//print $fd->monitorTopicById("33267", "131622", "18878");