Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Document HTTP API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl committed Oct 28, 2023
1 parent e78ea84 commit 04d0d88
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions docs/http/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,38 @@ The HTTP API is how emails are sent from Continuous Integration environments.
|to|string|true|
|subject|string|true|
|body|string|false|
|attachments|array|false|

#### Attachments

|name|type|required|description|
|---|---|---|
|type|string|true|The content's MIME type|
|content|string|true|The Base64 encoded content of the attachment|
|filename|string|true|The attachment's filename|

### Example

#### application/x-www-form-urlencoded
```bash
curl --request POST 'https://www.cinotify.cc/api/notify' \
-d "[email protected]&subject=building main&body=hello."
-d "[email protected]&subject=building main&body=hello.&attachments[][type]=text/plain&attachments[][content]=aGVsbG8sIHdvcmxkIQ==&attachments[][filename]=hello.txt"
```

#### json
```bash
curl -X POST 'https://www.cinotify.cc/api/notify' \
-H "Content-Type: application/json" \
-d '{"to":"[email protected]", "subject": "building main", "body":"hello."}'
-d '{
"to": "[email protected]",
"subject": "building main",
"body": "hello.",
"attachments": [
{
"type": "text/plain",
"content": "aGVsbG8sIHdvcmxkIQ==",
"filename": "hello.txt"
}
]
}'
```

0 comments on commit 04d0d88

Please sign in to comment.