mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-14 03:23:46 +01:00
2.0 KiB
2.0 KiB
title: API
Authentication
Not all endpoints require authentication. Authentication is done using Bearer tokens:
Authorization: Bearer YOURTOKEN
You can use the /api/whoami
to check authentication.
Endpoints
Misc
- GET
/api/whoami/
- Json dictionary with the following keys:is_authenticated
- True on successful API authenticationusername
- Username of the user authenticated as, null otherwise.- 403 will be thrown on unsupported authentication type, invalid access token, or other errors.
Packages
- GET
/api/packages/
- See Package Queries - GET
/api/packages/<username>/<name>/
Releases
- GET
/api/packages/<username>/<name>/releases/
- POST
/api/packages/<username>/<name>/releases/new/
- Requires authentication.
title
: human-readable name of the release.method
: Release-creation method, onlygit
is supported.min_protocol
: (Optional) minimum Minetest protocol version. See Minetest.min_protocol
: (Optional) maximum Minetest protocol version. See Minetest.- If
git
release-creation method:ref
- git reference, eg:master
.
Topics
- GET
/api/topics/
- Supports Package Queries, and the following two options:show_added
- Show topics which exist as packages, default true.show_discarded
- Show topics which have been marked as outdated, default false.
Minetest
- GET
/api/minetest_versions/
Package Queries
Example:
/api/packages/?type=mod&type=game&q=mobs+fun&hide=nonfree&hide=gore
Supported query parameters:
type
- Package types (mod
,game
,txp
).q
- Query stringrandom
- When present, enable random ordering and ignoresort
.hide
- Hide content based on Content Flags.sort
- Sort by (name
,views
,date
,score
).order
- Sort ascending (Asc
) or descending (desc
).protocol_version
- Only show packages supported by this Minetest protocol version.