Skip to content

Commit

Permalink
Improve RPC API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed Sep 5, 2024
1 parent 3aa1068 commit edf4c1f
Showing 1 changed file with 84 additions and 19 deletions.
103 changes: 84 additions & 19 deletions src/admin-api/methods.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,122 @@
# Elements

## getelement

- token
- id

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "getelement", "params": {"token": "xxx", "id": "node:12141608846"}, "id": 1}' https://api.btcmap.org/rpc
```

## setelementtag

- token
- name
- value

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "setelementtag", "params": {"token": "xxx", "id": "node:12141608846", "name": "foo", "value": "bar"}, "id": 1}' https://api.btcmap.org/rpc
```

## removeelementtag

- token
- id
- tag

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "removeelementtag", "params": {"token": "xxx", "id": "node:12141608846", "tag": "foo"}, "id": 1}' https://api.btcmap.org/rpc
```

## boostelement

- token
- id
- days

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "boostelement", "params": {"token": "xxx", "id": "node:12141608846", "days": 7}, "id": 1}' https://api.btcmap.org/rpc
```

## addelementcomment

- token
- id
- comment

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "addelementcomment", "params": {"token": "xxx", "id": "node:12141608846", "comment": "test comment"}, "id": 1}' https://api.btcmap.org/rpc
```

## generateelementissues

# Areas

## createarea
## addarea

- token
- tags

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "createarea", "params": {"token": "xxx", "tags": {"url_alias": "test-area", "geo_json": {"type":"Point","coordinates":[0,0]}}}, "id": 1}' https://api.btcmap.org/rpc
```

## getarea

- token
- id

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "getarea", "params": {"token": "xxx", "id": "test-area"}, "id": 1}' https://api.btcmap.org/rpc
```

## setareatag

- token
- id
- name
- value

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "setareatag", "params": {"token": "xxx", "id": "test-area", "name": "foo", "value": "bar"}, "id": 1}' https://api.btcmap.org/rpc
```

## removeareatag

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "removeareatag", "params": {"token": "xxx", "id": "test-area", "tag": "foo"}, "id": 1}' https://api.btcmap.org/rpc
```

## removearea
- token
- id
- tag

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "removearea", "params": {"token": "xxx", "id": "test-area"}, "id": 1}' https://api.btcmap.org/rpc
curl --data-binary '{"jsonrpc": "2.0", "method": "removeareatag", "params": {"token": "xxx", "id": "test-area", "tag": "foo"}, "id": 1}' https://api.btcmap.org/rpc
```

# Elements
## gettrendingcountries

## getelement
- token
- period_start
- period_end

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "getelement", "params": {"token": "xxx", "id": "node:12141608846"}, "id": 1}' https://api.btcmap.org/rpc
curl --data-binary '{"jsonrpc": "2.0", "method": "gettrendingcountries", "params": {"token": "xxx", "period_start": "2024-01-01", "period_end": "2024-02-01"}, "id": 1}' https://api.btcmap.org/rpc
```

## setelementtag
## gettrendingcommunities

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "setelementtag", "params": {"token": "xxx", "id": "node:12141608846", "name": "foo", "value": "bar"}, "id": 1}' https://api.btcmap.org/rpc
```

## removeelementtag
- token
- period_start
- period_end

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "removeelementtag", "params": {"token": "xxx", "id": "node:12141608846", "tag": "foo"}, "id": 1}' https://api.btcmap.org/rpc
curl --data-binary '{"jsonrpc": "2.0", "method": "gettrendingcommunities", "params": {"token": "xxx", "period_start": "2024-01-01", "period_end": "2024-02-01"}, "id": 1}' https://api.btcmap.org/rpc
```

## boostelement
## removearea

- token
- id

```bash
curl --data-binary '{"jsonrpc": "2.0", "method": "boostelement", "params": {"token": "xxx", "id": "node:12141608846", "days": 7}, "id": 1}' https://api.btcmap.org/rpc
curl --data-binary '{"jsonrpc": "2.0", "method": "removearea", "params": {"token": "xxx", "id": "test-area"}, "id": 1}' https://api.btcmap.org/rpc
```

0 comments on commit edf4c1f

Please sign in to comment.