-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve API auth/permission docs and examples.
- Loading branch information
Showing
8 changed files
with
60 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ Retrieve all campaigns. | |
##### Example Request | ||
|
||
```shell | ||
curl -u "username:password" -X GET 'http://localhost:9000/api/campaigns?page=1&per_page=100' | ||
curl -u "api_user:token" -X GET 'http://localhost:9000/api/campaigns?page=1&per_page=100' | ||
``` | ||
|
||
##### Parameters | ||
|
@@ -98,7 +98,7 @@ Retrieve a specific campaign. | |
##### Example Request | ||
|
||
```shell | ||
curl -u "username:password" -X GET 'http://localhost:9000/api/campaigns/1' | ||
curl -u "api_user:token" -X GET 'http://localhost:9000/api/campaigns/1' | ||
``` | ||
|
||
##### Example Response | ||
|
@@ -153,7 +153,7 @@ Preview a specific campaign. | |
##### Example Request | ||
|
||
```shell | ||
curl -u "username:password" -X GET 'http://localhost:9000/api/campaigns/1/preview' | ||
curl -u "api_user:token" -X GET 'http://localhost:9000/api/campaigns/1/preview' | ||
``` | ||
|
||
##### Example Response | ||
|
@@ -178,7 +178,7 @@ Retrieve stats of specified campaigns. | |
##### Example Request | ||
|
||
```shell | ||
curl -u "username:password" -X GET 'http://localhost:9000/api/campaigns/running/stats?campaign_id=1' | ||
curl -u "api_user:token" -X GET 'http://localhost:9000/api/campaigns/running/stats?campaign_id=1' | ||
``` | ||
|
||
##### Example Response | ||
|
@@ -208,7 +208,7 @@ Retrieve stats of specified campaigns. | |
##### Example Request | ||
|
||
```shell | ||
curl -u "username:password" -X GET 'http://localhost:9000/api/campaigns/analytics/views?id=1&from=2024-08-04&to=2024-08-12' | ||
curl -u "api_user:token" -X GET 'http://localhost:9000/api/campaigns/analytics/views?id=1&from=2024-08-04&to=2024-08-12' | ||
``` | ||
|
||
##### Example Response | ||
|
@@ -248,7 +248,7 @@ curl -u "username:password" -X GET 'http://localhost:9000/api/campaigns/analytic | |
##### Example Request | ||
|
||
```shell | ||
curl -u "username:password" -X GET 'http://localhost:9000/api/campaigns/analytics/links?id=1&from=2024-08-04T18%3A30%3A00.624Z&to=2024-08-12T18%3A29%3A00.624Z' | ||
curl -u "api_user:token" -X GET 'http://localhost:9000/api/campaigns/analytics/links?id=1&from=2024-08-04T18%3A30%3A00.624Z&to=2024-08-12T18%3A29%3A00.624Z' | ||
``` | ||
|
||
##### Example Response | ||
|
@@ -303,7 +303,7 @@ Create a new campaign. | |
##### Example request | ||
|
||
```shell | ||
curl -u "username:password" 'http://localhost:9000/api/campaigns' -X POST -H 'Content-Type: application/json;charset=utf-8' --data-raw '{"name":"Test campaign","subject":"Hello, world","lists":[1],"from_email":"listmonk <[email protected]>","content_type":"richtext","messenger":"email","type":"regular","tags":["test"],"template_id":1}' | ||
curl -u "api_user:token" 'http://localhost:9000/api/campaigns' -X POST -H 'Content-Type: application/json;charset=utf-8' --data-raw '{"name":"Test campaign","subject":"Hello, world","lists":[1],"from_email":"listmonk <[email protected]>","content_type":"richtext","messenger":"email","type":"regular","tags":["test"],"template_id":1}' | ||
``` | ||
|
||
##### Example response | ||
|
@@ -394,7 +394,7 @@ Change status of a campaign. | |
##### Example Request | ||
|
||
```shell | ||
curl -u "username:password" -X PUT 'http://localhost:9000/api/campaigns/1/status' \ | ||
curl -u "api_user:token" -X PUT 'http://localhost:9000/api/campaigns/1/status' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw '{"status":"scheduled"}' | ||
``` | ||
|
@@ -457,7 +457,7 @@ Publish campaign to public archive. | |
|
||
```shell | ||
|
||
curl -u "username:password" -X PUT 'http://localhost:8080/api/campaigns/33/archive' | ||
curl -u "api_user:token" -X PUT 'http://localhost:8080/api/campaigns/33/archive' | ||
--header 'Content-Type: application/json' | ||
--data-raw '{"archive":true,"archive_template_id":1,"archive_meta":{},"archive_slug":"my-newsletter-old-edition"}' | ||
``` | ||
|
@@ -490,7 +490,7 @@ Delete a campaign. | |
##### Example Request | ||
|
||
```shell | ||
curl -u "username:password" -X DELETE 'http://localhost:9000/api/campaigns/34' | ||
curl -u "api_user:token" -X DELETE 'http://localhost:9000/api/campaigns/34' | ||
``` | ||
|
||
##### Example Response | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ Allows sending transactional messages to one or more subscribers via a preconfig | |
##### Example | ||
|
||
```shell | ||
curl -u "username:password" "http://localhost:9000/api/tx" -X POST \ | ||
curl -u "api_user:token" "http://localhost:9000/api/tx" -X POST \ | ||
-H 'Content-Type: application/json; charset=utf-8' \ | ||
--data-binary @- << EOF | ||
{ | ||
|
@@ -55,7 +55,7 @@ ______________________________________________________________________ | |
To include file attachments in a transactional message, use the `multipart/form-data` Content-Type. Use `data` param for the parameters described above as a JSON object. Include any number of attachments via the `file` param. | ||
|
||
```shell | ||
curl -u "username:password" "http://localhost:9000/api/tx" -X POST \ | ||
curl -u "api_user:token" "http://localhost:9000/api/tx" -X POST \ | ||
-F 'data=\"{ | ||
\"subscriber_email\": \"[email protected]\", | ||
\"template_id\": 4 | ||
|