Repository for https://mods.vintagestory.at
Request: Normal GET requests
Response: Json. Every response contains a statuscode property which uses HTTP Error Codes to denote success/failure of a request.
Api base url http://mods.vintagestory.at/api
Api v2 base url - currently still in development http://mods.vintagestory.at/api/v2
< 8000 p dir="auto">List all mod tags
Example: http://mods.vintagestory.at/api/tags
List all game version tags
Example: http://mods.vintagestory.at/api/gameversions
List all authors (users)
Example: http://mods.vintagestory.at/api/authors
Lists all comments for given assetid or latest 100 if assetid is not specified
Example: http://mods.vintagestory.at/api/comments
List all mods
Example: http://mods.vintagestory.at/api/mods
Get Parameters:
tagids[]: Filter by tag id (AND)
gameversion or gv: Filter by game version id
gameversions[]: Filter by game version ids (OR)
author: Filter by author id
text: Search by mod text and title
orderby: Order by, one of: 'asset.created', 'lastreleased', 'downloads', 'follows', 'comments', 'trendingpoints'
(default: asset.created)
orderdirection: Order direction, one of: 'desc', 'asc'
(default: desc)
Search Example: http://mods.vintagestory.at/api/mods?text=jack&tagids[]=7&tagids[]=8&orderby=downloads
List all info for given mod. Modid can be either the numbered id as retrieved by the mod list interface or the modid string from the modinfo.json
Example: http://mods.vintagestory.at/api/mod/6
String example: http://mods.vintagestory.at/api/mod/carrycapacity
get
:- Args:
- Path arg
{search}
limit
: Optional result count limit between 1 and 200 inclusive. Defaults to 10.
- Path arg
200
: string - string dictionary, where keys are user hashes and values are usernames.
- Args:
Endpoints marked as auth
require authentication and response with 401
if it is missing.
Endpoints marked as at
additionally require a valid actiontoken and response with 400
if it is missing. The token can be provided as a query parameter or in the POST body.
get
: Path arg{modid}
404
: Not implemented.
put
:auth
at
- Args:
- Path arg
{modid}
- Request body: Desired comment html.
- Path arg
400
: Invalid action token or malformed request404
: Target mod does not exist.403
: Active user is currently restricted.200
: Comment got created. Returns the processed html of the newly created comment as the response body, and the link to the comment in the Location header.
- Args:
-
post
:- Args:
- Path arg
{commentid}
- Request body: Desired comment html.
- Path arg
400
: Invalid action token or malformed request404
: Target comment does not exist.403
: Active user is currently restricted or does not have permissions to edit the comment.200
: Comment got updated. Returns the processed comment html as a object{html: string}
.
- Args:
-
delete
: Path arg{commentid}
400
: Invalid action token or malformed request404
: Target comment does not exist.403
: Active user is currently restricted or does not have permissions to delete the comment.200
: Comment got deleted.
get
: No args.200
: Array of notification ids for the current user. May be empty.
get
: Path arg{id}
404
: Not implemented.
get
: No args.404
: Not implemented.
post
:- Args:
ids
: Comma separated list of integers (takes priority). orids[]
: formurlencoded ids.
400
: No ids provided or argument malformed.403
: List of ids contains notifications that do not belong to the current user.200
: Notifications were marked as read if they exist.
- Args:
post
:- Args:
- Path arg
{id}
specifies the target mod id. Specifying an id that is not already followed will follow that mod with specified settings. new
: Integer value specifying the new settings.1 << 0
: Should receive notifications when this mod is updated.
- Path arg
400
: No new value provided or argument is malformed.200
: Successfully updated settings.
- Args:
post
: Path arg{id}
specifies the target mod id.400
: Argument is malformed.200
: Successfully unfollowed if mod was followed.
You can use the provided vscode devcontainer to get up a running without installing everything on your own.
Required for that is docker installed aswell as docker-compose and vscode with the Remote-Containers extension. Then you can open the devcontainer.json in vscode, and it should prompt you
Folder contains a Dev Container configuration file. Reopen folder to develop in a container ([learn more](https://aka.ms/vscode-remote/docker)).
Simply click reopen in container, and it should start building the devcontainer and starting the mysql database aswell.
Now edit the config.php to match the settings in the dockerdocker-compose.yml for the db MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD
and add 127.0.0.1 stage.mods.vintagestory.at
to your hosts file on your local machine.
To deploy the database to the mysql instance run the tables.sql script against the database. You can use MySQL WOrkbench or any other mysql tool. When connecting from your local machine use localhost and 3306 (default) port to connect.
There is also a optional MySQL Workbench container that when enabled in the dockerdocker-compose.yml can be reached at http://localhost:4444/. To connect to the mysql database from workbench container use db
for the hostname.
Requirements:
Steps:
- add
127.0.0.1 stage.mods.vintagestory.at
to your hosts file - run
docker compose up -d
inside docker/ - edit config.php to match the settings in dockerdocker-compose.yml
Result:
- http://stage.mods.vintagestory.at/
- Adminer instance
- mysql 3306 is exposed
Note: the mysql container is set up to automatically execute the provided DB structure + sample data.
Note: in staging environments oyu can append ?showas=<id>
to any url to load the page the user with that id. This can be used debugging and testing role related features.