Versions
A version belongs to a download. It groups one or more files under a release label (version_string). Routes mount at /api/mc-dm-versions/.
List versions
GET /api/mc-dm-versions/
Scope: mc_dm_download:read.
Parent filter: download_id is required for non-super-user keys. Without it the request fails HTTP 400 with code mc_dm_api_error.parent_filter_required.
| Param | Type | Notes |
|---|---|---|
download_id | uint | Required for user keys. Optional for super-user keys. |
since | ISO 8601 | Filters by release_date. |
Order whitelist: release_date, version_int, download_count. Default release_date desc.
Example
curl -H "XF-Api-Key: $KEY" \
"https://example.com/api/mc-dm-versions/?download_id=42&order=release_date"
Response
{
"versions": [
{
"version_id": 88,
"download_id": 42,
"version_string": "1.4.0",
"version_int": 1004000000,
"release_notes": "...",
"changelog": "* Fixed crash on import.",
"release_date": 1746200000,
"is_published": true,
"file_count": 2,
"download_count": 31,
"display_title": "Acme Importer 1.4.0",
"primary_file_id": 200
}
],
"pagination": { "page": 1, "per_page": 20, "total": 14, "last_page": 1 }
}
Get a single version
GET /api/mc-dm-versions/<version_id>/
Scope: mc_dm_download:read.
Permission: the visitor must pass canView on the parent download.
Response: { "version": { ... } }.
Create a version
POST /api/mc-dm-versions/
Scope: mc_dm_download:write.
Permission: canPostVersion on the parent download.
| Field | Type | Notes |
|---|---|---|
download_id | uint | Required. |
version_string | string | Required (e.g. 1.4.0). |
release_notes | string | Optional. |
changelog | string | Optional. |
title | string | Optional override of the default display title. |
Example
curl -X POST -H "XF-Api-Key: $KEY" \
-d "download_id=42" \
-d "version_string=1.5.0" \
-d "changelog=* Adds JSON export." \
https://example.com/api/mc-dm-versions/
Response: { "version": { ... } }.
Files are not uploaded with this call. Add files via POST /api/mc-dm-files/. See the Files reference.
Update a version
PUT /api/mc-dm-versions/<version_id>/
Scope: mc_dm_download:write.
Permission: canEdit on the version.
| Field | Type |
|---|---|
title | string |
version_string | string |
release_notes | string |
changelog | string |
Omitted fields are untouched.
curl -X PUT -H "XF-Api-Key: $KEY" \
-d "changelog=* Hotfix release." \
https://example.com/api/mc-dm-versions/88/
Response: { "version": { ... } }.
Delete a version
DELETE /api/mc-dm-versions/<version_id>/
Scope: mc_dm_download:write always. mc_dm_download:delete_hard additionally when hard=1.
Permission: canDelete('soft') or canDelete('hard') depending on the hard flag.
| Param | Effect |
|---|---|
hard | 1 = hard delete (irreversible). Default 0 = soft delete. |
reason | Optional string written to the audit log. |
curl -X DELETE -H "XF-Api-Key: $KEY" \
https://example.com/api/mc-dm-versions/88/
Response: { "success": true }.
Verbose mode (?with=full)
Adds:
| Field | Type | Notes |
|---|---|---|
can_view | bool | Visitor permission. |
can_edit | bool | Visitor permission. |
is_visible | bool | |
Files | array | Embedded file results at normal verbosity, in display_order. |