Skip to content

Commit 4fddf71

Browse files
Ed Mossgitbook-bot
Ed Moss
authored andcommitted
GITBOOK-213: change request with no subject merged in GitBook
1 parent 86ea235 commit 4fddf71

19 files changed

+1285
-2190
lines changed

SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110

111111
## DESO VALIDATORS
112112

113-
* [1️⃣ Run a Validator](deso-validators/running-a-node.md)
113+
* [1️⃣ Run a Validator](deso-validators/run-a-validator.md)
114114

115115
## Contact And Media
116116

contact-and-media/contact-us.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
# 📬 Contact US
22

3-
| Channel | Email |
4-
| -------- | ------------------------- |
5-
| Support | [email protected] |
6-
| Security | [email protected] |
3+
<table><thead><tr><th width="139">Channel</th><th>Email</th></tr></thead><tbody><tr><td>Support</td><td>[email protected]</td></tr><tr><td>Security</td><td>[email protected]</td></tr></tbody></table>

deso-backend/api/associations-endpoints.md

+157-266
Large diffs are not rendered by default.

deso-backend/api/dao-endpoints.md

+34-37
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,27 @@ description: >-
1111
\
1212
For endpoints to check ownership of DeSo Tokens, see [#get-hodlers-for-public-key](social-endpoints.md#get-hodlers-for-public-key "mention") and [#is-hodling-public-key](social-endpoints.md#is-hodling-public-key "mention").
1313

14-
{% swagger method="post" path="" baseUrl="/api/v0/get-dao-coin-limit-orders" summary="Gets All Open Orders on Order Book for a DeSo Token (DAO Coin) Market" %}
15-
{% swagger-description %}
14+
## Gets All Open Orders on Order Book for a DeSo Token (DAO Coin) Market
15+
16+
<mark style="color:green;">`POST`</mark> `/api/v0/get-dao-coin-limit-orders`
17+
1618
There are two types of markets where DeSo Tokens can be traded on the on-chain order book exchange: 1) markets where a DeSo Token is traded for $DESO, and 2) markets where a DeSo Token is traded for another DeSo Token.
1719

1820
This endpoint returns all open orders given two coins that can be traded against each other. At least one of the two coins must be a DeSo Token.
1921

