Skip to content

Commit a9323f3

Browse files
committed
docs: proposal build update support
1 parent 30452de commit a9323f3

File tree

1 file changed

+55
-6
lines changed

1 file changed

+55
-6
lines changed

docs/APIContract.md

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ The base URL for an API should be: _baseURL_/_apiVersion_/ meaning even somethin
99
In order to provide a consistent API a metadata endpoint should be provided under _baseURL_/.well-known/pathofbuilding this endpoint should provide information about the API and the version of the API.
1010
Furthermore this may allow having custom endpoints for the API.
1111

12-
| Feature | Field | Type | Description |
13-
| ---------------- | ------------- | ------------ | --------------------------------------------------------------------------------- |
14-
| League Filtering | league_filter | bool | This can be used to indicate whether the API supports filtering based on leagues |
15-
| Gem Filtering | gem_filter | bool | This can be used to indicate whether the API supports filtering based on gems |
16-
| Streams | streams | StreamInfo[] | A list of streams available to be queried against |
12+
| Feature | Field | Type | Description |
13+
| ---------------- | ------------- | ---------------- | ------------------------------------------------------------------------------------ |
14+
| League Filtering | league_filter | bool | This can be used to indicate whether the API supports filtering based on leagues |
15+
| Gem Filtering | gem_filter | bool | This can be used to indicate whether the API supports filtering based on gems |
16+
| Streams | streams | StreamInfo[] | A list of streams available to be queried against |
17+
| Update Builds | update_builds | UpdateBuildsInfo | Indicates if the API supports updating builds via PoB and which fields are supported |
1718

1819
### Types
1920

@@ -26,6 +27,21 @@ Furthermore this may allow having custom endpoints for the API.
2627

2728
apiPath might be changed to a generic endpoint such as `/v1/{stream}/builds`
2829

30+
#### UpdateBuildsInfo
31+
32+
| Field | Type | Description |
33+
| ---------- | -------- | ------------------------------------------------------ |
34+
| hasSupport | bool | indicates if the API supports updating external builds |
35+
| fields | string[] | list of fields that can be updated |
36+
37+
Example:
38+
39+
```json
40+
{
41+
"hasSupport": true,
42+
"fields": ["description", "youtubeUrl"]
43+
}
44+
```
2945
## Version 1
3046

3147
### Response and Request types
@@ -42,7 +58,7 @@ apiPath might be changed to a generic endpoint such as `/v1/{stream}/builds`
4258
### Endpoints
4359

4460
<details>
45-
<summary><code>GET</code> <code><b>/v1/{stream}/builds</b></code> <code>(Lists multiple builds)</code></summary>
61+
<summary><code>GET</code> <code><b>/v1/builds</b></code> <code>(Lists multiple builds)</code></summary>
4662

4763
#### Parameters
4864
> Query Parameters
@@ -77,3 +93,36 @@ Example values:
7793

7894
</details>
7995

96+
97+
<details>
98+
<summary><code>POST</code> <code><b>/v1/builds/{buildId}</b></code> <code>(Update a single build on the source)</code></summary>
99+
100+
#### Parameters
101+
> Path Parameters
102+
103+
| name | type | data type | description |
104+
| ------- | -------- | --------- | ---------------------------------------------------------- |
105+
| buildId | required | string | The build in question on the source that should be updated |
106+
107+
#### Request
108+
109+
| Field | Type | Description |
110+
| ---------- | -------- | ---------------------------------- |
111+
| pobdata | string | The Path of Building data |
112+
| name | string | The name of the build |
113+
| customData | string[] | A list of custom data to be stored |
114+
115+
customData will be describable fields via the metadata endpoint, if customData is empty it is expected to be ignored and no changes should be made.
116+
117+
#### Responses
118+
119+
| http code | content-type | response | Description |
120+
| --------- | -------------------------- | --------------------- | ---------------------- |
121+
| `200` | `application/json` | None | Update succesful |
122+
| `201` | `application/json` | None | Succesful creation |
123+
| `400` | `text/html; charset=utf-8` | `Reason for failure` | Input may be incorrect |
124+
| `401` | `text/html; charset=utf-8` | `Reason if necessary` | Auth incorrect |
125+
| `404` | `text/html; charset=utf-8` | None | Build does not exist |
126+
127+
</details>
128+

0 commit comments

Comments
 (0)