docs(api): add Bruno collection for Jetstream API
Excludes docs/ from deno fmt and deno lint so the Bruno files don't break formatting and lint checks in CI.
This commit is contained in:
@@ -0,0 +1,206 @@
|
||||
meta {
|
||||
name: Add one or more webhook subscriptions
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
body: json
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
params:path {
|
||||
did:
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: {{token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"method": "",
|
||||
"url": "",
|
||||
"token": "",
|
||||
"verb": ""
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 201 Response
|
||||
description: One subscription per requested verb.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: POST
|
||||
mode: json
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
|
||||
body:json: {
|
||||
{
|
||||
"method": "",
|
||||
"url": "",
|
||||
"token": "",
|
||||
"verb": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 201
|
||||
text: Created
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"did": "",
|
||||
"method": "",
|
||||
"url": "",
|
||||
"verb": ""
|
||||
}
|
||||
]
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 400 Response
|
||||
description: Malformed input.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: POST
|
||||
mode: json
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
|
||||
body:json: {
|
||||
{
|
||||
"method": "",
|
||||
"url": "",
|
||||
"token": "",
|
||||
"verb": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 400
|
||||
text: Bad Request
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 401 Response
|
||||
description: Missing or invalid bearer token.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: POST
|
||||
mode: json
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
|
||||
body:json: {
|
||||
{
|
||||
"method": "",
|
||||
"url": "",
|
||||
"token": "",
|
||||
"verb": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 401
|
||||
text: Unauthorized
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 403 Response
|
||||
description: Token is valid but the caller is not authorized for this resource.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: POST
|
||||
mode: json
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
|
||||
body:json: {
|
||||
{
|
||||
"method": "",
|
||||
"url": "",
|
||||
"token": "",
|
||||
"verb": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 403
|
||||
text: Forbidden
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
meta {
|
||||
name: Delete a single webhook subscription by id
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{baseUrl}}/:did/webhooks/:id
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
params:path {
|
||||
did:
|
||||
id:
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: {{token}}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 204 Response
|
||||
description: Subscription deleted.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks/:id
|
||||
method: DELETE
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
id:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
status: {
|
||||
code: 204
|
||||
text: No Content
|
||||
}
|
||||
|
||||
body: {
|
||||
type: text
|
||||
content: '''
|
||||
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 400 Response
|
||||
description: Malformed input.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks/:id
|
||||
method: DELETE
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
id:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 400
|
||||
text: Bad Request
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 401 Response
|
||||
description: Missing or invalid bearer token.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks/:id
|
||||
method: DELETE
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
id:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 401
|
||||
text: Unauthorized
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 403 Response
|
||||
description: Token is valid but the caller is not authorized for this resource.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks/:id
|
||||
method: DELETE
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
id:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 403
|
||||
text: Forbidden
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 404 Response
|
||||
description: No subscription with that id owned by this DID.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks/:id
|
||||
method: DELETE
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
id:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 404
|
||||
text: Not Found
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
meta {
|
||||
name: Delete every webhook subscription for the caller
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
params:path {
|
||||
did:
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: {{token}}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 204 Response
|
||||
description: All subscriptions deleted.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: DELETE
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
status: {
|
||||
code: 204
|
||||
text: No Content
|
||||
}
|
||||
|
||||
body: {
|
||||
type: text
|
||||
content: '''
|
||||
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 401 Response
|
||||
description: Missing or invalid bearer token.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: DELETE
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 401
|
||||
text: Unauthorized
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 403 Response
|
||||
description: Token is valid but the caller is not authorized for this resource.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: DELETE
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 403
|
||||
text: Forbidden
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
meta {
|
||||
name: List a DID's webhook subscriptions
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
params:path {
|
||||
did: did:plc:4m3kouplb7s7xozjd3whinvl
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: {{token}}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 200 Response
|
||||
description: All subscriptions owned by the caller.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: GET
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 200
|
||||
text: OK
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"did": "",
|
||||
"method": "",
|
||||
"url": "",
|
||||
"verb": ""
|
||||
}
|
||||
]
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 401 Response
|
||||
description: Missing or invalid bearer token.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: GET
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 401
|
||||
text: Unauthorized
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
example {
|
||||
name: 403 Response
|
||||
description: Token is valid but the caller is not authorized for this resource.
|
||||
|
||||
request: {
|
||||
url: {{baseUrl}}/:did/webhooks
|
||||
method: GET
|
||||
mode: none
|
||||
params:path: {
|
||||
did:
|
||||
}
|
||||
}
|
||||
|
||||
response: {
|
||||
headers: {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
status: {
|
||||
code: 403
|
||||
text: Forbidden
|
||||
}
|
||||
|
||||
body: {
|
||||
type: json
|
||||
content: '''
|
||||
{
|
||||
"error": ""
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
7
docs/Remanso Jetstream API/webhooks/folder.bru
Normal file
7
docs/Remanso Jetstream API/webhooks/folder.bru
Normal file
@@ -0,0 +1,7 @@
|
||||
meta {
|
||||
name: webhooks
|
||||
}
|
||||
|
||||
auth {
|
||||
mode: inherit
|
||||
}
|
||||
Reference in New Issue
Block a user