2022
See [#create-dao-coin-limit-order](../construct-transactions/dao-transactions-api.md#create-dao-coin-limit-order "mention") for how to create new limit orders to trade DeSo Tokens.
2123

2224
Endpoint implementation in [backend](https://github.com/deso-protocol/backend/blob/0af8093227b219de31487ac129e799fee61e39ef/routes/dao\_coin\_exchange.go#L37).
23-
{% endswagger-description %}
24-
25-
{% swagger-parameter in="body" name="DAOCoin1CreatorPublicKeyBase58CheckOrUsername" type="string" required="true" %}
26-
Public key or username of the creator of the Token, whose DeSo Token makes up one side of a market.
27-
28-
29-
30-
An empty string here represents $DESO as one side of the market.
31-
{% endswagger-parameter %}
3225

33-
{% swagger-parameter in="body" name="DAOCoin2CreatorPublicKeyBase58CheckOrUsername2" type="string" required="true" %}
34-
Public key or username of the creator of the DAO, whose DeSo Token makes up the second side of the market.
26+
#### Request Body
3527

28+
| Name | Type | Description |
29+
| -------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
30+
| DAOCoin2CreatorPublicKeyBase58CheckOrUsername2<mark style="color:red;">\*</mark> | string | <p>Public key or username of the creator of the DAO, whose DeSo Token makes up the second side of the market.</p><p></p><p>An empty string here represents $DESO as the second side of the market.</p> |
31+
| DAOCoin1CreatorPublicKeyBase58CheckOrUsername<mark style="color:red;">\*</mark> | string | <p>Public key or username of the creator of the Token, whose DeSo Token makes up one side of a market.</p><p></p><p>An empty string here represents $DESO as one side of the market.</p> |
3632

37-
38-
An empty string here represents $DESO as the second side of the market.
39-
{% endswagger-parameter %}
40-
41-
{% swagger-response status="200: OK" description="Successfully retrieved all open orders for a coin pair" %}
33+
{% tabs %}
34+
{% tab title="200: OK Successfully retrieved all open orders for a coin pair" %}
4235
{% tabs %}
4336
{% tab title="Sample Response" %}
4437
```json5
@@ -69,37 +62,41 @@ An empty string here represents $DESO as the second side of the market.
6962
```
7063
{% endtab %}
7164
{% endtabs %}
72-
{% endswagger-response %}
65+
{% endtab %}
7366

74-
{% swagger-response status="400: Bad Request" description="" %}
67+
{% tab title="400: Bad Request " %}
7568
```javascript
7669
{
7770
"error": "..." // Error message
7871
}
7972
```
80-
{% endswagger-response %}
73+
{% endtab %}
8174

82-
{% swagger-response status="500: Internal Server Error" description="" %}
75+
{% tab title="500: Internal Server Error " %}
8376
```javascript
8477
{
8578
"error": "..." // Error message
8679
}
8780
```
88-
{% endswagger-response %}
89-
{% endswagger %}
81+
{% endtab %}
82+
{% endtabs %}
83+
84+
## Gets All Open Limit Orders Created by a Transactor
85+
86+
<mark style="color:green;">`POST`</mark> `/api/v0/get-transactor-dao-coin-limit-orders`
9087

91-
{% swagger method="post" path="" baseUrl="/api/v0/get-transactor-dao-coin-limit-orders" summary="Gets All Open Limit Orders Created by a Transactor" %}
92-
{% swagger-description %}
9388
This endpoint returns all open orders that were created by a given transactor on the DeSo Tokens on-chain order book exchange.
9489

9590
Endpoint implementation in [backend](https://github.com/deso-protocol/backend/blob/0af8093227b219de31487ac129e799fee61e39ef/routes/dao\_coin\_exchange.go#L136).
96-
{% endswagger-description %}
9791

98-
{% swagger-parameter in="body" name="TransactorPublicKeyBase58CheckOrUsername" type="string" required="true" %}
99-
Public key or username of the user whose open orders we want to retrieve.
100-
{% endswagger-parameter %}
92+
#### Request Body
93+
94+
| Name | Type | Description |
95+
| -------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------- |
96+
| TransactorPublicKeyBase58CheckOrUsername<mark style="color:red;">\*</mark> | string | Public key or username of the user whose open orders we want to retrieve. |
10197

102-
{% swagger-response status="200: OK" description="Successfully retrieved all open orders for the transactor" %}
98+
{% tabs %}
99+
{% tab title="200: OK Successfully retrieved all open orders for the transactor" %}
103100
{% tabs %}
104101
{% tab title="Sample Response" %}
105102
```json5
@@ -120,21 +117,21 @@ Public key or username of the user whose open orders we want to retrieve.
120117
```
121118
{% endtab %}
122119
{% endtabs %}
123-
{% endswagger-response %}
120+
{% endtab %}
124121

125-
{% swagger-response status="400: Bad Request" description="" %}
122+
{% tab title="400: Bad Request " %}
126123
```javascript
127124
{
128125
"error": "..." // Error message
129126
}
130127
```
131-
{% endswagger-response %}
128+
{% endtab %}
132129

133-
{% swagger-response status="500: Internal Server Error" description="" %}
130+
{% tab title="500: Internal Server Error " %}
134131
```javascript
135132
{
136133
"error": "..." // Error message
137134
}
138135
```
139-
{% endswagger-response %}
140-
{% endswagger %}
136+
{% endtab %}
137+
{% endtabs %}

deso-backend/api/media-endpoints.md

+59-64
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ description: >-
66

77
# Media Endpoints
88

9-
{% swagger method="post" path="" baseUrl="/api/v0/upload-image" summary="Upload Image" %}
10-
{% swagger-description %}
9+
## Upload Image
10+
11+
<mark style="color:green;">`POST`</mark> `/api/v0/upload-image`
12+
1113
Uploads an image to be included in a post and returns the URL where the image is stored. This endpoint also handles the resizing of the image.
1214

1315
Note that the request body should have `multipart/form-data` as the content type.
@@ -17,21 +19,17 @@ Endpoint implementation in [backend](https://github.com/deso-protocol/backend/bl
1719
Example usages in frontend:\
1820
&#x20; \- Make request to [Upload Image](https://github.com/deso-protocol/frontend/blob/e006beb72867f6d48a78adb1d126c66144a4298c/src/app/backend-api.service.ts#L825)\
1921
&#x20; \- Use UploadImage to [upload an image when a user is making a post](https://github.com/deso-protocol/frontend/blob/e006beb72867f6d48a78adb1d126c66144a4298c/src/app/feed/feed-create-post/feed-create-post.component.ts#L279)
20-
{% endswagger-description %}
2122

22-
{% swagger-parameter in="body" name="UserPublicKeyBase58Check" type="String" required="true" %}
23-
Public key of the user uploading the image.
24-
{% endswagger-parameter %}
23+
#### Request Body
2524

26-
{% swagger-parameter in="body" name="JWT" type="String" required="true" %}
27-
JWT of the user uploading the image.
28-
{% endswagger-parameter %}
25+
| Name | Type | Description |
26+
| ---------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
27+
| UserPublicKeyBase58Check<mark style="color:red;">\*</mark> | String | Public key of the user uploading the image. |
28+
| JWT<mark style="color:red;">\*</mark> | String | JWT of the user uploading the image. |
29+
| file<mark style="color:red;">\*</mark> | File | image file to upload. Must be gif, jpeg, png, or webp file. Must be less than 10 MB |
2930

30-
{% swagger-parameter in="body" name="file" type="File" required="true" %}
31-
image file to upload. Must be gif, jpeg, png, or webp file. Must be less than 10 MB
32-
{% endswagger-parameter %}
33-
34-
{% swagger-response status="200: OK" description="Successfully uploaded image and response has URL at which image can be found" %}
31+
{% tabs %}
32+
{% tab title="200: OK Successfully uploaded image and response has URL at which image can be found" %}
3533
{% tabs %}
3634
{% tab title="Sample Response" %}
3735
```json5
@@ -47,19 +45,21 @@ image file to upload. Must be gif, jpeg, png, or webp file. Must be less than 10
4745
| ImageURL | String | URL at which the uploaded image can be found |
4846
{% endtab %}
4947
{% endtabs %}
50-
{% endswagger-response %}
48+
{% endtab %}
5149

52-
{% swagger-response status="400: Bad Request" description="" %}
50+
{% tab title="400: Bad Request " %}
5351
```javascript
5452
{
5553
// Response
5654
}
5755
```
58-
{% endswagger-response %}
59-
{% endswagger %}
56+
{% endtab %}
57+
{% endtabs %}
58+
59+
## Upload Video
60+
61+
<mark style="color:green;">`POST`</mark> `/api/v0/upload-video`
6062

61-
{% swagger method="post" path="" baseUrl="/api/v0/upload-video" summary="Upload Video" %}
62-
{% swagger-description %}
6363
UploadVideo creates a one-time tokenized URL that can be used to upload larger video files using the tus protocol. The client uses the Location header in the response from this function to upload the file. The client uses the Stream-Media-Id header in the response from cloudflare to understand how to access the file for streaming.&#x20;
6464

6565
For more details, see the Cloudflare documentation on direct creator uploads [here](https://developers.cloudflare.com/stream/uploading-videos/direct-creator-uploads#using-tus-recommended-for-videos-over-200mb)
@@ -69,53 +69,48 @@ Endpoint implementation in [backend](https://github.com/deso-protocol/backend/bl
6969
For an example of uploading a video using this endpoint and the tus protocol, see the [implementation in frontend](https://github.com/deso-protocol/frontend/blob/e006beb72867f6d48a78adb1d126c66144a4298c/src/app/feed/feed-create-post/feed-create-post.component.ts#L291).\
7070
\
7171
After the upload finishes, you can check if the video is ready to be streamed by hitting the [#get-video-status](media-endpoints.md#get-video-status "mention")endpoint
72-
{% endswagger-description %}
73-
74-
{% swagger-parameter in="header" name="Upload-Length" type="Number" required="true" %}
75-
Length of video to be uploaded in bytes
76-
{% endswagger-parameter %}
77-
78-
{% swagger-parameter in="header" name="Upload-Metadata" type="JSON" %}
79-
Arbitrary metadata values - see
80-
81-
[cloudflare documentation for more details](https://developers.cloudflare.com/stream/uploading-videos/upload-video-file#supported-options-in-upload-metadata)
8272

73+
#### Headers
8374

84-
{% endswagger-parameter %}
75+
| Name | Type | Description |
76+
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77+
| Upload-Length<mark style="color:red;">\*</mark> | Number | Length of video to be uploaded in bytes |
78+
| Upload-Metadata | JSON | Arbitrary metadata values - see [cloudflare documentation for more details](https://developers.cloudflare.com/stream/uploading-videos/upload-video-file#supported-options-in-upload-metadata) |
8579

86-
{% swagger-response status="200: OK" description="Successfully created one-time tokenized URL that can be used to upload a video" %}
80+
{% tabs %}
81+
{% tab title="200: OK Successfully created one-time tokenized URL that can be used to upload a video" %}
8782
The Location header specifies the one-time tokenized URL. The Stream-Media-Id header is the ID used to stream the video from cloudflare after uploading the video.
88-
{% endswagger-response %}
83+
{% endtab %}
8984

90-
{% swagger-response status="400: Bad Request" description="" %}
85+
{% tab title="400: Bad Request " %}
9186
```javascript
9287
{
9388
// Response
9489
}
9590
```
96-
{% endswagger-response %}
97-
{% endswagger %}
91+
{% endtab %}
92+
{% endtabs %}
93+
94+
## Get Video Status
95+
96+
<mark style="color:blue;">`GET`</mark> `/api/v0/get-video-status/{videoId}`
9897

99-
{% swagger method="get" path="" baseUrl="/api/v0/get-video-status/{videoId}" summary="Get Video Status" %}
100-
{% swagger-description %}
10198
Get Video Status queries cloudflare's API to see if a video is ready to be streamed. This is useful in showing a preview of an uploaded video to an end-user when they are creating a post.
10299

103100
Endpoint implementation in [backend](https://github.com/deso-protocol/backend/blob/709cbfbc62cf3a0e6d56c393e555fc277c93fb76/routes/media.go#L372).
104101

105102
Example usage in frontend:\
106103
&#x20; \- Make request to [Get Video Status](https://github.com/deso-protocol/frontend/blob/e006beb72867f6d48a78adb1d126c66144a4298c/src/app/backend-api.service.ts#L2228)\
107104
&#x20; \- Use GetVideoStatus to [poll and see if a video is ready to be streamed after a user finished uploading it.](https://github.com/deso-protocol/frontend/blob/e006beb72867f6d48a78adb1d126c66144a4298c/src/lib/services/stream/cloudflare-stream-service.ts#L31)
108-
{% endswagger-description %}
109105

110-
{% swagger-parameter in="path" name="videoId" type="String" required="true" %}
111-
videoId retrieved from the
106+
#### Path Parameters
112107

113-
`stream-media-id`
108+
| Name | Type | Description |
109+
| ----------------------------------------- | ------ | -------------------------------------------------------------------------- |
110+
| videoId<mark style="color:red;">\*</mark> | String | videoId retrieved from the `stream-media-id` header when uploading a video |
114111

115-
header when uploading a video
116-
{% endswagger-parameter %}
117-
118-
{% swagger-response status="200: OK" description="Successfully queried Cloudflare for the status of the video" %}
112+
{% tabs %}
113+
{% tab title="200: OK Successfully queried Cloudflare for the status of the video" %}
119114
{% tabs %}
120115
{% tab title="Sample Response" %}
121116
```json5
@@ -131,37 +126,37 @@ videoId retrieved from the
131126
| ReadyToStream | Boolean | If true, the video is ready to be streamed. If false, the video is still being processed by cloudflare |
132127
{% endtab %}
133128
{% endtabs %}
134-
{% endswagger-response %}
129+
{% endtab %}
135130

136-
{% swagger-response status="400: Bad Request" description="" %}
131+
{% tab title="400: Bad Request " %}
137132
```javascript
138133
{
139134
// Response
140135
}
141136
```
142-
{% endswagger-response %}
143-
{% endswagger %}
137+
{% endtab %}
138+
{% endtabs %}
139+
140+
## Get Full TikTok URL
141+
142+
<mark style="color:green;">`POST`</mark> `/api/v0/get-full-tiktok-url`
144143

145-
{% swagger method="post" path="" baseUrl="/api/v0/get-full-tiktok-url" summary="Get Full TikTok URL" %}
146-
{% swagger-description %}
147144
Given a short video ID of a TikTok, find the URL that can be used to embed this video. The short URL users get when copying a link to a TikTok from TikTok's mobile app isn't embeddable, so this endpoint allows us to find the desktop version of the URL from which we can construct an embeddable version of the URL.
148145

149146
Endpoint implementation in [backend](https://github.com/deso-protocol/backend/blob/709cbfbc62cf3a0e6d56c393e555fc277c93fb76/routes/media.go#L244).
150147

151148
Example usages in frontend:\
152149
&#x20; \- Make request to [Get Full TikTok URL](https://github.com/deso-protocol/frontend/blob/e006beb72867f6d48a78adb1d126c66144a4298c/src/app/backend-api.service.ts#L1962)\
153150
&#x20; \- Use GetFullTikTokURL to [get an embeddable URL for the short form TikTok url](https://github.com/deso-protocol/frontend/blob/e006beb72867f6d48a78adb1d126c66144a4298c/src/lib/services/embed-url-parser-service/embed-url-parser-service.ts#L147)
154-
{% endswagger-description %}
155-
156-
{% swagger-parameter in="body" name="TikTokShortVideoID" type="String" required="true" %}
157-
Video ID found at the end of a URL copied from the TikTok mobile app.&#x20;
158151

152+
#### Request Body
159153

154+
| Name | Type | Description |
155+
| ---------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
156+
| TikTokShortVideoID<mark style="color:red;">\*</mark> | String | <p>Video ID found at the end of a URL copied from the TikTok mobile app. </p><p></p><p>For example, <code>TTPd2Eobq3</code> is the VideoID in https://vm.tiktok.com/TTPd2Eobq3/`</p> |
160157

161-
For example, `TTPd2Eobq3` is the VideoID in https://vm.tiktok.com/TTPd2Eobq3/\`
162-
{% endswagger-parameter %}
163-
164-
{% swagger-response status="200: OK" description="Successfully retrieved the embeddable version of the mobile TikTok URL provided" %}
158+
{% tabs %}
159+
{% tab title="200: OK Successfully retrieved the embeddable version of the mobile TikTok URL provided" %}
165160
{% tabs %}
166161
{% tab title="Sample Response" %}
167162
```json5
@@ -177,13 +172,13 @@ For example, `TTPd2Eobq3` is the VideoID in https://vm.tiktok.com/TTPd2Eobq3/\`
177172
| FullTikTokURL | String | Desktop version of the mobile TikTok URL provided in the request body that can be embedded in a post |
178173
{% endtab %}
179174
{% endtabs %}
180-
{% endswagger-response %}
175+
{% endtab %}
181176

182-
{% swagger-response status="400: Bad Request" description="" %}
177+
{% tab title="400: Bad Request " %}
183178
```javascript
184179
{
185180
// Response
186181
}
187182
```
188-
{% endswagger-response %}
189-
{% endswagger %}
183+
{% endtab %}
184+
{% endtabs %}

0 commit comments

Comments
 (0)