Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfornos committed Nov 8, 2023
1 parent e3b11c8 commit 4d9449d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ Explore the [Postman collection](https://github.com/sodazone/xcm-monitoring/tree

The subscription HTTP API allows you to create and manage subscriptions to XCM interactions of your interest.

The OpenAPI documentation is published at [http://{{your_host}}/documentation](http://localhost:3000/documentation).

Fore more details, refer to [Subscription HTTP API Guide](https://github.com/sodazone/xcm-monitoring/blob/main/guides/SUBSCRIPTION.md)

### Administration API
Expand Down
31 changes: 23 additions & 8 deletions guides/SUBSCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

This API allows you to create and manage subscriptions to XCM interactions of your interest.

Access the OpenAPI documentation at
[http://{{your_host}}/documentation](http://localhost:3000/documentation).
The OpenAPI documentation is published at [http://{{your_host}}/documentation](http://localhost:3000/documentation).

The available API methods are listed below.
Examples of request for the available API methods are listed below.
You can check the [Postman collection](https://github.com/sodazone/xcm-monitoring/tree/main/guides/postman) for usage examples.

Create subscription:
**Create a Subscription**

> [!NOTE]
> You can specify '*' as the value of senders to receive all the messages regardless of the sender address.
`POST /subs`

```shell
curl --location 'http://127.0.0.1:3000/subs' \
Expand All @@ -23,19 +28,27 @@ curl --location 'http://127.0.0.1:3000/subs' \
}'
```

List subscriptions:
**List Subscriptions**

`GET /subs`

```shell
curl --location 'http://127.0.0.1:3000/subs'
```

Get subscription:
**Get a Subscription**

`GET /subs/:id`

```shell
curl --location 'http://127.0.0.1:3000/subs/S1'
```

Update subscription:
**Update Subscription**

`PATCH /subs/:id`

The request expects an [RFC 6902 JSON patch](https://www.rfc-editor.org/rfc/rfc6902.html) payload.

```shell
curl --location --request PATCH 'http://127.0.0.1:3000/subs/S1' \
Expand All @@ -46,7 +59,9 @@ curl --location --request PATCH 'http://127.0.0.1:3000/subs/S1' \
]'
```

Delete subscription:
**Delete Subscription**

`DELETE /subs/:id`

```shell
curl --location --request DELETE 'http://127.0.0.1:3000/subs/S1'
Expand Down

0 comments on commit 4d9449d

Please sign in to comment.