Skip to content

Commit d28e40e

Browse files
authored
update subscribers api docs (#1989)
1 parent 579fa71 commit d28e40e

File tree

1 file changed

+183
-1
lines changed

1 file changed

+183
-1
lines changed

docs/docs/content/apis/subscribers.md

Lines changed: 183 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
| ------ | --------------------------------------------------------------------------------------- | ---------------------------------------------- |
55
| GET | [/api/subscribers](#get-apisubscribers) | Query and retrieve subscribers. |
66
| GET | [/api/subscribers/{subscriber_id}](#get-apisubscriberssubscriber_id) | Retrieve a specific subscriber. |
7+
| GET | [/api/subscribers/{subscriber_id}/export](#get-apisubscriberssubscriber_idexport) | Export a specific subscriber. |
8+
| GET | [/api/subscribers/{subscriber_id}/bounces](#get-apisubscriberssubscriber_idbounces) | Retrieve a subscriber bounce records. |
79
| POST | [/api/subscribers](#post-apisubscribers) | Create a new subscriber. |
10+
| POST | [/api/subscribers/{subscriber_id}/optin](#post-apisubscriberssubscriber_idoptin) | Sends optin confirmation email to subscribers. |
811
| POST | [/api/public/subscription](#post-apipublicsubscription) | Create a public subscription. |
912
| PUT | [/api/subscribers/lists](#put-apisubscriberslists) | Modify subscriber list memberships. |
1013
| PUT | [/api/subscribers/{subscriber_id}](#put-apisubscriberssubscriber_id) | Update a specific subscriber. |
1114
| PUT | [/api/subscribers/{subscriber_id}/blocklist](#put-apisubscriberssubscriber_idblocklist) | Blocklist a specific subscriber. |
12-
| PUT | /api/subscribers/blocklist | Blocklist one or more subscribers. |
15+
| PUT | [/api/subscribers/blocklist](#put-apisubscribersblocklist) | Blocklist one or many subscribers. |
1316
| PUT | [/api/subscribers/query/blocklist](#put-apisubscribersqueryblocklist) | Blocklist subscribers based on SQL expression. |
1417
| DELETE | [/api/subscribers/{subscriber_id}](#delete-apisubscriberssubscriber_id) | Delete a specific subscriber. |
18+
| DELETE | [/api/subscribers/{subscriber_id}/bounces](#delete-apisubscriberssubscriber_idbounces) | Delete a specific subscriber's bounce records. |
1519
| DELETE | [/api/subscribers](#delete-apisubscribers) | Delete one or more subscribers. |
1620
| POST | [/api/subscribers/query/delete](#post-apisubscribersquerydelete) | Delete subscribers based on SQL expression. |
1721

@@ -180,9 +184,115 @@ curl -u 'username:password' 'http://localhost:9000/api/subscribers/1'
180184
}
181185
}
182186
```
187+
______________________________________________________________________
188+
189+
#### GET /api/subscribers/{subscriber_id}/export
190+
191+
Export a specific subscriber data that gives profile, list subscriptions, campaign views and link clicks information. Names of private lists are replaced with "Private list".
192+
193+
##### Parameters
194+
195+
| Name | Type | Required | Description |
196+
|:--------------|:----------|:---------|:-----------------|
197+
| subscriber_id | Number | Yes | Subscriber's ID. |
198+
199+
##### Example Request
200+
201+
```shell
202+
curl -u 'username:password' 'http://localhost:9000/api/subscribers/1/export'
203+
```
204+
205+
##### Example Response
183206

207+
```json
208+
{
209+
"profile": [
210+
{
211+
"id": 1,
212+
"uuid": "c2cc0b31-b485-4d72-8ce8-b47081beadec",
213+
"email": "[email protected]",
214+
"name": "John Doe",
215+
"attribs": {
216+
"city": "Bengaluru",
217+
"good": true,
218+
"type": "known"
219+
},
220+
"status": "enabled",
221+
"created_at": "2024-07-29T11:01:31.478677+05:30",
222+
"updated_at": "2024-07-29T11:01:31.478677+05:30"
223+
}
224+
],
225+
"subscriptions": [
226+
{
227+
"subscription_status": "unconfirmed",
228+
"name": "Private list",
229+
"type": "private",
230+
"created_at": "2024-07-29T11:01:31.478677+05:30"
231+
}
232+
],
233+
"campaign_views": [],
234+
"link_clicks": []
235+
}
236+
```
184237
______________________________________________________________________
185238

239+
#### GET /api/subscribers/{subscriber_id}/bounces
240+
241+
Get a specific subscriber bounce records.
242+
##### Parameters
243+
244+
| Name | Type | Required | Description |
245+
|:--------------|:----------|:---------|:-----------------|
246+
| subscriber_id | Number | Yes | Subscriber's ID. |
247+
248+
##### Example Request
249+
250+
```shell
251+
curl -u 'username:password' 'http://localhost:9000/api/subscribers/1/bounces'
252+
```
253+
254+
##### Example Response
255+
256+
```json
257+
{
258+
"data": [
259+
{
260+
"id": 841706,
261+
"type": "hard",
262+
"source": "demo",
263+
"meta": {
264+
"some": "parameter"
265+
},
266+
"created_at": "2024-08-22T09:05:12.862877Z",
267+
"email": "[email protected]",
268+
"subscriber_uuid": "137c0d83-8de6-44e2-a55f-d4238ab21969",
269+
"subscriber_id": 99,
270+
"campaign": {
271+
"id": 2,
272+
"name": "Welcome to listmonk"
273+
}
274+
},
275+
{
276+
"id": 841680,
277+
"type": "hard",
278+
"source": "demo",
279+
"meta": {
280+
"some": "parameter"
281+
},
282+
"created_at": "2024-08-19T14:07:53.141917Z",
283+
"email": "[email protected]",
284+
"subscriber_uuid": "137c0d83-8de6-44e2-a55f-d4238ab21969",
285+
"subscriber_id": 99,
286+
"campaign": {
287+
"id": 1,
288+
"name": "Test campaign"
289+
}
290+
}
291+
]
292+
}
293+
```
294+
295+
______________________________________________________________________
186296

187297
#### POST /api/subscribers
188298

@@ -230,6 +340,26 @@ curl -u 'username:password' 'http://localhost:9000/api/subscribers' -H 'Content-
230340

231341
______________________________________________________________________
232342

343+
#### POST /api/subscribers/{subscribers_id}/optin
344+
345+
Sends optin confirmation email to subscribers.
346+
347+
##### Example Request
348+
349+
```shell
350+
curl -u 'username:password' 'http://localhost:9000/api/subscribers/11/optin' -H 'Content-Type: application/json' \
351+
--data {}
352+
```
353+
354+
##### Example Response
355+
356+
```json
357+
{
358+
"data": true
359+
}
360+
```
361+
______________________________________________________________________
362+
233363
#### POST /api/public/subscription
234364

235365
Create a public subscription, accepts both form encoded or JSON encoded body.
@@ -333,6 +463,32 @@ curl -u 'username:password' -X PUT 'http://localhost:9000/api/subscribers/9/bloc
333463

334464
______________________________________________________________________
335465

466+
#### PUT /api/subscribers/blocklist
467+
468+
Blocklist multiple subscriber.
469+
470+
##### Parameters
471+
472+
| Name | Type | Required | Description |
473+
|:--------------|:----------|:---------|:-----------------|
474+
| ids | Number | Yes | Subscriber's ID. |
475+
476+
##### Example Request
477+
478+
```shell
479+
curl -u 'username:password' -X PUT 'http://localhost:8080/api/subscribers/blocklist' -H 'Content-Type: application/json' --data-raw '{"ids":[2,1]}'
480+
```
481+
482+
##### Example Response
483+
484+
```json
485+
{
486+
"data": true
487+
}
488+
```
489+
490+
______________________________________________________________________
491+
336492
#### PUT /api/subscribers/query/blocklist
337493

338494
Blocklist subscribers based on SQL expression.
@@ -382,6 +538,32 @@ curl -u 'username:password' -X DELETE 'http://localhost:9000/api/subscribers/9'
382538

383539
______________________________________________________________________
384540

541+
#### DELETE /api/subscribers/{subscriber_id}/bounces
542+
543+
Delete a subscriber's bounce records
544+
545+
##### Parameters
546+
547+
| Name | Type | Required | Description |
548+
|:-----|:--------------|:---------|:---------------------------|
549+
| id | subscriber_id | Yes | Subscriber's ID. |
550+
551+
##### Example Request
552+
553+
```shell
554+
curl -u 'username:password' -X DELETE 'http://localhost:9000/api/subscribers/9/bounces'
555+
```
556+
557+
##### Example Response
558+
559+
```json
560+
{
561+
"data": true
562+
}
563+
```
564+
565+
______________________________________________________________________
566+
385567
#### DELETE /api/subscribers
386568

387569
Delete one or more subscribers.

0 commit comments

Comments
 (0)