forked from ActiveCampaign/activecampaign-api-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Message.class.php
103 lines (84 loc) · 3.17 KB
/
Message.class.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
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
class AC_Message extends ActiveCampaign {
public $version;
public $url_base;
public $url;
public $api_key;
function __construct($version, $url_base, $url, $api_key) {
$this->version = $version;
$this->url_base = $url_base;
$this->url = $url;
$this->api_key = $api_key;
}
function add($params, $post_data) {
$request_url = "{$this->url}&api_action=message_add&api_output={$this->output}";
$response = $this->curl($request_url, $post_data);
return $response;
}
function delete_list($params) {
$request_url = "{$this->url}&api_action=message_delete_list&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
function delete($params) {
$request_url = "{$this->url}&api_action=message_delete&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
function edit($params, $post_data) {
$request_url = "{$this->url}&api_action=message_edit&api_output={$this->output}";
$response = $this->curl($request_url, $post_data);
return $response;
}
function list_($params) {
$request_url = "{$this->url}&api_action=message_list&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
function template_add($params, $post_data) {
$request_url = "{$this->url}&api_action=message_template_add&api_output={$this->output}";
$response = $this->curl($request_url, $post_data);
return $response;
}
function template_delete_list($params) {
$request_url = "{$this->url}&api_action=message_template_delete_list&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
function template_delete($params) {
$request_url = "{$this->url}&api_action=message_template_delete&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
function template_edit($params, $post_data) {
$request_url = "{$this->url}&api_action=message_template_edit&api_output={$this->output}";
$response = $this->curl($request_url, $post_data);
return $response;
}
function template_export($params) {
$request_url = "{$this->url}&api_action=message_template_export&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
function template_import($params, $post_data) {
$request_url = "{$this->url}&api_action=message_template_import&api_output={$this->output}";
$response = $this->curl($request_url, $post_data);
return $response;
}
function template_list($params) {
$request_url = "{$this->url}&api_action=message_template_list&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
function template_view($params) {
$request_url = "{$this->url}&api_action=message_template_view&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
function view($params) {
$request_url = "{$this->url}&api_action=message_view&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
}
}
?>