-
Notifications
You must be signed in to change notification settings - Fork 16
/
WufooApiExamples.php
executable file
·90 lines (71 loc) · 2.89 KB
/
WufooApiExamples.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
require_once('WufooApiWrapper.php');
/**
* All available methods and an example of how to call them.
*
* @package default
* @author Timothy S Sabat
*/
class WufooApiExamples {
private $apiKey;
private $subdomain;
public function __construct($apiKey, $subdomain, $domain = 'wufoo.com') {
$this->apiKey = $apiKey;
$this->subdomain = $subdomain;
$this->domain = $domain;
}
public function getForms($identifier = null) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getForms($identifier);
}
public function getFields($identifier) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getFields($identifier);
}
public function getEntries($identifier) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getEntries($identifier);
}
public function getEntryCount($identifier) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getEntryCount($identifier);
}
public function getUsers() {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getUsers();
}
public function getReports($identifier = null) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getReports($identifier);
}
public function getWidgets($identifier) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getWidgets($identifier);
}
public function getReportFields($identifier) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getReportFields($identifier);
}
public function getReportEntries($identifier) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getReportEntries($identifier);
}
public function getReportEntryCount($identifier) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getReportEntryCount($identifier);
}
public function getComments($identifier) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->getComments($identifier);
}
public function entryPost($identifier, $postArray = '') {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
$postArray = array(new WufooSubmitField('Field1', 'Booyah!'), new WufooSubmitField('Field1', '/files/myFile.txt', $isFile = true));
return $wrapper->entryPost($identifier, $postArray);
}
public function webHookPut($identifier, $urlToAdd, $handshakeKey, $metadata = false) {
$wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
return $wrapper->webHookPut($identifier, $urlToAdd, $handshakeKey, $metadata = false);
}
}
?>