@@ 27-33 (lines=7) @@ | ||
24 | * |
|
25 | * @param string $id ID of your application |
|
26 | */ |
|
27 | public function getOne(string $id): array |
|
28 | { |
|
29 | $request = $this->createRequest('GET', "/apps/$id"); |
|
30 | $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); |
|
31 | ||
32 | return $this->client->sendRequest($request); |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * Get information about all your created applications. |
|
@@ 40-46 (lines=7) @@ | ||
37 | * |
|
38 | * User authentication key must be set. |
|
39 | */ |
|
40 | public function getAll(): array |
|
41 | { |
|
42 | $request = $this->createRequest('GET', '/apps'); |
|
43 | $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); |
|
44 | ||
45 | return $this->client->sendRequest($request); |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * Create a new application with provided data. |
|
@@ 113-119 (lines=7) @@ | ||
110 | * @param string $appId Application ID |
|
111 | * @param string $segmentId Segment ID |
|
112 | */ |
|
113 | public function deleteSegment(string $appId, string $segmentId): array |
|
114 | { |
|
115 | $request = $this->createRequest('DELETE', "/apps/$appId/segments/$segmentId"); |
|
116 | $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); |
|
117 | ||
118 | return $this->client->sendRequest($request); |
|
119 | } |
|
120 | } |
|
121 |
@@ 27-33 (lines=7) @@ | ||
24 | * |
|
25 | * @param string $id Notification ID |
|
26 | */ |
|
27 | public function getOne(string $id): array |
|
28 | { |
|
29 | $request = $this->createRequest('GET', "/notifications/$id?app_id={$this->client->getConfig()->getApplicationId()}"); |
|
30 | $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); |
|
31 | ||
32 | return $this->client->sendRequest($request); |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * Get information about all notifications. |
|
@@ 120-126 (lines=7) @@ | ||
117 | * |
|
118 | * @param string $id Notification ID |
|
119 | */ |
|
120 | public function cancel(string $id): array |
|
121 | { |
|
122 | $request = $this->createRequest('DELETE', "/notifications/$id?app_id={$this->client->getConfig()->getApplicationId()}"); |
|
123 | $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); |
|
124 | ||
125 | return $this->client->sendRequest($request); |
|
126 | } |
|
127 | ||
128 | /** |
|
129 | * View the devices sent a notification. |