Skip to content

Commit

Permalink
update API_V2.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Nov 19, 2021
1 parent ebd6de5 commit fafddba
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docs/API_V2.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ curl -X "POST" "https://127.0.0.1:8080/push" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"body": "Test Bark Server",
"device_key": "nysrshcqielvoxsa",
"device_key": "JnJ5FtCatkMkWeodPAvFkF",
"title": "bleem",
"ext_params": {
"badge": 1,
"icon": "https://day.app/assets/images/avatar.jpg",
"group": "test",
"url": "https://mritd.com"
},
"category": "category",
Expand All @@ -50,7 +53,7 @@ import (
func sendPush() {
// push (POST https://127.0.0.1:8080/push)

json := []byte(`{"body": "Test Bark Server","device_key": "nysrshcqielvoxsa","title": "bleem","ext_params": {"url": "https://mritd.com"},"category": "category","sound": "minuet.caf"}`)
json := []byte(`{"body": "Test Bark Server","device_key": "nysrshcqielvoxsa","title": "bleem","ext_params": {"badge": 1, "icon": "https://day.app/assets/images/avatar.jpg", "group": "test", "url": "https://mritd.com"},"category": "category","sound": "minuet.caf"}`)
body := bytes.NewBuffer(json)

// Create client
Expand Down Expand Up @@ -107,7 +110,10 @@ def send_request():
"device_key": "nysrshcqielvoxsa",
"title": "bleem",
"ext_params": {
"url": "https://mritd.com"
"badge": 1,
"icon": "https://day.app/assets/images/avatar.jpg",
"group": "test",
"url": "https://mritd.com"
},
"category": "category",
"sound": "minuet.caf"
Expand Down Expand Up @@ -147,7 +153,7 @@ public class SendRequest
.addHeader("Content-Type", "application/json; charset=utf-8")

// Add body
.bodyString("{\"body\": \"Test Bark Server\",\"device_key\": \"nysrshcqielvoxsa\",\"title\": \"bleem\",\"ext_params\": {\"url\": \"https://mritd.com\"},\"category\": \"category\",\"sound\": \"minuet.caf\"}", ContentType.APPLICATION_JSON)
.bodyString("{\"body\": \"Test Bark Server\",\"device_key\": \"nysrshcqielvoxsa\",\"title\": \"bleem\",\"ext_params\": {\"url\": \"https://mritd.com\", \"group\": \"test\", \"url\": \"https://mritd.com\"},\"category\": \"category\",\"sound\": \"minuet.caf\"}", ContentType.APPLICATION_JSON)

// Fetch request and return content
.execute().returnContent();
Expand Down Expand Up @@ -204,7 +210,7 @@ public class SendRequest
.on('error', (error) => {
callback(error);
});
request.write("{\"device_key\":\"nysrshcqielvoxsa\",\"body\":\"Test Bark Server\",\"title\":\"bleem\",\"sound\":\"minuet.caf\",\"category\":\"category\",\"ext_params\":{\"url\":\"https://mritd.com\"}}")
request.write("{\"device_key\":\"nysrshcqielvoxsa\",\"body\":\"Test Bark Server\",\"title\":\"bleem\",\"sound\":\"minuet.caf\",\"category\":\"category\",\"ext_params\":{\"url\":\"https://mritd.com\", \"group\":\"test\"}}")
request.end();


Expand Down

0 comments on commit fafddba

Please sign in to comment.