Skip to content

Commit

Permalink
update API_V2 doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Dec 23, 2021
1 parent 10e3b62 commit 87e79f9
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions docs/API_V2.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ curl -X "POST" "http://127.0.0.1:8080/push" \
"body": "Test Bark Server",
"device_key": "ynJ5Ft4atkMkWeo2PAvFhF",
"title": "bleem",
"ext_params": {
"badge": 1,
"icon": "https://day.app/assets/images/avatar.jpg",
"group": "test",
"url": "https://mritd.com"
},
"badge": 1,
"category": "category",
"sound": "minuet.caf"
"sound": "minuet.caf",
"icon": "https://day.app/assets/images/avatar.jpg",
"group": "test",
"url": "https://mritd.com"
}'
```

Expand All @@ -53,7 +51,7 @@ import (
func sendPush() {
// push (POST http://127.0.0.1:8080/push)

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"}`)
json := []byte(`{"body": "Test Bark Server","device_key": "nysrshcqielvoxsa","title": "bleem", "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 @@ -109,14 +107,12 @@ def send_request():
"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"
"sound": "minuet.caf",
"badge": 1,
"icon": "https://day.app/assets/images/avatar.jpg",
"group": "test",
"url": "https://mritd.com"
})
)
print('Response HTTP Status Code: {status_code}'.format(
Expand Down Expand Up @@ -153,7 +149,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\", \"group\": \"test\", \"url\": \"https://mritd.com\"},\"category\": \"category\",\"sound\": \"minuet.caf\"}", ContentType.APPLICATION_JSON)
.bodyString("{\"body\": \"Test Bark Server\",\"device_key\": \"nysrshcqielvoxsa\",\"title\": \"bleem\",\"url\": \"https://mritd.com\", \"group\": \"test\",\"category\": \"category\",\"sound\": \"minuet.caf\"}", ContentType.APPLICATION_JSON)

// Fetch request and return content
.execute().returnContent();
Expand Down Expand Up @@ -210,7 +206,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\", \"group\":\"test\"}}")
request.write("{\"device_key\":\"nysrshcqielvoxsa\",\"body\":\"Test Bark Server\",\"title\":\"bleem\",\"sound\":\"minuet.caf\",\"category\":\"category\",\"url\":\"https://mritd.com\", \"group\":\"test\"}")
request.end();


Expand Down

0 comments on commit 87e79f9

Please sign in to comment.