Skip to content

Commit

Permalink
Add curl example to subscriber import docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 15, 2024
1 parent 1198f6f commit 392bc87
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions docs/docs/content/apis/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ______________________________________________________________________

#### GET /api/import/subscribers

Retrieve the status of an import.
Retrieve the status of an ongoing import.

##### Example Request

Expand All @@ -36,7 +36,7 @@ ______________________________________________________________________

#### GET /api/import/subscribers/logs

Retrieve logs related to imports.
Retrieve logs from an ongoing import.

##### Example Request

Expand All @@ -63,9 +63,26 @@ Send a CSV (optionally ZIP compressed) file to import subscribers. Use a multipa
| Name | Type | Required | Description |
|:-------|:------------|:---------|:-----------------------------------------|
| params | JSON string | Yes | Stringified JSON with import parameters. |
| file | File | Yes | File for upload. |
| file | file | Yes | File for upload. |

**`params`** (JSON string)

#### `params` (JSON string)
| Name | Type | Required | Description |
|:----------|:---------|:---------|:-----------------------------------------------------------------------------------------------------------------------------------|
| mode | string | Yes | `subscribe` or `blocklist` |
| delim | string | Yes | Single character indicating delimiter used in the CSV file, eg: `,` |
| lists | []number | Yes | Single character indicating delimiter used in the CSV file, eg: `,` |
| overwrite | bool | Yes | Whether to overwrite the subscriber parameters including subscriptions or ignore records that are already present in the database. |

##### Example Request

```shell
curl -u "username:password" -X POST 'http://localhost:9000/api/import/subscribers' \
-F 'params={"mode":"subscribe", "subscription_status":"confirmed", "delim":",", "lists":[1, 2], "overwrite": true}' \
-F "file=@/path/to/subs.csv"
```

##### Example Response

```json
{
Expand Down

0 comments on commit 392bc87

Please sign in to comment.