-
Notifications
You must be signed in to change notification settings - Fork 0
/
SemanticLabEmailing.api.php
57 lines (49 loc) · 1.26 KB
/
SemanticLabEmailing.api.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
<?php
class ApiSemanticLabEmailing extends ApiBase {
public function execute() {
$params = $this->extractRequestParams();
$emailing = $params['emailing'];
$target = $params['target'];
$method = $params['method'];
$values = $params['values'];
$output = SemanticLabEmailingPageCreator::actOnPage( $emailing, $target, $method, $values );
$this->getResult()->addValue( null, $this->getModuleName(), array ( 'status' => $output ) );
return true;
}
public function getAllowedParams() {
return array(
'emailing' => array(
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
),
'method' => array(
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => false
),
'target' => array(
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
),
'values' => array(
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
)
);
}
public function getDescription() {
return array(
'API for voting satisfaction'
);
}
public function getParamDescription() {
return array(
'emailing' => 'Type of emailing',
'method' => 'Process involved',
'target' => 'Affected page',
'values' => 'Given values'
);
}
public function getVersion() {
return __CLASS__ . ': 1.1';
}
}