You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+43-2
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ WIP
49
49
50
50
#### On the Web
51
51
52
-
To use Spacebin on the web, our team provides a web app written in [Svelte](https://svelte.dev): [Pulsar](https://github.com/orca-group/pulsar). A public instance of Spacebin using this client is available at [https://spaceb.in](https://spaceb.in) (the `/api`route can be used to access Spirit itself).
52
+
To use Spacebin on the web, our team provides a web app. You can access the web app at [spaceb.in](https://spaceb.in). You must use `https://spaceb.in/api` to access the API routes.
Work in progress. Check out the documentation website: [docs.spaceb.in](https://docs.spaceb.in).
72
+
There are three primary API routes to: create a document, fetch a documents text content in JSON format, and fetch a documents **plain text** content.
73
+
74
+
*`/api/`: Create Document
75
+
* Accepts JSON and multipart/form-data
76
+
* For both formats, include document content in a `content` field
77
+
* Only accepts POST requests
78
+
* Instances are able to specify a maximum document length.
79
+
*`spaceb.in` uses a 4MB maximum size.
80
+
* Successful requests return a JSON body with the following format:
81
+
```json
82
+
{
83
+
"error": "",
84
+
"payload": {
85
+
"id": "WfwKGJfs",
86
+
"content": "hello",
87
+
"created_at": "2023-08-06T00:01:33.143532-04:00",
88
+
"updated_at": "2023-08-06T00:01:33.143532-04:00"
89
+
}
90
+
}
91
+
```
92
+
*`/api/{document}`: Fetch Document
93
+
*`{document}` = Document ID
94
+
* Document ID lengths vary between instances. For `spaceb.in`, they will be exactly characters.
95
+
*
96
+
* Upon successful request, returns a JSON body with the following format:
97
+
```json
98
+
{
99
+
"error": "",
100
+
"payload": {
101
+
"id": "WfwKGJfs",
102
+
"content": "hello",
103
+
"created_at": "2023-08-06T00:01:33.143532-04:00",
104
+
"updated_at": "2023-08-06T00:01:33.143532-04:00"
105
+
}
106
+
}
107
+
```
108
+
*`/api/{document}/raw`: Fetch Document - Raw
109
+
*`{document}` = Document ID
110
+
* Document ID lengths vary between instances. For `spaceb.in`, they will be exactly 8 characters
111
+
* Returns a `plain/text` file containing the content of the document.
112
+
113
+
There are two additional non-API routes that are documented: `/ping`: returns a 200 OK if the service is online, and `/config`: returns a JSON body with the instances configuration settings.
0 commit comments