Skip to content

Commit 7105324

Browse files
Update DOCS.md
1 parent 21b85e7 commit 7105324

File tree

1 file changed

+166
-18
lines changed

1 file changed

+166
-18
lines changed

DOCS.md

+166-18
Original file line numberDiff line numberDiff line change
@@ -191,34 +191,182 @@ Endpoint: https://nostrcheck.me/api/v2/admin/deleterecord
191191
}
192192
```
193193

194+
### insertrecord [POST]
195+
This method inserts a new record into a specified table in the database. The request must include a valid table name, a row object with field-value pairs, and an Authorization header with a valid authkey. On success, it returns a message indicating that the record was inserted, along with an authkey.
196+
197+
Endpoint: https://nostrcheck.me/api/v2/admin/insertrecord
198+
199+
**Headers**
200+
201+
- `Content-Type`: application/json
202+
- `Authorization`: Bearer {authkey}
203+
204+
**Parameters**
205+
206+
- `table`: The name of the table where the record will be inserted.
207+
- `row`: An object containing field-value pairs to be inserted as a new record.
208+
209+
**Example Request**
210+
211+
```json
212+
{
213+
"method": "POST",
214+
"url": "https://nostrcheck.me/api/v2/admin/insertrecord",
215+
"headers": {
216+
"Content-Type": "application/json",
217+
"Authorization": "Bearer Auth37f3352fe10584d7396f010eb501482930dd712f"
218+
},
219+
"body": {
220+
"table": "table_name",
221+
"row": {
222+
"field1": "value1",
223+
"field2": "value2",
224+
...
225+
}
226+
}
227+
}
228+
```
229+
230+
**Example Response**
231+
232+
```json
233+
{
234+
"status": "success",
235+
"message": "Records inserted",
236+
"authkey": "auth_key"
237+
}
238+
```
239+
240+
### updatesettings [POST]
241+
This method updates the settings of a specified module in the application. The request must include a valid module name, a setting name, a new value for the setting, and an Authorization header with a valid authkey. On success, it returns a message indicating that the settings were updated, along with an authkey.
242+
243+
Endpoint: https://nostrcheck.me/api/v2/admin/updatesettings
244+
245+
**Headers**
246+
247+
- `Content-Type`: application/json
248+
- `Authorization`: Bearer {authkey}
249+
250+
**Parameters**
251+
252+
- `name`: The name of the setting to be updated.
253+
- `value`: The new value for the setting.
254+
255+
**Example Request**
256+
257+
```json
258+
{
259+
"method": "POST",
260+
"url": "https://nostrcheck.me/api/v2/admin/updatesettings",
261+
"headers": {
262+
"Content-Type": "application/json",
263+
"Authorization": "Bearer Auth37f3352fe10584d7396f010eb501482930dd712f"
264+
},
265+
"body": {
266+
"name": "setting_name",
267+
"value": "new_value"
268+
}
269+
}
270+
```
271+
272+
**Example Response**
273+
274+
```json
275+
{
276+
"status": "success",
277+
"message": "Succesfully updated settings.",
278+
"authkey": "auth_key"
279+
}
280+
```
281+
### updatelogo [POST]
282+
This method updates the logo of the application. The request must include a valid module name, an Authorization header with a valid authkey, and a file with the new logo. If no file is provided, the default logo is restored. The logo is resized and converted to webp format before being saved. On success, it returns a message indicating that the logo was updated, along with an authkey.
283+
284+
Endpoint: https://nostrcheck.me/api/v2/admin/updatelogo
285+
286+
**Headers**
287+
288+
- `Content-Type`: multipart/form-data
289+
- `Authorization`: Bearer {authkey}
290+
291+
**Parameters**
292+
293+
- `file`: The new logo file.
294+
295+
**Example Request**
296+
297+
```json
298+
{
299+
"method": "POST",
300+
"url": "https://nostrcheck.me/api/v2/admin/updatelogo",
301+
"headers": {
302+
"Content-Type": "multipart/form-data",
303+
"Authorization "Bearer Auth37f3352fe10584d7396f010eb501482930dd712f"
304+
},
305+
"body": {
306+
"file": "logo_file"
307+
}
308+
}
309+
```
310+
311+
**Example Response**
312+
313+
```json
314+
{
315+
"status": "success",
316+
"message": "Logo updated",
317+
"authkey": "auth_key"
318+
}
319+
```
320+
### Domains
194321

195322
### domains [GET]
196-
Return available domains on the server
323+
This method retrieves a list of available domains in the application. The request must include a valid module name and an Authorization header with a valid authkey. On success, it returns a list of available domains and an authkey.
197324

198-
https://nostrcheck.me/api/v2/domains
325+
This endpoint also can use the [NIP98](https://github.com/nostr-protocol/nips/blob/master/98.md) HTTP Auth for getting the user's authkey. The NIP98's pubkey must have the "allowed" field with "1" on registered database.
199326

200-
This endpoint use the [NIP98](https://github.com/nostr-protocol/nips/blob/master/98.md) HTTP Auth for getting the available domains. The NIP98's pubkey must have the "allowed" field with "1" on registered database.
327+
Endpoint: https://nostrcheck.me/api/v2/domains
201328

202-
**Example**
329+
**Headers**
330+
331+
- `Content-Type`: application/json
332+
- `Authorization`: Bearer {authkey}
333+
334+
**Example Request**
335+
336+
With authkey
337+
```json
338+
{
339+
"method": "GET",
340+
"url": "https://nostrcheck.me/api/v2/domains/",
341+
"headers": {
342+
"Content-Type": "application/json",
343+
"Authorization "Bearer Auth37f3352fe10584d7396f010eb501482930dd712f"
344+
}
345+
}
203346
```
347+
348+
With NIP98
349+
```json
204350
{
205-
"domains": [
206-
{
207-
"domain": "nostrcheck.me"
208-
},
209-
{
210-
"domain": "nostr-check.me"
211-
},
212-
{
213-
"domain": "nostriches.club"
214-
},
215-
{
216-
"domain": "plebchain.club"
217-
}
218-
]
351+
"method": "GET",
352+
"url": "https://nostrcheck.me/api/v2/domains/",
353+
"headers": {
354+
"Content-Type": "application/json",
355+
"Authorization "Nostr ewogICJpZCI6ICI5MzMxMDUyY2FlYzQzNTE4NDRlMzM4YTgyZDhmMGRhNzEzZmVkNDk1ODViN2ZjNTVkMDg5MWVlOWZiMDYyYTJjIiwKICAicHVia2V5IjogIjgyMDhmYWNkY2FiMjk4NzgyYzllM2I3YjllZmIyMmJjMjQ2ZDE1NzcwZTBiNGY5NmJiZTUxYzQwNjViODJhZjAiLAogICJjcmVhdGVkX2F0IjogMTcwOTExNDEwNywKICAia2luZCI6IDI3MjM1LAogICJ0YWdzIjogWwogICAgWwogICAgICAibWV0aG9kIiwKICAgICAgIkdFVCIKICAgIF0sCiAgICBbCiAgICAgICJ1IiwKICAgICAgImh0dHBzOi8vbm9zdHJjaGVjay5tZS9hcGkvdjIvZG9tYWlucyIKICAgIF0KICBdLAogICJjb250ZW50IjogIiIsCiAgInNpZyI6ICI3ZDYyMzk1OGZhMjY5ZTY2NzhlYmZlOGVhN2JlOTlhMzgxNDlhYTc2NTdmZjJlZTVlYmM0ODYyNWFlODY3M2Y4Yjk0ZDM2YWUxMTAyOGVhOWU0MzNjZWY3ZmZhNWEwZDcxYjIyYzI0OGMyNDA5M2NkNGFmMjBmYjVjM2Y5MGE0MiIKfQ"
356+
}
357+
}
358+
```
359+
360+
**Example Response**
361+
362+
```json
363+
{
364+
"AvailableDomains": ["domain1.com", "domain2.com"],
365+
"authkey": "auth_key"
219366
}
220367
```
221368

369+
222370
### users [GET]
223371
Return available users from a domain registerd on the server
224372

0 commit comments

Comments
 (0)