From 78df23786dfc1df86c59857aa41bad8e4285ce92 Mon Sep 17 00:00:00 2001 From: zanderwar Date: Fri, 28 Jul 2023 01:58:40 +0000 Subject: [PATCH] Auto-updated by master commit to modio-restapi Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- source/index.html.md | 7807 +++++++++++++++++++++--------------------- 1 file changed, 3978 insertions(+), 3829 deletions(-) diff --git a/source/index.html.md b/source/index.html.md index 5932578..a1465ac 100644 --- a/source/index.html.md +++ b/source/index.html.md @@ -3378,21 +3378,21 @@ Status|Meaning|Error Ref|Description|Response Schema To perform this request, you must be authenticated via one of the following methods: api_key, OAuth 2 (Scopes: read) -# Mods +# Guides -## Get Mods +## Get Guides > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -3406,7 +3406,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods', + url: 'https://*.modapi.io/v1/games/{game-id}/guides', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -3424,7 +3424,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey', { method: 'GET', @@ -3443,7 +3443,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -3451,7 +3451,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -3466,36 +3466,25 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods` +`GET /games/{game-id}/guides` -Get all mods for the corresponding game. Successful request will return an array of [Mod Objects](#get-mods-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Get all guides for a game. Successful request will return an array of [Guide Objects](#get-guides). Filter|Type|Description ---|---|--- - id|integer|Unique id of the mod. + id|integer|Unique id of the guide. game_id|integer|Unique id of the parent game. - status|integer|Status of the mod (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted
__1__ = Accepted _(default)_
__3__ = Deleted - visible|integer|Visibility of the mod (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Hidden
__1__ = Public _(default)_ - submitted_by|integer|Unique id of the user who has ownership of the mod. - date_added|integer|Unix timestamp of date mod was registered. - date_updated|integer|Unix timestamp of date mod was updated. - date_live|integer|Unix timestamp of date mod was set live. - maturity_option|integer|Maturity option(s) set by the mod creator:

__0__ = None
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) - monetisation_options|integer|Monetisation option(s) enabled by the mod creator:

__0__ = None
__1__ = Enabled
__2__ = Marketplace On
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) - name|string|Name of the mod. - name_id|string|Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__ - modfile|integer|Unique id of the file that is the current active release (see [mod files](#files)). - metadata_blob|string|Metadata stored by the game developer. - metadata_kvp|string|Colon-separated values representing the key-value pairs you want to filter the results by. If you supply more than one key-pair, separate the pairs by a comma. Will only filter by an exact key-pair match. - tags|string|Comma-separated values representing the tags you want to filter the results by. If you specify multiple tags, only mods which have all tags will be returned, and only tags that are supported by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). If you want to ensure mods returned do not contain particular tag(s), you can use the `tags-not-in` filter either independently or alongside this filter. - platform_status|string|If the parent game has enabled per-platform files, by default only mods with files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To QA mods with pending files, you can filter results by their current platform status, using `pending_only` or `live_and_pending`.

__NOTE:__ only game admins can filter by this field. + status|integer|Status of the guide (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted
__1__ = Accepted _(default)_ + date_added|integer|Unix timestamp of date guide was registered. + date_updated|integer|Unix timestamp of date guide was updated. + date_live|integer|Unix timestamp of date guide was set live. + name_id|string|Path for the guide on mod.io. For example: https://mod.io/g/gamename/r/__guide-name-id-here__ + tags|string|Comma-separated values representing the tags you want to filter the results by. If you specify multiple tags, only guides which have all tags will be returned. Sort|Description ---|--- - downloads|Sort results by most downloads using [_sort filter](#filtering) parameter, value should be `downloads` for descending or `-downloads` for ascending results. popular|Sort results by popularity using [_sort filter](#filtering), value should be `popular` for descending or `-popular` for ascending results.

__NOTE:__ Popularity is calculated hourly and reset daily (results are ranked from 1 to X). You should sort this column in ascending order `-popular` to get the top ranked results. - rating|Sort results by weighted rating using [_sort filter](#filtering), value should be `rating` for descending or `-rating` for ascending results. - subscribers|Sort results by most subscribers using [_sort filter](#filtering), value should be `subscribers` for descending or `-subscribers` for ascending results. + popular_overall|Sort results by 'Popular Overall' using [_sort filter](#filtering), value should be `popular_overall` for descending or `-popular_overall` for ascending results.

__NOTE:__ You should sort this column in ascending order `-popular_overall` to get the top ranked results. This filter differs from popular by filtering on the amount of visits it has received overall, and not just in the last 24 hours. > Example response @@ -3503,11 +3492,17 @@ Get all mods for the corresponding game. Successful request will return an array { "data": [ { - "id": 2, - "game_id": 2, - "status": 1, - "visible": 1, - "submitted_by": { + "id": 1209, + "game_id": 3, + "game_name": "My Awesome Game", + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "user": { "id": 1, "name_id": "xant", "username": "XanT", @@ -3524,106 +3519,29 @@ Get all mods for the corresponding game. Successful request will return an array "language": "", "profile_url": "https://mod.io/u/xant" }, - "date_added": 1492564103, - "date_updated": 1499841487, - "date_live": 1499841403, - "maturity_option": 0, - "community_options": 3, - "monetisation_options": 0, - "price": 0, - "tax": 0, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "homepage_url": "https://www.rogue-hdpack.com/", - "name": "Rogue Knight HD Pack", - "name_id": "rogue-knight-hd-pack", - "summary": "It's time to bask in the glory of beautiful 4k textures!", - "description": "

Rogue HD Pack does exactly what you thi...", - "description_plaintext": "Rogue HD Pack does exactly what you thi...", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", - "media": { - "youtube": [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ], - "sketchfab": [ - "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" - ], - "images": [ - { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - } - ] - }, - "modfile": { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] - }, - "platforms": [ - { - "platform": "windows", - "modfile_live": 1 - } - ], - "metadata_kvp": [ + "date_added": 1509922961, + "date_updated": 1509922961, + "date_live": 1509922961, + "status": 1, + "url": "https://mod.io/g/rogue-knight/r/getting-started", + "name": "Getting Started", + "name_id": "getting-started", + "summary": "Alright, so let's get started with modding on mod.io", + "description": "

Getting Started

Download this suspiciou....", + "tags": [ { - "metakey": "pistol-dmg", - "metavalue": "800" + "name": "Instructions", + "date_added": 1499841487, + "count": 22 } ], - "tags": [ + "stats": [ { - "name": "Unity", - "date_added": 1499841487 + "guide_id": 2, + "visits_total": 0, + "comments_total": 0 } - ], - "stats": { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 - } + ] }, { ... @@ -3636,33 +3554,28 @@ Get all mods for the corresponding game. Successful request will return an array } ``` -

Cross-Platform Filtering

- -If the parent game has platform filtering enabled, this endpoint supports the [targeting a platform](#targeting-a-platform) request header to return mods that have been approved for the requested platform. If you are a member of the parent game team, please see the `platform_status` filter for this endpoint above on how you can retrieve pending mods. - -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mods](#schemaget_mods) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15025|The authenticated user has applied an admin-only filter or value to the request, and is not an administrator for this game.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Guides](#schemaget_guides) -## Get Mod +## Get Guide > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -3676,7 +3589,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -3694,7 +3607,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiKey', { method: 'GET', @@ -3713,7 +3626,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -3721,7 +3634,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -3736,19 +3649,25 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}` +`GET /games/{game-id}/guides/{guide-id}` -Get a mod. Successful request will return a single [Mod Object](#mod-object). +Get a guide. Successful request will return a single [Guide Object](#guide-object). > Example response ```json { - "id": 2, - "game_id": 2, - "status": 1, - "visible": 1, - "submitted_by": { + "id": 1209, + "game_id": 3, + "game_name": "My Awesome Game", + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "user": { "id": 1, "name_id": "xant", "username": "XanT", @@ -3765,148 +3684,67 @@ Get a mod. Successful request will return a single [Mod Object](#mod-object). "language": "", "profile_url": "https://mod.io/u/xant" }, - "date_added": 1492564103, - "date_updated": 1499841487, - "date_live": 1499841403, - "maturity_option": 0, - "community_options": 3, - "monetisation_options": 0, - "price": 0, - "tax": 0, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "homepage_url": "https://www.rogue-hdpack.com/", - "name": "Rogue Knight HD Pack", - "name_id": "rogue-knight-hd-pack", - "summary": "It's time to bask in the glory of beautiful 4k textures!", - "description": "

Rogue HD Pack does exactly what you thi...", - "description_plaintext": "Rogue HD Pack does exactly what you thi...", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", - "media": { - "youtube": [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ], - "sketchfab": [ - "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" - ], - "images": [ - { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - } - ] - }, - "modfile": { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] - }, - "platforms": [ - { - "platform": "windows", - "modfile_live": 1 - } - ], - "metadata_kvp": [ + "date_added": 1509922961, + "date_updated": 1509922961, + "date_live": 1509922961, + "status": 1, + "url": "https://mod.io/g/rogue-knight/r/getting-started", + "name": "Getting Started", + "name_id": "getting-started", + "summary": "Alright, so let's get started with modding on mod.io", + "description": "

Getting Started

Download this suspiciou....", + "tags": [ { - "metakey": "pistol-dmg", - "metavalue": "800" + "name": "Instructions", + "date_added": 1499841487, + "count": 22 } ], - "tags": [ + "stats": [ { - "name": "Unity", - "date_added": 1499841487 + "guide_id": 2, + "visits_total": 0, + "comments_total": 0 } - ], - "stats": { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 - } + ] } ``` -

Cross-Platform Filtering

- -If the parent game has platform filtering enabled, this endpoint supports the [targeting a platform](#targeting-a-platform) request header to return the [modfile](#modfile-object) within the [Mod Object](#mod-object) for the requested platform. If the request targets a platform that is invalid, the `modfile` field will be `null`. - -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Mod Object](#schemamod_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Guide Object](#schemaguide_object) -## Add Mod +## Add Guide > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/guides \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: multipart/form-data' \ + -H 'Content-Type: multipart/form-data' \ -H 'Accept: application/json' \ - -F 'name=Graphics Overhaul Mod' \ - -F 'name_id=graphics-overhaul-mod' \ + -F 'name=Modding Guide for Rogue Knight' \ -F 'summary=Short descriptive summary here' \ -F 'description=

Getting started with..' \ -F 'logo=@/path/to/image.jpg' \ - -F 'homepage_url=https://www.example.com' \ - -F 'tags[]=easy' + -F 'date_live=1626667557' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/guides HTTP/1.1 Host: *.modapi.io Content-Type: multipart/form-data Accept: application/json Authorization: Bearer {access-token} +Content-Type: multipart/form-data ``` @@ -3914,12 +3752,13 @@ Authorization: Bearer {access-token} var headers = { 'Authorization':'Bearer {access-token}', 'Content-Type':'multipart/form-data', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods', + url: 'https://*.modapi.io/v1/games/{game-id}/guides', method: 'post', headers: headers, @@ -3932,22 +3771,21 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "name": "Graphics Overhaul Mod", - "name_id": "graphics-overhaul-mod", + "name": "Modding Guide for Rogue Knight", "summary": "Short descriptive summary here", "description": "

Getting started with..", "logo": "@/path/to/image.jpg", - "homepage_url": "https://www.example.com", - "tags": "easy" + "date_live": 1626667557 }'; const headers = { 'Authorization':'Bearer {access-token}', 'Content-Type':'multipart/form-data', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods', +fetch('https://*.modapi.io/v1/games/{game-id}/guides', { method: 'POST', body: inputBody, @@ -3965,10 +3803,11 @@ import requests headers = { 'Authorization': 'Bearer {access-token}', 'Content-Type': 'multipart/form-data', + 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/guides', params={ }, headers = headers) @@ -3976,7 +3815,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -3991,36 +3830,36 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods` - -Add a mod. Successful request will return the newly created [Mod Object](#mod-object). All content published by users on [mod.io](https://mod.io) is subject to the [Terms of Use](https://mod.io/terms/widget). It is a requirement that you provide a link to [https://mod.io/terms](https://mod.io/terms) in any place where users are submitting content to mod.io. +`POST /games/{game-id}/guides` - __NOTE:__ By default new mods are 'not accepted' and 'public'. They can only be 'accepted' and made available via the API once a [Mod File](#add-modfile) has been uploaded. [Media](#add-mod-media), [Metadata Key Value Pairs](#add-mod-kvp-metadata) and [Dependencies](#add-mod-dependencies) can also be added after a mod profile is created. +Add a guide for a game. Successful request will return a single [Guide Object](#guide-object). Parameter|Type|Required|Description ---|---|---|---| - logo|file|true|Image file which will represent your mods logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this image to make three thumbnails for the dimensions 320x180, 640x360 and 1280x720. - name|string|true|Name of your mod. - name_id|string||Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__. If no `name_id` is specified the `name` will be used. For example: _'Stellaris Shader Mod'_ will become _'stellaris-shader-mod'_. Cannot exceed 80 characters. - summary|string|true|Summary for your mod, giving a brief overview of what it's about. Cannot exceed 250 characters. - visible|integer||Visibility of the mod (best if this field is controlled by mod admins, see [status and visibility](#status-amp-visibility) for details):

__0__ = Hidden
__1__ = Public _(default)_ - description|string||Detailed description for your mod, which can include details such as 'About', 'Features', 'Install Instructions', 'FAQ', etc. HTML supported and encouraged. - homepage_url|string||Official homepage for your mod. Must be a valid URL. - stock|integer||Maximium number of subscribers for this mod. A value of 0 disables this limit. - maturity_option|integer||Choose if this mod contains any of the following mature content.

__NOTE:__ The value of this field will default to 0 unless the parent game allows you to flag mature content (see `maturity_options` field in [Game Object](#game-object)).

__0__ = None _(default)_
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple options (see [BITWISE fields](#bitwise-and-bitwise-and)) - community_options|integer||Community features enabled for this mod:

__0__ = All of the options below are disabled
__1__ = Enable comments _(default)_
__?__ = Add the options you want together, to enable multiple options (see [BITWISE fields](#bitwise-and-bitwise-and)) - metadata_blob|string||Metadata stored by the game developer which may include properties as to how the item works, or other information you need to display. Metadata can also be stored as searchable [key value pairs](#metadata), and to individual [mod files](#get-modfiles). - tags[]|string||Tags to apply to the mod. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2). Only the tags pre-defined by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). + logo|file|true|Image file which will represent your guides logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this image to make three thumbnails for the dimensions 320x180, 640x360 and 1280x720. + name|string|true|Name of your guide. + name_id|string||Path for the guide on mod.io. For example: https://mod.io/g/gamename/r/__guide-name-id-here__. If no `name_id` is specified the `name` will be used. For example: _'Stellaris Shader Guide'_ will become _'stellaris-shader-guide'_. Cannot exceed 80 characters. + summary|string|true|Summary for your guide, giving a brief overview of what it's about. Cannot exceed 250 characters. + description|string||Detailed description for your guide, which can include details such as 'About', 'Features', 'Install Instructions', 'FAQ', etc. HTML supported and encouraged. + url|string||Official homepage for your guide. Must be a valid URL. + tags[]|string||Tags to apply to the guide. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2). + date_live|integer||Unix timestamp of when this guide should go live. To release the guide immediately provide the current time along with the `status` value of 1. If this field is not provided and the `status` is 0, the guide will not be released. > Example response ```json { - "id": 2, - "game_id": 2, - "status": 1, - "visible": 1, - "submitted_by": { + "id": 1209, + "game_id": 3, + "game_name": "My Awesome Game", + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "user": { "id": 1, "name_id": "xant", "username": "XanT", @@ -4037,147 +3876,63 @@ Add a mod. Successful request will return the newly created [Mod Object](#mod-ob "language": "", "profile_url": "https://mod.io/u/xant" }, - "date_added": 1492564103, - "date_updated": 1499841487, - "date_live": 1499841403, - "maturity_option": 0, - "community_options": 3, - "monetisation_options": 0, - "price": 0, - "tax": 0, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "homepage_url": "https://www.rogue-hdpack.com/", - "name": "Rogue Knight HD Pack", - "name_id": "rogue-knight-hd-pack", - "summary": "It's time to bask in the glory of beautiful 4k textures!", - "description": "

Rogue HD Pack does exactly what you thi...", - "description_plaintext": "Rogue HD Pack does exactly what you thi...", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", - "media": { - "youtube": [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ], - "sketchfab": [ - "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" - ], - "images": [ - { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - } - ] - }, - "modfile": { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] - }, - "platforms": [ - { - "platform": "windows", - "modfile_live": 1 - } - ], - "metadata_kvp": [ + "date_added": 1509922961, + "date_updated": 1509922961, + "date_live": 1509922961, + "status": 1, + "url": "https://mod.io/g/rogue-knight/r/getting-started", + "name": "Getting Started", + "name_id": "getting-started", + "summary": "Alright, so let's get started with modding on mod.io", + "description": "

Getting Started

Download this suspiciou....", + "tags": [ { - "metakey": "pistol-dmg", - "metavalue": "800" + "name": "Instructions", + "date_added": 1499841487, + "count": 22 } ], - "tags": [ + "stats": [ { - "name": "Unity", - "date_added": 1499841487 + "guide_id": 2, + "visits_total": 0, + "comments_total": 0 } - ], - "stats": { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 - } + ] } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Mod Object](#schemamod_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) -### Response Headers - -Status|Header|Type|Format|Description ----|---|---|---|---| -201|Location|string||URL to newly created resource - +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Guide Object](#schemaguide_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14027|The authenticated user does not have permission to add guides to this game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) -## Edit Mod +## Edit Guide > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id} \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: multipart/form-data' \ -H 'Content-Type: multipart/form-data' \ -H 'Accept: application/json' \ - -F 'name=Graphics Overhaul Mod' \ - -F 'name_id=graphics-overhaul-mod' \ + -F 'name=Modding Guide for Rogue Knight' \ -F 'summary=Short descriptive summary here' \ -F 'description=

Getting started with..' \ -F 'logo=@/path/to/image.jpg' \ - -F 'homepage_url=https://www.example.com' + -F 'date_live=1626667557' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id} HTTP/1.1 Host: *.modapi.io Content-Type: multipart/form-data Accept: application/json @@ -4196,7 +3951,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', method: 'post', headers: headers, @@ -4209,12 +3964,11 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "name": "Graphics Overhaul Mod", - "name_id": "graphics-overhaul-mod", + "name": "Modding Guide for Rogue Knight", "summary": "Short descriptive summary here", "description": "

Getting started with..", "logo": "@/path/to/image.jpg", - "homepage_url": "https://www.example.com" + "date_live": 1626667557 }'; const headers = { 'Authorization':'Bearer {access-token}', @@ -4224,7 +3978,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', { method: 'POST', body: inputBody, @@ -4246,7 +4000,7 @@ headers = { 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', params={ }, headers = headers) @@ -4254,7 +4008,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -4269,34 +4023,37 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}` +`POST /games/{game-id}/guides/{guide-id}` -Edit details for a mod. If you want to update the `logo` or media associated with this mod, you need to use the [Add Mod Media](#add-mod-media) endpoint. The same applies to [Mod Files](#add-modfile), [Metadata Key Value Pairs](#add-mod-kvp-metadata) and [Dependencies](#add-mod-dependencies) which are all managed via other endpoints. Successful request will return the updated [Mod Object](#mod-object). +Update an existing guide. Successful request will return the updated [Guide Object](#guide-object). Parameter|Type|Required|Description ---|---|---|---| - logo|file|true|Image file which will represent your mods logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this image to make three thumbnails for the dimensions 320x180, 640x360 and 1280x720. - status|integer||Status of a mod. The mod must have at least one uploaded `modfile` to be 'accepted' (best if this field is controlled by game admins, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted
__1__ = Accepted (game admins only)
__3__ = Deleted (use the [delete mod](#delete-mod) endpoint to set this status) - visible|integer||Visibility of the mod (best if this field is controlled by mod admins, see [status and visibility](#status-amp-visibility) for details):

__0__ = Hidden
__1__ = Public - name|string||Name of your mod. Cannot exceed 50 characters. - name_id|string||Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__. Cannot exceed 80 characters. - summary|string||Summary for your mod, giving a brief overview of what it's about. Cannot exceed 250 characters. - description|string||Detailed description for your mod, which can include details such as 'About', 'Features', 'Install Instructions', 'FAQ', etc. HTML supported and encouraged. - homepage_url|string||Official homepage for your mod. Must be a valid URL. - stock|integer||Maximium number of subscribers for this mod. A value of 0 disables this limit. - maturity_option|integer||Choose if this mod contains any of the following mature content.

__NOTE:__ The value of this field will default to 0 unless the parent game allows you to flag mature content (see `maturity_options` field in [Game Object](#game-object)).

__0__ = None set
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple options (see [BITWISE fields](#bitwise-and-bitwise-and)) - community_options|integer||Community features enabled for this mod:

__0__ = All of the options below are disabled
__1__ = Enable comments
_64_ = Enable previews
__?__ = Add the options you want together, to enable multiple options (see [BITWISE fields](#bitwise-and-bitwise-and)) - metadata_blob|string||Metadata stored by the game developer which may include properties as to how the item works, or other information you need to display. Metadata can also be stored as searchable [key value pairs](#metadata), and to individual [mod files](#get-modfiles). + status|integer||Status of the guide, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted
__1__ = Accepted (game admins only)
__3__ = Deleted (use the [delete guide](#delete-guide) endpoint to set this status) + logo|file||Image file which will represent your guides logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this image to make three thumbnails for the dimensions 320x180, 640x360 and 1280x720. + name|string||Name of your guide. + name_id|string||Path for the guide on mod.io. For example: https://mod.io/g/gamename/r/__guide-name-id-here__. If no `name_id` is specified the `name` will be used. For example: _'Stellaris Shader Guide'_ will become _'stellaris-shader-guide'_. Cannot exceed 80 characters. + summary|string||Summary for your guide, giving a brief overview of what it's about. Cannot exceed 250 characters. + description|string||Detailed description for your guide, which can include details such as 'About', 'Features', 'Install Instructions', 'FAQ', etc. HTML supported and encouraged. + url|string||Official homepage for your guide. Must be a valid URL. + tags[]|string||Tags to apply to the guide. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2).

__NOTE:__ When editing a guide any tags you add or remove from the existing tags list will be added/removed, so if you do not wish to remove any tags you must re-submit all existing tags. + date_live|integer||Unix timestamp of when this guide should go live. To release the guide immediately provide the current time along with the `status` 1. If this field is not provided and the `status` is 0, the guide will not be released. > Example response ```json { - "id": 2, - "game_id": 2, - "status": 1, - "visible": 1, - "submitted_by": { + "id": 1209, + "game_id": 3, + "game_name": "My Awesome Game", + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "user": { "id": 1, "name_id": "xant", "username": "XanT", @@ -4313,130 +4070,50 @@ Edit details for a mod. If you want to update the `logo` or media associated wit "language": "", "profile_url": "https://mod.io/u/xant" }, - "date_added": 1492564103, - "date_updated": 1499841487, - "date_live": 1499841403, - "maturity_option": 0, - "community_options": 3, - "monetisation_options": 0, - "price": 0, - "tax": 0, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "homepage_url": "https://www.rogue-hdpack.com/", - "name": "Rogue Knight HD Pack", - "name_id": "rogue-knight-hd-pack", - "summary": "It's time to bask in the glory of beautiful 4k textures!", - "description": "

Rogue HD Pack does exactly what you thi...", - "description_plaintext": "Rogue HD Pack does exactly what you thi...", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", - "media": { - "youtube": [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ], - "sketchfab": [ - "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" - ], - "images": [ - { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - } - ] - }, - "modfile": { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] - }, - "platforms": [ - { - "platform": "windows", - "modfile_live": 1 - } - ], - "metadata_kvp": [ + "date_added": 1509922961, + "date_updated": 1509922961, + "date_live": 1509922961, + "status": 1, + "url": "https://mod.io/g/rogue-knight/r/getting-started", + "name": "Getting Started", + "name_id": "getting-started", + "summary": "Alright, so let's get started with modding on mod.io", + "description": "

Getting Started

Download this suspiciou....", + "tags": [ { - "metakey": "pistol-dmg", - "metavalue": "800" + "name": "Instructions", + "date_added": 1499841487, + "count": 22 } ], - "tags": [ + "stats": [ { - "name": "Unity", - "date_added": 1499841487 + "guide_id": 2, + "visits_total": 0, + "comments_total": 0 } - ], - "stats": { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 - } + ] } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Update Successful|[Mod Object](#schemamod_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15013|The authenticated user does not have permission to update this mod. Ensure the user is part of the mod team before attempting the request again.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15033|The authenticated user does not have permission to update the metadata for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15014|The authenticated user does not have permission to update the maturity options for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15015|The authenticated user does not have permission to update the status for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15016|A mod cannot be set live without an associated modfile.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||OK|[Guide Object](#schemaguide_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14036|The authenticated user does not have permission to edit guides to this game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14031|The guide status cannot be changed to accepted due to the request originating from a non-site admin whilst there is a DMCA report active against the guide.|[Error Object](#schemaerror_object) -## Delete Mod +## Delete Guide > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id} \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' @@ -4444,7 +4121,7 @@ curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} \ ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id} HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -4462,7 +4139,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', method: 'delete', headers: headers, @@ -4482,7 +4159,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', { method: 'DELETE', @@ -4503,7 +4180,7 @@ headers = { 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', params={ +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', params={ }, headers = headers) @@ -4511,7 +4188,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); @@ -4526,9 +4203,9 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}` +`DELETE /games/{game-id}/guides/{guide-id}` -Delete a mod profile. Successful request will return `204 No Content` and fire a __MOD_UNAVAILABLE__ event.

__NOTE:__ This will close the mod profile which means it cannot be viewed or retrieved via API requests but will still exist in-case you choose to restore it at a later date. If you wish to permanently delete a mod you have access rights to, you must do it via the [mods profile page](https://mod.io/me/library) on the mod.io website. +Delete a guide. Successful request will return `204 No Content`. > Example response @@ -4536,31 +4213,30 @@ Delete a mod profile. Successful request will return `204 No Content` and fire a 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| 204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15019|The authenticated user does not have permission to delete this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14028|The authenticated user does not have permission to delete guides to this game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14031|The guide cannot be deleted due to the request originating from a non-site admin whilst there is a DMCA report active against the guide.|[Error Object](#schemaerror_object) -# Files - -## Get Modfiles +## Get Guides Tags > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -4574,7 +4250,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/tags', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -4592,7 +4268,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey', { method: 'GET', @@ -4611,7 +4287,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides/tags', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -4619,7 +4295,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -4634,27 +4310,9 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/files` - -Get all files that are published for the corresponding mod. Successful request will return an array of [Modfile Objects](#get-modfiles-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. - - __NOTE:__ If the [game](#edit-game) requires mod downloads to be initiated via the API, the `binary_url` returned will contain a verification hash. This hash must be supplied to get the modfile, and will expire after a certain period of time. Saving and reusing the `binary_url` won't work in this situation given it's dynamic nature. +`GET /games/{game-id}/guides/tags` - Filter|Type|Description - ---|---|--- - id|integer|Unique id of the file. - mod_id|integer|Unique id of the mod. - date_added|integer|Unix timestamp of date file was added. - date_scanned|integer|Unix timestamp of date file was virus scanned. - virus_status|integer|Current virus scan status of the file. For newly added files that have yet to be scanned this field will change frequently until a scan is complete:

__0__ = Not scanned
__1__ = Scan complete
__2__ = In progress
__3__ = Too large to scan
__4__ = File not found
__5__ = Error Scanning - virus_positive|integer|Was a virus detected:

__0__ = No threats detected
__1__ = Flagged as malicious
__2__ = Flagged as containing potentially harmful files (i.e. EXEs) - filesize|integer|Size of the file in bytes. - filehash|string|MD5 hash of the file. - filename|string|Filename including extension. - version|string|Release version this file represents. - changelog|string|Changelog for the file. - metadata_blob|string|Metadata stored by the game developer for this file. - platform_status|string|If the parent game has enabled per-platform files, by default only files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To QA pending files, you can filter results by their current platform status, using `pending_only`, `approved_only` or `live_and_pending`. With the exception of `approved_only` which is available to everyone, all other values are restricted to game administrators. +Get all guide tags for a game. Successful request will return an array of [Guide Tag Objects](#get-guide-tags). > Example response @@ -4662,32 +4320,9 @@ Get all files that are published for the corresponding mod. Successful request w { "data": [ { - "id": 2, - "mod_id": 2, + "name": "Instructions", "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] + "count": 22 }, { ... @@ -4700,32 +4335,30 @@ Get all files that are published for the corresponding mod. Successful request w } ``` -

Cross-Platform Filtering

- -If the parent game has platform filtering enabled, this endpoint supports the [targeting a platform](#targeting-a-platform) request header to return the [modfiles](#modfile-object) that are approved for the requested platform. - -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Modfiles](#schemaget_modfiles) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Guide Tags](#schemaget_guide_tags) -## Get Modfile +# Mods + +## Get Mods > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -4739,7 +4372,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', + url: 'https://*.modapi.io/v1/games/{game-id}/mods', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -4757,7 +4390,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods?api_key=YourApiKey', { method: 'GET', @@ -4776,7 +4409,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -4784,7 +4417,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -4799,91 +4432,219 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/files/{file-id}` +`GET /games/{game-id}/mods` -Get a file. Successful request will return a single [Modfile Object](#modfile-object).

__NOTE:__ If the [game](#edit-game) requires mod downloads to be initiated via the API, the `binary_url` returned will contain a verification hash. This hash must be supplied to get the modfile, and will expire after a certain period of time. Saving and reusing the `binary_url` won't work in this situation given it's dynamic nature. +Get all mods for the corresponding game. Successful request will return an array of [Mod Objects](#get-mods-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. + + Filter|Type|Description + ---|---|--- + id|integer|Unique id of the mod. + game_id|integer|Unique id of the parent game. + status|integer|Status of the mod (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted
__1__ = Accepted _(default)_
__3__ = Deleted + visible|integer|Visibility of the mod (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Hidden
__1__ = Public _(default)_ + submitted_by|integer|Unique id of the user who has ownership of the mod. + date_added|integer|Unix timestamp of date mod was registered. + date_updated|integer|Unix timestamp of date mod was updated. + date_live|integer|Unix timestamp of date mod was set live. + maturity_option|integer|Maturity option(s) set by the mod creator:

__0__ = None
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) + monetisation_options|integer|Monetisation option(s) enabled by the mod creator:

__0__ = None
__1__ = Enabled
__2__ = Marketplace On
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) + name|string|Name of the mod. + name_id|string|Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__ + modfile|integer|Unique id of the file that is the current active release (see [mod files](#files)). + metadata_blob|string|Metadata stored by the game developer. + metadata_kvp|string|Colon-separated values representing the key-value pairs you want to filter the results by. If you supply more than one key-pair, separate the pairs by a comma. Will only filter by an exact key-pair match. + tags|string|Comma-separated values representing the tags you want to filter the results by. If you specify multiple tags, only mods which have all tags will be returned, and only tags that are supported by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). If you want to ensure mods returned do not contain particular tag(s), you can use the `tags-not-in` filter either independently or alongside this filter. + platform_status|string|If the parent game has enabled per-platform files, by default only mods with files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To QA mods with pending files, you can filter results by their current platform status, using `pending_only` or `live_and_pending`.

__NOTE:__ only game admins can filter by this field. + + Sort|Description + ---|--- + downloads|Sort results by most downloads using [_sort filter](#filtering) parameter, value should be `downloads` for descending or `-downloads` for ascending results. + popular|Sort results by popularity using [_sort filter](#filtering), value should be `popular` for descending or `-popular` for ascending results.

__NOTE:__ Popularity is calculated hourly and reset daily (results are ranked from 1 to X). You should sort this column in ascending order `-popular` to get the top ranked results. + rating|Sort results by weighted rating using [_sort filter](#filtering), value should be `rating` for descending or `-rating` for ascending results. + subscribers|Sort results by most subscribers using [_sort filter](#filtering), value should be `subscribers` for descending or `-subscribers` for ascending results. > Example response ```json { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ + "data": [ { - "platform": "windows", - "status": 1 + "id": 2, + "game_id": 2, + "status": 1, + "visible": 1, + "submitted_by": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1492564103, + "date_updated": 1499841487, + "date_live": 1499841403, + "maturity_option": 0, + "community_options": 3, + "monetisation_options": 0, + "price": 0, + "tax": 0, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "homepage_url": "https://www.rogue-hdpack.com/", + "name": "Rogue Knight HD Pack", + "name_id": "rogue-knight-hd-pack", + "summary": "It's time to bask in the glory of beautiful 4k textures!", + "description": "

Rogue HD Pack does exactly what you thi...", + "description_plaintext": "Rogue HD Pack does exactly what you thi...", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", + "media": { + "youtube": [ + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ], + "sketchfab": [ + "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" + ], + "images": [ + { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + } + ] + }, + "modfile": { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] + }, + "platforms": [ + { + "platform": "windows", + "modfile_live": 1 + } + ], + "metadata_kvp": [ + { + "metakey": "pistol-dmg", + "metavalue": "800" + } + ], + "tags": [ + { + "name": "Unity", + "date_added": 1499841487 + } + ], + "stats": { + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 + } + }, + { + ... } - ] + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 } ``` -

Responses

+

Cross-Platform Filtering

+ +If the parent game has platform filtering enabled, this endpoint supports the [targeting a platform](#targeting-a-platform) request header to return mods that have been approved for the requested platform. If you are a member of the parent game team, please see the `platform_status` filter for this endpoint above on how you can retrieve pending mods. + +

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Modfile Object](#schemamodfile_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mods](#schemaget_mods) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15025|The authenticated user has applied an admin-only filter or value to the request, and is not an administrator for this game.|[Error Object](#schemaerror_object) -## Add Modfile +## Get Mod > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: multipart/form-data' \ - -H 'Accept: application/json' \ - -F 'filedata=@/path/to/modfile.zip' \ - -F 'version=1.2' \ - -F 'changelog=

Rogue Knights v1.2.0 Changelog

New Featu...' \ - -F 'metadata_blob=client_signature:9VbZccpR' \ - -F 'platforms[]=undefined' +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}?api_key=YourApiKey \ + -H 'Accept: application/json' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io -Content-Type: multipart/form-data + Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', - method: 'post', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -4893,26 +4654,16 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "filedata": "@/path/to/modfile.zip", - "version": "1.2", - "changelog": "

Rogue Knights v1.2.0 Changelog

New Featu...", - "metadata_blob": "client_signature:9VbZccpR", - "platforms": [ - "string" - ] -}'; + const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}?api_key=YourApiKey', { - method: 'POST', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -4925,22 +4676,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -4953,113 +4702,191 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/files` - -Upload a file for the corresponding mod. Successful request will return the newly created [Modfile Object](#modfile-object). Ensure that the release you are uploading is stable and free from any critical issues. Files are scanned upon upload, any users who upload malicious files will have their accounts closed. - - __NOTE:__ This endpoint does *not support* `input_json` even if you base64-encode your file, due to the already-large file sizes of some releases and base64-encoding inflating the filesize. - - __NOTE:__ To upload files greater than 100MB, we recommend using the [Multipart Uploads](#create-multipart-upload-session) system. This endpoint supports files up to a max of 500MB in size. +`GET /games/{game-id}/mods/{mod-id}` - Parameter|Type|Required|Description - ---|---|---|---| - filedata|file||Required if the upload_id parameter is omitted. The binary file for the release. ZIP the base folder of your mod, or if it is a collection of files which live in a pre-existing game folder, you should ZIP those files. Your file must meet the following conditions:

- File must be __zipped__ and cannot exceed __500MB__ in filesize (see [Multipart Uploads](#create-multipart-upload-session) to upload larger files)
- Filename's cannot contain any of the following charcters: \ / ? " < > | : *
- Mods which span multiple game directories are not supported unless the game manages this
- Mods which overwrite files are not supported unless the game manages this - upload_id|string||Required if the filedata parameter is omitted. The UUID of a completed [multipart upload session](#complete-multipart-upload-session). - version|string||Version of the file release (recommended format 1.0.0 - MAJOR.MINOR.PATCH). - changelog|string||Changelog of this release. - active|boolean||_Default value is true._ Flag this upload as the current release, this will change the `modfile` field on the parent mod to the `id` of this file after upload.

__NOTE:__ If the _active_ parameter is _true_, a [__MODFILE_CHANGED__ event](#get-mod-events) will be fired, so game clients know there is an update available for this mod. - filehash|string||MD5 of the submitted file. When supplied the MD5 will be compared against the uploaded files MD5. If they don't match a `422 Unprocessible Entity` error will be returned. - metadata_blob|string||Metadata stored by the game developer which may include properties such as what version of the game this file is compatible with. - platforms|array|If platform filtering enabled|An array containing one or more [platforms](#targeting-a-platform) this file is targeting. Valid values can be found under the [targeting a platform](#targeting-a-platform) section. +Get a mod. Successful request will return a single [Mod Object](#mod-object). > Example response ```json { "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + "game_id": 2, + "status": 1, + "visible": 1, + "submitted_by": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "date_added": 1492564103, + "date_updated": 1499841487, + "date_live": 1499841403, + "maturity_option": 0, + "community_options": 3, + "monetisation_options": 0, + "price": 0, + "tax": 0, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "homepage_url": "https://www.rogue-hdpack.com/", + "name": "Rogue Knight HD Pack", + "name_id": "rogue-knight-hd-pack", + "summary": "It's time to bask in the glory of beautiful 4k textures!", + "description": "

Rogue HD Pack does exactly what you thi...", + "description_plaintext": "Rogue HD Pack does exactly what you thi...", "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 + "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", + "media": { + "youtube": [ + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ], + "sketchfab": [ + "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" + ], + "images": [ + { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + } + ] + }, + "modfile": { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] }, "platforms": [ { "platform": "windows", - "status": 1 + "modfile_live": 1 } - ] + ], + "metadata_kvp": [ + { + "metakey": "pistol-dmg", + "metavalue": "800" + } + ], + "tags": [ + { + "name": "Unity", + "date_added": 1499841487 + } + ], + "stats": { + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 + } } ```

Cross-Platform Filtering

-Cross-platform submissions are supported on this endpoint. To target particular platforms, see the `platforms` body parameter above. +If the parent game has platform filtering enabled, this endpoint supports the [targeting a platform](#targeting-a-platform) request header to return the [modfile](#modfile-object) within the [Mod Object](#mod-object) for the requested platform. If the request targets a platform that is invalid, the `modfile` field will be an empty object `{}`. -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Modfile Object](#schemamodfile_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15006|The authenticated user does not have permission to upload modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) -422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|13002|The payload passed in the request was unable to be validated/read by mod.io, please try again.|[Error Object](#schemaerror_object) -### Response Headers - -Status|Header|Type|Format|Description ----|---|---|---|---| -201|Location|string||URL to newly created resource - +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Mod Object](#schemamod_object) -## Edit Modfile +## Add Mod > Example request ```shell # You can also use wget -curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id} \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' + -H 'Content-Type: multipart/form-data' \ + -H 'Accept: application/json' \ + -F 'name=Graphics Overhaul Mod' \ + -F 'name_id=graphics-overhaul-mod' \ + -F 'summary=Short descriptive summary here' \ + -F 'description=

Getting started with..' \ + -F 'logo=@/path/to/image.jpg' \ + -F 'homepage_url=https://www.example.com' \ + -F 'tags[]=easy' ``` ```http -PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id} HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods HTTP/1.1 Host: *.modapi.io - +Content-Type: multipart/form-data Accept: application/json Authorization: Bearer {access-token} -Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', - method: 'put', + url: 'https://*.modapi.io/v1/games/{game-id}/mods', + method: 'post', headers: headers, success: function(data) { @@ -5070,18 +4897,26 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "name": "Graphics Overhaul Mod", + "name_id": "graphics-overhaul-mod", + "summary": "Short descriptive summary here", + "description": "

Getting started with..", + "logo": "@/path/to/image.jpg", + "homepage_url": "https://www.example.com", + "tags": "easy" +}'; const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', +fetch('https://*.modapi.io/v1/games/{game-id}/mods', { - method: 'PUT', - + method: 'POST', + body: inputBody, headers: headers }) .then(function(res) { @@ -5095,11 +4930,11 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.put('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods', params={ }, headers = headers) @@ -5107,9 +4942,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("PUT"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -5122,99 +4957,213 @@ in.close(); System.out.println(response.toString()); ``` -`PUT /games/{game-id}/mods/{mod-id}/files/{file-id}` +`POST /games/{game-id}/mods` -Edit the details of a published file. If you want to update fields other than the `changelog`, `version` and `active` status, you should add a new file instead. Successful request will return updated [Modfile Object](#modfile-object). +Add a mod. Successful request will return the newly created [Mod Object](#mod-object). All content published by users on [mod.io](https://mod.io) is subject to the [Terms of Use](https://mod.io/terms/widget). It is a requirement that you provide a link to [https://mod.io/terms](https://mod.io/terms) in any place where users are submitting content to mod.io. + + __NOTE:__ By default new mods are 'not accepted' and 'public'. They can only be 'accepted' and made available via the API once a [Mod File](#add-modfile) has been uploaded. [Media](#add-mod-media), [Metadata Key Value Pairs](#add-mod-kvp-metadata) and [Dependencies](#add-mod-dependencies) can also be added after a mod profile is created. Parameter|Type|Required|Description ---|---|---|---| - version|string||Version of the file release (recommended format 1.0.0 - MAJOR.MINOR.PATCH). - changelog|string||Changelog of this release. - active|boolean||Flag this upload as the current release.

__NOTE:__ If the _active_ parameter causes the parent mods `modfile` parameter to change, a [__MODFILE_CHANGED__ event](#get-mod-events) will be fired, so game clients know there is an update available for this mod. - metadata_blob|string||Metadata stored by the game developer which may include properties such as what version of the game this file is compatible with. + logo|file|true|Image file which will represent your mods logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this image to make three thumbnails for the dimensions 320x180, 640x360 and 1280x720. + name|string|true|Name of your mod. + name_id|string||Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__. If no `name_id` is specified the `name` will be used. For example: _'Stellaris Shader Mod'_ will become _'stellaris-shader-mod'_. Cannot exceed 80 characters. + summary|string|true|Summary for your mod, giving a brief overview of what it's about. Cannot exceed 250 characters. + visible|integer||Visibility of the mod (best if this field is controlled by mod admins, see [status and visibility](#status-amp-visibility) for details):

__0__ = Hidden
__1__ = Public _(default)_ + description|string||Detailed description for your mod, which can include details such as 'About', 'Features', 'Install Instructions', 'FAQ', etc. HTML supported and encouraged. + homepage_url|string||Official homepage for your mod. Must be a valid URL. + stock|integer||Maximium number of subscribers for this mod. A value of 0 disables this limit. + maturity_option|integer||Choose if this mod contains any of the following mature content.

__NOTE:__ The value of this field will default to 0 unless the parent game allows you to flag mature content (see `maturity_options` field in [Game Object](#game-object)).

__0__ = None _(default)_
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple options (see [BITWISE fields](#bitwise-and-bitwise-and)) + community_options|integer||Community features enabled for this mod:

__0__ = All of the options below are disabled
__1__ = Enable comments _(default)_
__?__ = Add the options you want together, to enable multiple options (see [BITWISE fields](#bitwise-and-bitwise-and)) + metadata_blob|string||Metadata stored by the game developer which may include properties as to how the item works, or other information you need to display. Metadata can also be stored as searchable [key value pairs](#metadata), and to individual [mod files](#get-modfiles). + tags[]|string||Tags to apply to the mod. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2). Only the tags pre-defined by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). > Example response ```json { "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + "game_id": 2, + "status": 1, + "visible": 1, + "submitted_by": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "date_added": 1492564103, + "date_updated": 1499841487, + "date_live": 1499841403, + "maturity_option": 0, + "community_options": 3, + "monetisation_options": 0, + "price": 0, + "tax": 0, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "homepage_url": "https://www.rogue-hdpack.com/", + "name": "Rogue Knight HD Pack", + "name_id": "rogue-knight-hd-pack", + "summary": "It's time to bask in the glory of beautiful 4k textures!", + "description": "

Rogue HD Pack does exactly what you thi...", + "description_plaintext": "Rogue HD Pack does exactly what you thi...", "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 + "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", + "media": { + "youtube": [ + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ], + "sketchfab": [ + "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" + ], + "images": [ + { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + } + ] + }, + "modfile": { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] }, "platforms": [ { "platform": "windows", - "status": 1 + "modfile_live": 1 } - ] + ], + "metadata_kvp": [ + { + "metakey": "pistol-dmg", + "metavalue": "800" + } + ], + "tags": [ + { + "name": "Unity", + "date_added": 1499841487 + } + ], + "stats": { + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 + } } ``` -

Cross-Platform Filtering

- -Cross-platform submissions are supported on this endpoint. If the parent game supports cross-platform modfiles, and this modfile is approved, making a request with the active parameter will set the modfile live on all approved platforms. - -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Update Successful|[Modfile Object](#schemamodfile_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15007|The authenticated user does not have permission to update modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15033|The authenticated user does not have permission to update modfile metadata for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Mod Object](#schemamod_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) +### Response Headers + +Status|Header|Type|Format|Description +---|---|---|---|---| +201|Location|string||URL to newly created resource + -## Delete Modfile +## Edit Mod > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id} \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' + -H 'Content-Type: multipart/form-data' \ + -H 'Content-Type: multipart/form-data' \ + -H 'Accept: application/json' \ + -F 'name=Graphics Overhaul Mod' \ + -F 'name_id=graphics-overhaul-mod' \ + -F 'summary=Short descriptive summary here' \ + -F 'description=

Getting started with..' \ + -F 'logo=@/path/to/image.jpg' \ + -F 'homepage_url=https://www.example.com' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id} HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} HTTP/1.1 Host: *.modapi.io - +Content-Type: multipart/form-data Accept: application/json Authorization: Bearer {access-token} -Content-Type: application/x-www-form-urlencoded +Content-Type: multipart/form-data ``` ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Type':'multipart/form-data', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', - method: 'delete', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', + method: 'post', headers: headers, success: function(data) { @@ -5225,18 +5174,26 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "name": "Graphics Overhaul Mod", + "name_id": "graphics-overhaul-mod", + "summary": "Short descriptive summary here", + "description": "

Getting started with..", + "logo": "@/path/to/image.jpg", + "homepage_url": "https://www.example.com" +}'; const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Type':'multipart/form-data', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', { - method: 'DELETE', - + method: 'POST', + body: inputBody, headers: headers }) .then(function(res) { @@ -5250,11 +5207,12 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Type': 'multipart/form-data', + 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', params={ }, headers = headers) @@ -5262,9 +5220,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -5277,34 +5235,174 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}/files/{file-id}` +`POST /games/{game-id}/mods/{mod-id}` -Delete a modfile. Successful request will return `204 No Content`.

__NOTE:__ A modfile can never be removed if it is the current active release for the corresponding mod regardless of user permissions. Furthermore, this ability is only available if you are authenticated as the game administrator for this game _or_ are the original uploader of the modfile. +Edit details for a mod. If you want to update the `logo` or media associated with this mod, you need to use the [Add Mod Media](#add-mod-media) endpoint. The same applies to [Mod Files](#add-modfile), [Metadata Key Value Pairs](#add-mod-kvp-metadata) and [Dependencies](#add-mod-dependencies) which are all managed via other endpoints. Successful request will return the updated [Mod Object](#mod-object). + + Parameter|Type|Required|Description + ---|---|---|---| + logo|file|true|Image file which will represent your mods logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this image to make three thumbnails for the dimensions 320x180, 640x360 and 1280x720. + status|integer||Status of a mod. The mod must have at least one uploaded `modfile` to be 'accepted' (best if this field is controlled by game admins, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted
__1__ = Accepted (game admins only)
__3__ = Deleted (use the [delete mod](#delete-mod) endpoint to set this status) + visible|integer||Visibility of the mod (best if this field is controlled by mod admins, see [status and visibility](#status-amp-visibility) for details):

__0__ = Hidden
__1__ = Public + name|string||Name of your mod. Cannot exceed 50 characters. + name_id|string||Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__. Cannot exceed 80 characters. + summary|string||Summary for your mod, giving a brief overview of what it's about. Cannot exceed 250 characters. + description|string||Detailed description for your mod, which can include details such as 'About', 'Features', 'Install Instructions', 'FAQ', etc. HTML supported and encouraged. + homepage_url|string||Official homepage for your mod. Must be a valid URL. + stock|integer||Maximium number of subscribers for this mod. A value of 0 disables this limit. + maturity_option|integer||Choose if this mod contains any of the following mature content.

__NOTE:__ The value of this field will default to 0 unless the parent game allows you to flag mature content (see `maturity_options` field in [Game Object](#game-object)).

__0__ = None set
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple options (see [BITWISE fields](#bitwise-and-bitwise-and)) + community_options|integer||Community features enabled for this mod:

__0__ = All of the options below are disabled
__1__ = Enable comments
_64_ = Enable previews
__?__ = Add the options you want together, to enable multiple options (see [BITWISE fields](#bitwise-and-bitwise-and)) + metadata_blob|string||Metadata stored by the game developer which may include properties as to how the item works, or other information you need to display. Metadata can also be stored as searchable [key value pairs](#metadata), and to individual [mod files](#get-modfiles). > Example response ```json - 204 No Content +{ + "id": 2, + "game_id": 2, + "status": 1, + "visible": 1, + "submitted_by": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1492564103, + "date_updated": 1499841487, + "date_live": 1499841403, + "maturity_option": 0, + "community_options": 3, + "monetisation_options": 0, + "price": 0, + "tax": 0, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "homepage_url": "https://www.rogue-hdpack.com/", + "name": "Rogue Knight HD Pack", + "name_id": "rogue-knight-hd-pack", + "summary": "It's time to bask in the glory of beautiful 4k textures!", + "description": "

Rogue HD Pack does exactly what you thi...", + "description_plaintext": "Rogue HD Pack does exactly what you thi...", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", + "media": { + "youtube": [ + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ], + "sketchfab": [ + "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" + ], + "images": [ + { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + } + ] + }, + "modfile": { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] + }, + "platforms": [ + { + "platform": "windows", + "modfile_live": 1 + } + ], + "metadata_kvp": [ + { + "metakey": "pistol-dmg", + "metavalue": "800" + } + ], + "tags": [ + { + "name": "Unity", + "date_added": 1499841487 + } + ], + "stats": { + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 + } +} ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15008|The authenticated user does not have permission to delete modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15009|The live modfile for a mod cannot be deleted.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Update Successful|[Mod Object](#schemamod_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15013|The authenticated user does not have permission to update this mod. Ensure the user is part of the mod team before attempting the request again.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15033|The authenticated user does not have permission to update the metadata for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15014|The authenticated user does not have permission to update the maturity options for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15015|The authenticated user does not have permission to update the status for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15016|A mod cannot be set live without an associated modfile.|[Error Object](#schemaerror_object) -## Manage Platform Status +## Delete Mod > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' @@ -5312,7 +5410,7 @@ curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id} HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -5330,8 +5428,8 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms', - method: 'post', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', + method: 'delete', headers: headers, success: function(data) { @@ -5350,9 +5448,9 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', { - method: 'POST', + method: 'DELETE', headers: headers }) @@ -5371,7 +5469,7 @@ headers = { 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms', params={ +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}', params={ }, headers = headers) @@ -5379,9 +5477,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -5394,76 +5492,41 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/files/{file-id}/platforms` - -Manage the platform status of a particular modfile. This endpoint does not set any file live, instead it allows you to approve and deny new uploads. To set a file as the *live* file for the approved platforms after you have reviewed them, you must call the [Edit Modfile](#update-modfile) with the active flag enabled. - - __NOTE:__ This is ony applicable if the parent game has cross-platform moderation enabled. A successful request will return the updated [Modfile object](#modfile-object). +`DELETE /games/{game-id}/mods/{mod-id}` - Parameter|Type|Required|Description - ---|---|---|---| - approved|array||An array containing one or more [platform strings](#targeting-a-platform) that the specified modfile is approved for. - denied|array||An array containing one or more [platform strings](#targeting-a-platform) that the specified modfile is denied for.

__NOTE:__ You cannot mark a live modfile as denied, if a modfile is live the only option to remove it is to set another [existing modfile](#edit-modfile) as the live modfile for that platform, or add a [new modfile](#add-modfile). +Delete a mod profile. Successful request will return `204 No Content` and fire a __MOD_UNAVAILABLE__ event.

__NOTE:__ This will close the mod profile which means it cannot be viewed or retrieved via API requests but will still exist in-case you choose to restore it at a later date. If you wish to permanently delete a mod you have access rights to, you must do it via the [mods profile page](https://mod.io/me/library) on the mod.io website. > Example response ```json -{ - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] -} + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request.|[Modfile Object](#schemamodfile_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15007|The authenticated user does not have permission to edit the platforms for the specified modfile, ensure the user is a member of parent game team.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14037|The parent game doesn't cross-platform modfile submissions.|[Error Object](#schemaerror_object) +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15019|The authenticated user does not have permission to delete this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -# Files (Multipart Uploads) +# Files -## Get Multipart Upload Parts +## Get Modfiles > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -5477,7 +5540,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -5495,7 +5558,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files?api_key=YourApiKey', { method: 'GET', @@ -5514,7 +5577,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -5522,7 +5585,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -5537,79 +5600,114 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/files/multipart` +`GET /games/{game-id}/mods/{mod-id}/files` -Get all uploaded parts for a corresponding upload session. Successful request will return an array of [Multipart Upload Part Objects](#get-multipart-upload-parts-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Get all files that are published for the corresponding mod. Successful request will return an array of [Modfile Objects](#get-modfiles-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. -> Example response + __NOTE:__ If the [game](#edit-game) requires mod downloads to be initiated via the API, the `binary_url` returned will contain a verification hash. This hash must be supplied to get the modfile, and will expire after a certain period of time. Saving and reusing the `binary_url` won't work in this situation given it's dynamic nature. -```json -{ - "data": [ - { - "upload_id": "123e4567-e89b-12d3-a456-426614174000", - "part_number": 1, - "part_size": 52428800, - "date_added": 1499846132 - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, + Filter|Type|Description + ---|---|--- + id|integer|Unique id of the file. + mod_id|integer|Unique id of the mod. + date_added|integer|Unix timestamp of date file was added. + date_scanned|integer|Unix timestamp of date file was virus scanned. + virus_status|integer|Current virus scan status of the file. For newly added files that have yet to be scanned this field will change frequently until a scan is complete:

__0__ = Not scanned
__1__ = Scan complete
__2__ = In progress
__3__ = Too large to scan
__4__ = File not found
__5__ = Error Scanning + virus_positive|integer|Was a virus detected:

__0__ = No threats detected
__1__ = Flagged as malicious
__2__ = Flagged as containing potentially harmful files (i.e. EXEs) + filesize|integer|Size of the file in bytes. + filehash|string|MD5 hash of the file. + filename|string|Filename including extension. + version|string|Release version this file represents. + changelog|string|Changelog for the file. + metadata_blob|string|Metadata stored by the game developer for this file. + platform_status|string|If the parent game has enabled per-platform files, by default only files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To QA pending files, you can filter results by their current platform status, using `pending_only`, `approved_only` or `live_and_pending`. With the exception of `approved_only` which is available to everyone, all other values are restricted to game administrators. + +> Example response + +```json +{ + "data": [ + { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] + }, + { + ... + } + ], + "result_count": 70, + "result_offset": 0, "result_limit": 100, "result_total": 70 } ``` -

Responses

+

Cross-Platform Filtering

+ +If the parent game has platform filtering enabled, this endpoint supports the [targeting a platform](#targeting-a-platform) request header to return the [modfiles](#modfile-object) that are approved for the requested platform. + +

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Multipart Upload Parts](#schemaget_multipart_upload_parts) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Modfiles](#schemaget_modfiles) -## Add Multipart Upload Part +## Get Modfile > Example request ```shell # You can also use wget -curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000 \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Range: bytes 0-52428799/209715196' \ - -H 'Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=' \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json -Authorization: Bearer {access-token} -Content-Range: bytes 0-52428799/209715196 -Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Range':'bytes 0-52428799/209715196', - 'Digest':'sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', - method: 'put', - data: '?upload_id=123e4567-e89b-12d3-a456-426614174000', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -5621,16 +5719,13 @@ $.ajax({ const request = require('node-fetch'); const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Range':'bytes 0-52428799/209715196', - 'Digest':'sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}?api_key=YourApiKey', { - method: 'PUT', + method: 'GET', headers: headers }) @@ -5644,23 +5739,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?uplo ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Range': 'bytes 0-52428799/209715196', - 'Digest': 'sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=', 'Accept': 'application/json' } -r = requests.put('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', params={ - 'upload_id': '123e4567-e89b-12d3-a456-426614174000' +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("PUT"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -5673,73 +5765,74 @@ in.close(); System.out.println(response.toString()); ``` -`PUT /games/{game-id}/mods/{mod-id}/files/multipart` - -Add a new multipart upload part to an [existing upload session](#create-multipart-upload-session). All parts must be exactly 50MB (Mebibyte) in size unless it is the final part which can be smaller. A successful request will return a single [Multipart Upload Part Object](#multipart-upload-object). - - __NOTE__: Unlike other POST endpoints on this service, the body of this request should contain no form parameters and instead be the data described in the byte range of the Content-Range header of the request. - - Query Parameters|Required|type|Description - ---|---|---|---| - upload_id|true|string|The `upload_id` of the existing upload session to upload the part for. +`GET /games/{game-id}/mods/{mod-id}/files/{file-id}` - Header Parameters|Required|Description - ---|---|---|---| - Content-Range|true|The [Content-Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) of the part you are sending, in bytes. - Digest||Optional [Digest](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Digest) for part integrity checks once the part has been uploaded. +Get a file. Successful request will return a single [Modfile Object](#modfile-object).

__NOTE:__ If the [game](#edit-game) requires mod downloads to be initiated via the API, the `binary_url` returned will contain a verification hash. This hash must be supplied to get the modfile, and will expire after a certain period of time. Saving and reusing the `binary_url` won't work in this situation given it's dynamic nature. > Example response ```json { - "upload_id": "123e4567-e89b-12d3-a456-426614174000", - "part_number": 1, - "part_size": 52428800, - "date_added": 1499846132 + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Multipart Upload Part Object](#schemamultipart_upload_part_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29008|The `Content-Range` header is missing from your request.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29009|The unit within the Content-Range header must be of type: bytes.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29010|The Content-Range header must not include wild-carded values, as they are unsupported (an asterisk cannot be included).|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29011|The Content-Range header contains a non numeric value.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29014|The Content-Range header contains an invalid range, ensure that the finishing byte is greater than the starting byte.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29012|The Content-Range header does not match the required pattern.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29013|The size of the part provided is either too big, or too small.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29026|The finish byte of that range must be 1 byte less than the total file size specified.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29005|The Digest header contains more than one value, please ensure only the digest for the content body is provided.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29006|An algorithm indicated in the Digest header is unsupported, please use one of the following algorithms instead: SHA-256, CRC32C.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29015|An uploaded part with the specified start - finish byte range has already been uploaded to that session. If this is in error, you may need to abort the upload session, and start again.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15006|The authenticated user does not have permission to upload modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Modfile Object](#schemamodfile_object) -## Create Multipart Upload Session +## Add Modfile > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Content-Type: multipart/form-data' \ -H 'Accept: application/json' \ - -d 'filename=testfile.zip' \ - -d 'nonce=a93d389804ee0490f1903ab26500a66a695ce65fa7ecb074d79771857d074355' + -F 'filedata=@/path/to/modfile.zip' \ + -F 'version=1.2' \ + -F 'changelog=

Rogue Knights v1.2.0 Changelog

New Featu...' \ + -F 'metadata_blob=client_signature:9VbZccpR' \ + -F 'platforms[]=undefined' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded +Content-Type: multipart/form-data Accept: application/json Authorization: Bearer {access-token} @@ -5748,13 +5841,13 @@ Authorization: Bearer {access-token} ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', method: 'post', headers: headers, @@ -5767,17 +5860,22 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "filename": "testfile.zip", - "nonce": "a93d389804ee0490f1903ab26500a66a695ce65fa7ecb074d79771857d074355" + "filedata": "@/path/to/modfile.zip", + "version": "1.2", + "changelog": "

Rogue Knights v1.2.0 Changelog

New Featu...", + "metadata_blob": "client_signature:9VbZccpR", + "platforms": [ + "string" + ] }'; const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', { method: 'POST', body: inputBody, @@ -5794,11 +5892,11 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files', params={ }, headers = headers) @@ -5806,7 +5904,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -5821,70 +5919,114 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/files/multipart` +`POST /games/{game-id}/mods/{mod-id}/files` -Create a new multipart upload session. A successful request will return a single [Multipart Upload Object](#multipart-upload-object). +Upload a file for the corresponding mod. Successful request will return the newly created [Modfile Object](#modfile-object). Ensure that the release you are uploading is stable and free from any critical issues. Files are scanned upon upload, any users who upload malicious files will have their accounts closed. - __NOTE:__ The multipart upload system is designed for uploading large files up to 20GB in size. If uploading files less than 100MB, we recommend using the [Add Modfile](#add-modfile) endpoint. + __NOTE:__ This endpoint does *not support* `input_json` even if you base64-encode your file, due to the already-large file sizes of some releases and base64-encoding inflating the filesize. + + __NOTE:__ To upload files greater than 100MB, we recommend using the [Multipart Uploads](#create-multipart-upload-session) system. This endpoint supports files up to a max of 500MB in size. Parameter|Type|Required|Description ---|---|---|---| - filename|string|true|The filename of the file once all the parts have been [uploaded](#add-multipart-upload-part). The filename must include the `.zip` extension and cannot exceed 100 characters. - nonce|string||An optional nonce to provide to prevent duplicate upload sessions from being created concurrently. Maximum of 64 characters. + filedata|file||Required if the upload_id parameter is omitted. The binary file for the release. ZIP the base folder of your mod, or if it is a collection of files which live in a pre-existing game folder, you should ZIP those files. Your file must meet the following conditions:

- File must be __zipped__ and cannot exceed __500MB__ in filesize (see [Multipart Uploads](#create-multipart-upload-session) to upload larger files)
- Filename's cannot contain any of the following charcters: \ / ? " < > | : *
- Mods which span multiple game directories are not supported unless the game manages this
- Mods which overwrite files are not supported unless the game manages this + upload_id|string||Required if the filedata parameter is omitted. The UUID of a completed [multipart upload session](#complete-multipart-upload-session). + version|string||Version of the file release (recommended format 1.0.0 - MAJOR.MINOR.PATCH). + changelog|string||Changelog of this release. + active|boolean||_Default value is true._ Flag this upload as the current release, this will change the `modfile` field on the parent mod to the `id` of this file after upload.

__NOTE:__ If the _active_ parameter is _true_, a [__MODFILE_CHANGED__ event](#get-mod-events) will be fired, so game clients know there is an update available for this mod. + filehash|string||MD5 of the submitted file. When supplied the MD5 will be compared against the uploaded files MD5. If they don't match a `422 Unprocessible Entity` error will be returned. + metadata_blob|string||Metadata stored by the game developer which may include properties such as what version of the game this file is compatible with. + platforms|array|If platform filtering enabled|An array containing one or more [platforms](#targeting-a-platform) this file is targeting. Valid values can be found under the [targeting a platform](#targeting-a-platform) section. > Example response ```json { - "upload_id": "123e4567-e89b-12d3-a456-426614174000", - "status": 0 + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] } ``` -

Responses

+

Cross-Platform Filtering

-Status|Meaning|Error Ref|Description|Response Schema ----|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Multipart Upload Object](#schemamultipart_upload_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29002|The nonce you provided was already associated with a completed upload session. If you wish to start a new upload you should regenerate the nonce parameter.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) +Cross-platform submissions are supported on this endpoint. To target particular platforms, see the `platforms` body parameter above. + +

Responses

+ +Status|Meaning|Error Ref|Description|Response Schema +---|---|----|---|---| +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Modfile Object](#schemamodfile_object) 403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15006|The authenticated user does not have permission to upload modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) +422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|13002|The payload passed in the request was unable to be validated/read by mod.io, please try again.|[Error Object](#schemaerror_object) +### Response Headers + +Status|Header|Type|Format|Description +---|---|---|---|---| +201|Location|string||URL to newly created resource + -## Delete Multipart Upload Session +## Edit Modfile > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000 \ +curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id} \ -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1 +PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id} HTTP/1.1 Host: *.modapi.io Accept: application/json Authorization: Bearer {access-token} +Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', - method: 'delete', - data: '?upload_id=123e4567-e89b-12d3-a456-426614174000', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', + method: 'put', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -5897,13 +6039,14 @@ const request = require('node-fetch'); const headers = { 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', { - method: 'DELETE', + method: 'PUT', headers: headers }) @@ -5918,20 +6061,21 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?uplo import requests headers = { 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', params={ - 'upload_id': '123e4567-e89b-12d3-a456-426614174000' +r = requests.put('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -5944,55 +6088,100 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}/files/multipart` +`PUT /games/{game-id}/mods/{mod-id}/files/{file-id}` -Terminate an active multipart upload session, a successful request will return `204 No Content`. +Edit the details of a published file. If you want to update fields other than the `changelog`, `version` and `active` status, you should add a new file instead. Successful request will return updated [Modfile Object](#modfile-object). + + Parameter|Type|Required|Description + ---|---|---|---| + version|string||Version of the file release (recommended format 1.0.0 - MAJOR.MINOR.PATCH). + changelog|string||Changelog of this release. + active|boolean||Flag this upload as the current release.

__NOTE:__ If the _active_ parameter causes the parent mods `modfile` parameter to change, a [__MODFILE_CHANGED__ event](#get-mod-events) will be fired, so game clients know there is an update available for this mod. + metadata_blob|string||Metadata stored by the game developer which may include properties such as what version of the game this file is compatible with. > Example response ```json - 204 No Content +{ + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] +} ``` -

Responses

+

Cross-Platform Filtering

+ +Cross-platform submissions are supported on this endpoint. If the parent game supports cross-platform modfiles, and this modfile is approved, making a request with the active parameter will set the modfile live on all approved platforms. + +

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Update Successful|[Modfile Object](#schemamodfile_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15007|The authenticated user does not have permission to update modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15033|The authenticated user does not have permission to update modfile metadata for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) -## Get Multipart Upload Sessions +## Delete Modfile > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions?api_key=YourApiKey \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id} \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions?api_key=YourApiKey HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id} HTTP/1.1 Host: *.modapi.io Accept: application/json +Authorization: Bearer {access-token} +Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', + method: 'delete', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -6004,13 +6193,15 @@ $.ajax({ const request = require('node-fetch'); const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', { - method: 'GET', + method: 'DELETE', headers: headers }) @@ -6024,20 +6215,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sess ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions', params={ - 'api_key': 'YourApiKey' +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -6050,76 +6243,62 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/files/multipart/sessions` - -Get all upload sessions belonging to the authenticated user for the corresponding mod. Successful request will return an array of [Multipart Upload Part Objects](#get-multipart-upload-sessions). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +`DELETE /games/{game-id}/mods/{mod-id}/files/{file-id}` - Filter|Type|Description - ---|---|--- - status|integer|Status of the upload session:

__0__ = Incomplete (default)
__1__ = Pending
__2__ = Processing
__3__ = Completed
__4__ = Cancelled +Delete a modfile. Successful request will return `204 No Content`.

__NOTE:__ A modfile can never be removed if it is the current active release for the corresponding mod regardless of user permissions. Furthermore, this ability is only available if you are authenticated as the game administrator for this game _or_ are the original uploader of the modfile. > Example response ```json -{ - "data": [ - { - "upload_id": "123e4567-e89b-12d3-a456-426614174000", - "status": 0 - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 -} + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Multipart Upload Sessions](#schemaget_multipart_upload_sessions) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15008|The authenticated user does not have permission to delete modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15009|The live modfile for a mod cannot be deleted.|[Error Object](#schemaerror_object) -## Complete Multipart Upload Session +## Manage Platform Status > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete?upload_id=123e4567-e89b-12d3-a456-426614174000 \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms \ -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete?upload_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms HTTP/1.1 Host: *.modapi.io Accept: application/json Authorization: Bearer {access-token} +Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms', method: 'post', - data: '?upload_id=123e4567-e89b-12d3-a456-426614174000', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -6132,11 +6311,12 @@ const request = require('node-fetch'); const headers = { 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete?upload_id=123e4567-e89b-12d3-a456-426614174000', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms', { method: 'POST', @@ -6153,18 +6333,19 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/comp import requests headers = { 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete', params={ - 'upload_id': '123e4567-e89b-12d3-a456-426614174000' +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete?upload_id=123e4567-e89b-12d3-a456-426614174000"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/{file-id}/platforms"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -6179,68 +6360,92 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/files/multipart/complete` +`POST /games/{game-id}/mods/{mod-id}/files/{file-id}/platforms` -Complete an active multipart upload session, this endpoint assumes that you have already uploaded - all individual parts. A successful request will return a `200 OK` response code and return a single [Multipart Upload Object](#multipart-upload-object). +Manage the platform status of a particular modfile. This endpoint does not set any file live, instead it allows you to approve and deny new uploads. To set a file as the *live* file for the approved platforms after you have reviewed them, you must call the [Edit Modfile](#update-modfile) with the active flag enabled. + + __NOTE:__ This is ony applicable if the parent game has cross-platform moderation enabled. A successful request will return the updated [Modfile object](#modfile-object). + + Parameter|Type|Required|Description + ---|---|---|---| + approved|array||An array containing one or more [platform strings](#targeting-a-platform) that the specified modfile is approved for. + denied|array||An array containing one or more [platform strings](#targeting-a-platform) that the specified modfile is denied for.

__NOTE:__ You cannot mark a live modfile as denied, if a modfile is live the only option to remove it is to set another [existing modfile](#edit-modfile) as the live modfile for that platform, or add a [new modfile](#add-modfile). > Example response ```json { - "upload_id": "123e4567-e89b-12d3-a456-426614174000", - "status": 0 + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Multipart Upload Object](#schemamultipart_upload_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15006|The authenticated user does not have permission to upload modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request.|[Modfile Object](#schemamodfile_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15007|The authenticated user does not have permission to edit the platforms for the specified modfile, ensure the user is a member of parent game team.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14037|The parent game doesn't cross-platform modfile submissions.|[Error Object](#schemaerror_object) -# Subscribe +# Files (Multipart Uploads) -## Subscribe To Mod +## Get Multipart Upload Parts > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json -Authorization: Bearer {access-token} -Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', - method: 'post', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -6252,15 +6457,13 @@ $.ajax({ const request = require('node-fetch'); const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?api_key=YourApiKey', { - method: 'POST', + method: 'GET', headers: headers }) @@ -6274,22 +6477,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -6302,191 +6503,79 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/subscribe` +`GET /games/{game-id}/mods/{mod-id}/files/multipart` -Subscribe the _authenticated user_ to a corresponding mod. No body parameters are required for this action. Successful request will return the [Mod Object](#mod-object) of the newly subscribed mod.

__NOTE:__ Users can subscribe to mods via mod.io, we recommend you poll or call the [Get User Events](#get-user-events) endpoint when needed, to keep a users mods collection up to date. +Get all uploaded parts for a corresponding upload session. Successful request will return an array of [Multipart Upload Part Objects](#get-multipart-upload-parts-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. > Example response ```json { - "id": 2, - "game_id": 2, - "status": 1, - "visible": 1, - "submitted_by": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1492564103, - "date_updated": 1499841487, - "date_live": 1499841403, - "maturity_option": 0, - "community_options": 3, - "monetisation_options": 0, - "price": 0, - "tax": 0, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "homepage_url": "https://www.rogue-hdpack.com/", - "name": "Rogue Knight HD Pack", - "name_id": "rogue-knight-hd-pack", - "summary": "It's time to bask in the glory of beautiful 4k textures!", - "description": "

Rogue HD Pack does exactly what you thi...", - "description_plaintext": "Rogue HD Pack does exactly what you thi...", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", - "media": { - "youtube": [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ], - "sketchfab": [ - "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" - ], - "images": [ - { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - } - ] - }, - "modfile": { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] - }, - "platforms": [ - { - "platform": "windows", - "modfile_live": 1 - } - ], - "metadata_kvp": [ + "data": [ { - "metakey": "pistol-dmg", - "metavalue": "800" - } - ], - "tags": [ + "upload_id": "123e4567-e89b-12d3-a456-426614174000", + "part_number": 1, + "part_size": 52428800, + "date_added": 1499846132 + }, { - "name": "Unity", - "date_added": 1499841487 + ... } ], - "stats": { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 - } + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Subscription Successful|[Mod Object](#schemamod_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15004|The authenticated user is already subscribed to the mod.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15000|The requested mod cannot be subscribed to at this time due to a DMCA takedown request.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15001|The requested mod cannot be subscribed to due to being marked as 'hidden'.|[Error Object](#schemaerror_object) -### Response Headers - -Status|Header|Type|Format|Description ----|---|---|---|---| -201|Location|string||URL to newly created resource - +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Multipart Upload Parts](#schemaget_multipart_upload_parts) -## Unsubscribe From Mod +## Add Multipart Upload Part > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe \ +curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000 \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Content-Range: bytes 0-52428799/209715196' \ + -H 'Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=' \ -H 'Accept: application/json' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe HTTP/1.1 +PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1 Host: *.modapi.io Accept: application/json Authorization: Bearer {access-token} -Content-Type: application/x-www-form-urlencoded +Content-Range: bytes 0-52428799/209715196 +Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= ``` ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Range':'bytes 0-52428799/209715196', + 'Digest':'sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', - method: 'delete', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', + method: 'put', + data: '?upload_id=123e4567-e89b-12d3-a456-426614174000', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -6499,14 +6588,15 @@ const request = require('node-fetch'); const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Range':'bytes 0-52428799/209715196', + 'Digest':'sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000', { - method: 'DELETE', + method: 'PUT', headers: headers }) @@ -6521,21 +6611,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Range': 'bytes 0-52428799/209715196', + 'Digest': 'sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=', 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', params={ - +r = requests.put('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', params={ + 'upload_id': '123e4567-e89b-12d3-a456-426614174000' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -6548,57 +6639,90 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}/subscribe` +`PUT /games/{game-id}/mods/{mod-id}/files/multipart` -Unsubscribe the _authenticated user_ from the corresponding mod. No body parameters are required for this action. Successful request will return `204 No Content`.

__NOTE:__ Users can unsubscribe from mods via mod.io, we recommend you poll or call the [Get Mod Events](#get-mod-events) endpoint when needed, to keep a users mods collection up to date. +Add a new multipart upload part to an [existing upload session](#create-multipart-upload-session). All parts must be exactly 50MB (Mebibyte) in size unless it is the final part which can be smaller. A successful request will return a single [Multipart Upload Part Object](#multipart-upload-object). + + __NOTE__: Unlike other POST endpoints on this service, the body of this request should contain no form parameters and instead be the data described in the byte range of the Content-Range header of the request. + + Query Parameters|Required|type|Description + ---|---|---|---| + upload_id|true|string|The `upload_id` of the existing upload session to upload the part for. + + Header Parameters|Required|Description + ---|---|---|---| + Content-Range|true|The [Content-Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) of the part you are sending, in bytes. + Digest||Optional [Digest](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Digest) for part integrity checks once the part has been uploaded. > Example response ```json - 204 No Content +{ + "upload_id": "123e4567-e89b-12d3-a456-426614174000", + "part_number": 1, + "part_size": 52428800, + "date_added": 1499846132 +} ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15005|The requested user is not currently subscribed to the requested mod.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Multipart Upload Part Object](#schemamultipart_upload_part_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29008|The `Content-Range` header is missing from your request.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29009|The unit within the Content-Range header must be of type: bytes.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29010|The Content-Range header must not include wild-carded values, as they are unsupported (an asterisk cannot be included).|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29011|The Content-Range header contains a non numeric value.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29014|The Content-Range header contains an invalid range, ensure that the finishing byte is greater than the starting byte.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29012|The Content-Range header does not match the required pattern.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29013|The size of the part provided is either too big, or too small.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29026|The finish byte of that range must be 1 byte less than the total file size specified.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29005|The Digest header contains more than one value, please ensure only the digest for the content body is provided.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29006|An algorithm indicated in the Digest header is unsupported, please use one of the following algorithms instead: SHA-256, CRC32C.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29015|An uploaded part with the specified start - finish byte range has already been uploaded to that session. If this is in error, you may need to abort the upload session, and start again.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15006|The authenticated user does not have permission to upload modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) -# Comments - -## Get Guide Comments +## Create Multipart Upload Session > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key=YourApiKey \ - -H 'Accept: application/json' +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Accept: application/json' \ + -d 'filename=testfile.zip' \ + -d 'nonce=a93d389804ee0490f1903ab26500a66a695ce65fa7ecb074d79771857d074355' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key=YourApiKey HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', + method: 'post', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -6608,16 +6732,21 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "filename": "testfile.zip", + "nonce": "a93d389804ee0490f1903ab26500a66a695ce65fa7ecb074d79771857d074355" +}'; const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', { - method: 'GET', - + method: 'POST', + body: inputBody, headers: headers }) .then(function(res) { @@ -6630,20 +6759,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', params={ - 'api_key': 'YourApiKey' +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -6656,91 +6787,54 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/guides/{guide-id}/comments` +`POST /games/{game-id}/mods/{mod-id}/files/multipart` -Get all comments posted in the guides profile. Successful request will return an array of [Comment Objects](#get-guide-comments-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Create a new multipart upload session. A successful request will return a single [Multipart Upload Object](#multipart-upload-object). - Filter|Type|Description - ---|---|--- - id|integer|Unique id of the comment. - resource_id|integer|Unique id of the resource (guide). - submitted_by|integer|Unique id of the user who posted the comment. - date_added|integer|Unix timestamp of date comment was posted. - reply_id|integer|Id of the parent comment this comment is replying to (can be 0 if the comment is not a reply). - thread_position|string|Levels of nesting in a comment thread. You should order by this field, to maintain comment grouping. How it works:

- The first comment will have the position '01'.
- The second comment will have the position '02'.
- If someone responds to the second comment the position will be '02.01'.
- A maximum of 3 levels is supported. - karma|integer|Karma received for the comment (can be positive or negative). - content|string|Contents of the comment. + __NOTE:__ The multipart upload system is designed for uploading large files up to 20GB in size. If uploading files less than 100MB, we recommend using the [Add Modfile](#add-modfile) endpoint. + + Parameter|Type|Required|Description + ---|---|---|---| + filename|string|true|The filename of the file once all the parts have been [uploaded](#add-multipart-upload-part). The filename must include the `.zip` extension and cannot exceed 100 characters. + nonce|string||An optional nonce to provide to prevent duplicate upload sessions from being created concurrently. Maximum of 64 characters. > Example response ```json { - "data": [ - { - "id": 2, - "game_id": 2, - "mod_id": 2, - "resource_id": 2, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1499841487, - "reply_id": 0, - "thread_position": "01", - "karma": 1, - "karma_guest": 0, - "content": "Hey guest, you should check out this mod!" - } - ], - "result_count": 1, - "result_offset": 0, - "result_limit": 100, - "result_total": 1 + "upload_id": "123e4567-e89b-12d3-a456-426614174000", + "status": 0 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||OK|[Get Guide Comments](#schemaget_guide_comments) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Multipart Upload Object](#schemamultipart_upload_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|29002|The nonce you provided was already associated with a completed upload session. If you wish to start a new upload you should regenerate the nonce parameter.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15006|The authenticated user does not have permission to upload modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) -## Add Guide Comment +## Delete Multipart Upload Session > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000 \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' \ - -d 'replyid=0' \ - -d 'content=Hey @XanT, you should check out this mod!' + -H 'Accept: application/json' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded + Accept: application/json Authorization: Bearer {access-token} @@ -6749,15 +6843,14 @@ Authorization: Bearer {access-token} ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', - method: 'post', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', + method: 'delete', + data: '?upload_id=123e4567-e89b-12d3-a456-426614174000', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -6767,21 +6860,17 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "replyid": 0, - "content": "Hey @XanT, you should check out this mod!" -}'; + const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000', { - method: 'POST', - body: inputBody, + method: 'DELETE', + headers: headers }) .then(function(res) { @@ -6795,21 +6884,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', params={ - +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart', params={ + 'upload_id': '123e4567-e89b-12d3-a456-426614174000' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart?upload_id=123e4567-e89b-12d3-a456-426614174000"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -6822,78 +6910,39 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/guides/{guide-id}/comments` - -Add a comment for the corresponding guide. Successful request will return the newly created [Comment Object](#comment-object) and fire a __GUIDE_COMMENT_ADDED__ event. +`DELETE /games/{game-id}/mods/{mod-id}/files/multipart` - Parameter|Type|Required|Description - ---|---|---|---| - content|string|true|Contents of the comment. You can include @mentions to users, which will notify them that they have been tagged in this comment.

__Mention Markup__
- Format: `@`
- Example: `Hey @XanT, you should check out this guide!` - reply_id|integer||Id of the parent comment to reply to (can be 0 if the comment is not a reply and thus will not be nested). Default is 0. +Terminate an active multipart upload session, a successful request will return `204 No Content`. > Example response ```json -{ - "id": 2, - "game_id": 2, - "mod_id": 2, - "resource_id": 2, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1499841487, - "reply_id": 0, - "thread_position": "01", - "karma": 1, - "karma_guest": 0, - "content": "Hey guest, you should check out this mod!" -} + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Comment Object](#schemacomment_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|19042|The authenticated user does not have permission to submit comments on mod.io due to their access being revoked.|[Error Object](#schemaerror_object) -### Response Headers - -Status|Header|Type|Format|Description ----|---|---|---|---| -201|Location|string||URL to newly created resource - +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) -## Get Guide Comment +## Get Multipart Upload Sessions > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -6907,7 +6956,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -6925,7 +6974,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions?api_key=YourApiKey', { method: 'GET', @@ -6944,7 +6993,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -6952,7 +7001,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/sessions?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -6967,71 +7016,60 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/guides/{guide-id}/comments/{comment-id}` +`GET /games/{game-id}/mods/{mod-id}/files/multipart/sessions` -Get a Guide Comment. Successful request will return a single [Comment Object](#comment-object). +Get all upload sessions belonging to the authenticated user for the corresponding mod. Successful request will return an array of [Multipart Upload Part Objects](#get-multipart-upload-sessions). We recommended reading the [filtering documentation](#filtering) to return only the records you want. + + Filter|Type|Description + ---|---|--- + status|integer|Status of the upload session:

__0__ = Incomplete (default)
__1__ = Pending
__2__ = Processing
__3__ = Completed
__4__ = Cancelled > Example response ```json { - "id": 2, - "game_id": 2, - "mod_id": 2, - "resource_id": 2, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + "data": [ + { + "upload_id": "123e4567-e89b-12d3-a456-426614174000", + "status": 0 }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1499841487, - "reply_id": 0, - "thread_position": "01", - "karma": 1, - "karma_guest": 0, - "content": "Hey guest, you should check out this mod!" + { + ... + } + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Comment Object](#schemacomment_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Multipart Upload Sessions](#schemaget_multipart_upload_sessions) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) -## Update Guide Comment +## Complete Multipart Upload Session > Example request ```shell # You can also use wget -curl -X PUT https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id} \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete?upload_id=123e4567-e89b-12d3-a456-426614174000 \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' - -d 'content=Test comment' ``` ```http -PUT https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id} HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete?upload_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded + Accept: application/json Authorization: Bearer {access-token} @@ -7040,15 +7078,14 @@ Authorization: Bearer {access-token} ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', - method: 'put', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete', + method: 'post', + data: '?upload_id=123e4567-e89b-12d3-a456-426614174000', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -7058,20 +7095,17 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "content": "Test comment" -}'; + const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete?upload_id=123e4567-e89b-12d3-a456-426614174000', { - method: 'PUT', - body: inputBody, + method: 'POST', + headers: headers }) .then(function(res) { @@ -7085,21 +7119,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{commen import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.put('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', params={ - +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete', params={ + 'upload_id': '123e4567-e89b-12d3-a456-426614174000' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/files/multipart/complete?upload_id=123e4567-e89b-12d3-a456-426614174000"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("PUT"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -7112,64 +7145,40 @@ in.close(); System.out.println(response.toString()); ``` -`PUT /games/{game-id}/guides/{guide-id}/comments/{comment-id}` - -Update a comment for the corresponding guide. Successful request will return the updated [Comment Object](#comment-object). +`POST /games/{game-id}/mods/{mod-id}/files/multipart/complete` - Parameter|Type|Required|Description - ---|---|---|---| - content|string|true|Updated contents of the comment. +Complete an active multipart upload session, this endpoint assumes that you have already uploaded + all individual parts. A successful request will return a `200 OK` response code and return a single [Multipart Upload Object](#multipart-upload-object). > Example response ```json { - "id": 2, - "game_id": 2, - "mod_id": 2, - "resource_id": 2, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1499841487, - "reply_id": 0, - "thread_position": "01", - "karma": 1, - "karma_guest": 0, - "content": "Hey guest, you should check out this mod!" + "upload_id": "123e4567-e89b-12d3-a456-426614174000", + "status": 0 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Update Successful|[Comment Object](#schemacomment_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Multipart Upload Object](#schemamultipart_upload_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15012|The authenticated user has had upload privileges restricted by mod.io admins, this is typically due to spam.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15006|The authenticated user does not have permission to upload modfiles for the specified mod, ensure the user is a team manager or administrator.|[Error Object](#schemaerror_object) -## Delete Guide Comment +# Subscribe + +## Subscribe To Mod > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id} \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' @@ -7177,7 +7186,7 @@ curl -X DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id} HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -7195,8 +7204,8 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', - method: 'delete', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', + method: 'post', headers: headers, success: function(data) { @@ -7215,9 +7224,9 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', { - method: 'DELETE', + method: 'POST', headers: headers }) @@ -7236,7 +7245,7 @@ headers = { 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', params={ }, headers = headers) @@ -7244,9 +7253,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -7259,53 +7268,301 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/guides/{guide-id}/comments/{comment-id}` +`POST /games/{game-id}/mods/{mod-id}/subscribe` -Delete a comment from a guide profile. Successful request will return `204 No Content` and fire a __GUIDE_COMMENT_DELETED__ event. +Subscribe the _authenticated user_ to a corresponding mod. No body parameters are required for this action. Successful request will return the [Mod Object](#mod-object) of the newly subscribed mod.

__NOTE:__ Users can subscribe to mods via mod.io, we recommend you poll or call the [Get User Events](#get-user-events) endpoint when needed, to keep a users mods collection up to date. > Example response ```json - 204 No Content +{ + "id": 2, + "game_id": 2, + "status": 1, + "visible": 1, + "submitted_by": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1492564103, + "date_updated": 1499841487, + "date_live": 1499841403, + "maturity_option": 0, + "community_options": 3, + "monetisation_options": 0, + "price": 0, + "tax": 0, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "homepage_url": "https://www.rogue-hdpack.com/", + "name": "Rogue Knight HD Pack", + "name_id": "rogue-knight-hd-pack", + "summary": "It's time to bask in the glory of beautiful 4k textures!", + "description": "

Rogue HD Pack does exactly what you thi...", + "description_plaintext": "Rogue HD Pack does exactly what you thi...", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", + "media": { + "youtube": [ + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ], + "sketchfab": [ + "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" + ], + "images": [ + { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + } + ] + }, + "modfile": { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] + }, + "platforms": [ + { + "platform": "windows", + "modfile_live": 1 + } + ], + "metadata_kvp": [ + { + "metakey": "pistol-dmg", + "metavalue": "800" + } + ], + "tags": [ + { + "name": "Unity", + "date_added": 1499841487 + } + ], + "stats": { + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 + } +} ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|19027|The authenticated user does not have permission to delete comments for this guide, this action is restricted to game team managers & administrators only.|[Error Object](#schemaerror_object) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Subscription Successful|[Mod Object](#schemamod_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15004|The authenticated user is already subscribed to the mod.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15000|The requested mod cannot be subscribed to at this time due to a DMCA takedown request.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15001|The requested mod cannot be subscribed to due to being marked as 'hidden'.|[Error Object](#schemaerror_object) +### Response Headers + +Status|Header|Type|Format|Description +---|---|---|---|---| +201|Location|string||URL to newly created resource + -## Get Mod Comments +## Unsubscribe From Mod > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments?api_key=YourApiKey \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments?api_key=YourApiKey HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe HTTP/1.1 Host: *.modapi.io Accept: application/json +Authorization: Bearer {access-token} +Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { - 'Accept':'application/json' + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', + 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', + method: 'delete', + + headers: headers, + success: function(data) { + console.log(JSON.stringify(data)); + } +}) +``` + +```javascript--nodejs +const request = require('node-fetch'); + +const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', + 'Accept':'application/json' + +}; + +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', +{ + method: 'DELETE', + + headers: headers +}) +.then(function(res) { + return res.json(); +}).then(function(body) { + console.log(body); +}); +``` + +```python +import requests +headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Accept': 'application/json' +} + +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe', params={ + +}, headers = headers) + +print r.json() +``` + +```java +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/subscribe"); +HttpURLConnection con = (HttpURLConnection) obj.openConnection(); +con.setRequestMethod("DELETE"); +int responseCode = con.getResponseCode(); +BufferedReader in = new BufferedReader( + new InputStreamReader(con.getInputStream())); +String inputLine; +StringBuffer response = new StringBuffer(); +while ((inputLine = in.readLine()) != null) { + response.append(inputLine); +} +in.close(); +System.out.println(response.toString()); +``` + +`DELETE /games/{game-id}/mods/{mod-id}/subscribe` + +Unsubscribe the _authenticated user_ from the corresponding mod. No body parameters are required for this action. Successful request will return `204 No Content`.

__NOTE:__ Users can unsubscribe from mods via mod.io, we recommend you poll or call the [Get Mod Events](#get-mod-events) endpoint when needed, to keep a users mods collection up to date. + +> Example response + +```json + 204 No Content + +``` +

Responses

+ +Status|Meaning|Error Ref|Description|Response Schema +---|---|----|---|---| +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15005|The requested user is not currently subscribed to the requested mod.|[Error Object](#schemaerror_object) + +# Comments + +## Get Guide Comments + +> Example request + +```shell +# You can also use wget +curl -X GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key=YourApiKey \ + -H 'Accept: application/json' + +``` + +```http +GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key=YourApiKey HTTP/1.1 +Host: *.modapi.io + +Accept: application/json + +``` + +```javascript +var headers = { + 'Accept':'application/json' + +}; + +$.ajax({ + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -7323,7 +7580,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key=YourApiKey', { method: 'GET', @@ -7342,7 +7599,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -7350,7 +7607,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -7365,15 +7622,14 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/comments` +`GET /games/{game-id}/guides/{guide-id}/comments` -Get all comments posted in the mods profile. Successful request will return an array of [Comment Objects](#get-mod-comments-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Get all comments posted in the guides profile. Successful request will return an array of [Comment Objects](#get-guide-comments-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. Filter|Type|Description ---|---|--- id|integer|Unique id of the comment. - mod_id|integer|Unique id of the parent mod. This is now deprecated and will be removed in future API versions, please use resource_id instead. - resource_id|integer|Unique id of the resource. + resource_id|integer|Unique id of the resource (guide). submitted_by|integer|Unique id of the user who posted the comment. date_added|integer|Unix timestamp of date comment was posted. reply_id|integer|Id of the parent comment this comment is replying to (can be 0 if the comment is not a reply). @@ -7423,22 +7679,22 @@ Get all comments posted in the mods profile. Successful request will return an a } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||OK|[Get Mod Comments](#schemaget_mod_comments) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||OK|[Get Guide Comments](#schemaget_guide_comments) -## Add Mod Comment +## Add Guide Comment > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ @@ -7448,7 +7704,7 @@ curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments \ ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -7465,7 +7721,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', method: 'post', headers: headers, @@ -7488,7 +7744,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', { method: 'POST', body: inputBody, @@ -7509,7 +7765,7 @@ headers = { 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments', params={ }, headers = headers) @@ -7517,7 +7773,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -7532,13 +7788,13 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/comments` +`POST /games/{game-id}/guides/{guide-id}/comments` -Add a comment for the corresponding mod. Successful request will return the newly created [Comment Object](#comment-object) and fire a __MOD_COMMENT_ADDED__ event. +Add a comment for the corresponding guide. Successful request will return the newly created [Comment Object](#comment-object) and fire a __GUIDE_COMMENT_ADDED__ event. Parameter|Type|Required|Description ---|---|---|---| - content|string|true|Contents of the comment. You can include @mentions to users, which will notify them that they have been tagged in this comment.

__Mention Markup__
- Format: `@`
- Example: `Hey @XanT, you should check out this mod!` + content|string|true|Contents of the comment. You can include @mentions to users, which will notify them that they have been tagged in this comment.

__Mention Markup__
- Format: `@`
- Example: `Hey @XanT, you should check out this guide!` reply_id|integer||Id of the parent comment to reply to (can be 0 if the comment is not a reply and thus will not be nested). Default is 0. > Example response @@ -7575,12 +7831,12 @@ Add a comment for the corresponding mod. Successful request will return the newl } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| 201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Comment Object](#schemacomment_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15042|The authenticated user does not have permission to submit comments on mod.io due to their access being revoked.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|19042|The authenticated user does not have permission to submit comments on mod.io due to their access being revoked.|[Error Object](#schemaerror_object) ### Response Headers Status|Header|Type|Format|Description @@ -7591,19 +7847,19 @@ Status|Header|Type|Format|Description To perform this request, you must be authenticated via one of the following methods: OAuth 2 (Scopes: write) -## Get Mod Comment +## Get Guide Comment > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -7617,7 +7873,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -7635,7 +7891,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}?api_key=YourApiKey', { method: 'GET', @@ -7654,7 +7910,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -7662,7 +7918,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -7677,9 +7933,9 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/comments/{comment-id}` +`GET /games/{game-id}/guides/{guide-id}/comments/{comment-id}` -Get a Mod Comment. Successful request will return a single [Comment Object](#comment-object). +Get a Guide Comment. Successful request will return a single [Comment Object](#comment-object). > Example response @@ -7715,7 +7971,7 @@ Get a Mod Comment. Successful request will return a single [Comment Object](#com } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| @@ -7724,13 +7980,13 @@ Status|Meaning|Error Ref|Description|Response Schema To perform this request, you must be authenticated via one of the following methods: api_key, OAuth 2 (Scopes: read) -## Update Mod Comment +## Update Guide Comment > Example request ```shell # You can also use wget -curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id} \ +curl -X PUT https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id} \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' @@ -7739,7 +7995,7 @@ curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comme ``` ```http -PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id} HTTP/1.1 +PUT https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id} HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -7756,7 +8012,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', method: 'put', headers: headers, @@ -7778,7 +8034,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', { method: 'PUT', body: inputBody, @@ -7799,7 +8055,7 @@ headers = { 'Accept': 'application/json' } -r = requests.put('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', params={ +r = requests.put('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', params={ }, headers = headers) @@ -7807,7 +8063,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); @@ -7822,9 +8078,9 @@ in.close(); System.out.println(response.toString()); ``` -`PUT /games/{game-id}/mods/{mod-id}/comments/{comment-id}` +`PUT /games/{game-id}/guides/{guide-id}/comments/{comment-id}` -Update a comment for the corresponding mod. Successful request will return the updated [Comment Object](#comment-object). +Update a comment for the corresponding guide. Successful request will return the updated [Comment Object](#comment-object). Parameter|Type|Required|Description ---|---|---|---| @@ -7864,7 +8120,7 @@ Update a comment for the corresponding mod. Successful request will return the u } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| @@ -7873,13 +8129,13 @@ Status|Meaning|Error Ref|Description|Response Schema To perform this request, you must be authenticated via one of the following methods: OAuth 2 (Scopes: write) -## Delete Mod Comment +## Delete Guide Comment > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id} \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id} \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' @@ -7887,7 +8143,7 @@ curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{co ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id} HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id} HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -7905,7 +8161,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', method: 'delete', headers: headers, @@ -7925,7 +8181,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', { method: 'DELETE', @@ -7946,7 +8202,7 @@ headers = { 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', params={ +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}', params={ }, headers = headers) @@ -7954,7 +8210,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); @@ -7969,9 +8225,9 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}/comments/{comment-id}` +`DELETE /games/{game-id}/guides/{guide-id}/comments/{comment-id}` -Delete a comment from a mod profile. Successful request will return `204 No Content` and fire a __MOD_COMMENT_DELETED__ event. +Delete a comment from a guide profile. Successful request will return `204 No Content` and fire a __GUIDE_COMMENT_DELETED__ event. > Example response @@ -7979,23 +8235,23 @@ Delete a comment from a mod profile. Successful request will return `204 No Cont 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| 204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15027|The authenticated user does not have permission to delete comments for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|19027|The authenticated user does not have permission to delete comments for this guide, this action is restricted to game team managers & administrators only.|[Error Object](#schemaerror_object) -## Add Mod Comment Karma +## Add Guide Comment Karma > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}/karma \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ @@ -8004,7 +8260,7 @@ curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comm ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}/karma HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -8021,7 +8277,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma', + url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}/karma', method: 'post', headers: headers, @@ -8043,7 +8299,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma', +fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}/karma', { method: 'POST', body: inputBody, @@ -8064,7 +8320,7 @@ headers = { 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}/karma', params={ }, headers = headers) @@ -8072,7 +8328,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}/comments/{comment-id}/karma"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -8087,9 +8343,9 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma` +`POST /games/{game-id}/guides/{guide-id}/comments/{comment-id}/karma` -Update the Karma rating in single increments or decrements for a corresponding mod comment. Successful request will return the updated [Comment Object](#comment-object). +Update the Karma rating in single increments or decrements for a corresponding guide comment. Successful request will return the updated [Comment Object](#comment-object). Parameter|Type|Required|Description ---|---|---|---| @@ -8129,7 +8385,7 @@ Update the Karma rating in single increments or decrements for a corresponding m } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| @@ -8138,43 +8394,35 @@ Status|Meaning|Error Ref|Description|Response Schema To perform this request, you must be authenticated via one of the following methods: OAuth 2 (Scopes: write) -# Media - -## Add Game Media +## Get Mod Comments > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/media \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: multipart/form-data' \ - -H 'Accept: application/json' \ - -d 'redirect_uris[]=undefined' +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments?api_key=YourApiKey \ + -H 'Accept: application/json' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/media HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io -Content-Type: multipart/form-data + Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/media', - method: 'post', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -8184,22 +8432,16 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "redirect_uris": [ - "string" - ] -}'; + const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/media', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments?api_key=YourApiKey', { - method: 'POST', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -8212,22 +8454,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/media', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/media', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/media"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -8240,59 +8480,92 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/media` - -Upload new media to a game. The request `Content-Type` header __must__ be `multipart/form-data` to submit image files. Any request you make to this endpoint *should* contain a binary file for each of the fields you want to update below. Successful request will return [Message Object](#message-object). +`GET /games/{game-id}/mods/{mod-id}/comments` - __NOTE:__ You can also add media to [your games profile](https://mod.io/me/library) on the mod.io website. This is the recommended approach. +Get all comments posted in the mods profile. Successful request will return an array of [Comment Objects](#get-mod-comments-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. - Parameter|Type|Required|Description - ---|---|---|---| - logo|file||Image file which will represent your games logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 640x360 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this logo to create three thumbnails with the dimensions of 320x180, 640x360 and 1280x720. - icon|file||Image file which will represent your games icon. Must be gif, jpg or png format and cannot exceed 1MB in filesize. Dimensions must be at least 64x64 and a transparent png that works on a colorful background is recommended. mod.io will use this icon to create three thumbnails with the dimensions of 64x64, 128x128 and 256x256. - header|file||Image file which will represent your games header. Must be gif, jpg or png format and cannot exceed 256KB in filesize. Dimensions of 400x100 and a light transparent png that works on a dark background is recommended. + Filter|Type|Description + ---|---|--- + id|integer|Unique id of the comment. + mod_id|integer|Unique id of the parent mod. This is now deprecated and will be removed in future API versions, please use resource_id instead. + resource_id|integer|Unique id of the resource. + submitted_by|integer|Unique id of the user who posted the comment. + date_added|integer|Unix timestamp of date comment was posted. + reply_id|integer|Id of the parent comment this comment is replying to (can be 0 if the comment is not a reply). + thread_position|string|Levels of nesting in a comment thread. You should order by this field, to maintain comment grouping. How it works:

- The first comment will have the position '01'.
- The second comment will have the position '02'.
- If someone responds to the second comment the position will be '02.01'.
- A maximum of 3 levels is supported. + karma|integer|Karma received for the comment (can be positive or negative). + content|string|Contents of the comment. > Example response ```json { - "code": 200, - "message": "You have successfully added new media to the specified game profile." + "data": [ + { + "id": 2, + "game_id": 2, + "mod_id": 2, + "resource_id": 2, + "user": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1499841487, + "reply_id": 0, + "thread_position": "01", + "karma": 1, + "karma_guest": 0, + "content": "Hey guest, you should check out this mod!" + } + ], + "result_count": 1, + "result_offset": 0, + "result_limit": 100, + "result_total": 1 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Media Successfully uploaded|[Message Object](#message-object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||OK|[Get Mod Comments](#schemaget_mod_comments) -## Add Mod Media +## Add Mod Comment > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: multipart/form-data' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ - -F 'logo=@/path/to/logo.jpg' \ - -F 'images=@/path/to/image-collection.zip' \ - -F 'image1=@/path/to/image1.jpg' \ - -F 'image2=@/path/to/image2.jpg' \ - -F 'youtube[]=https://www.youtube.com/watch?v=dQw4w9WgXcQ' \ - -F 'sketchfab[]=https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74' + -d 'replyid=0' \ + -d 'content=Hey @XanT, you should check out this mod!' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments HTTP/1.1 Host: *.modapi.io -Content-Type: multipart/form-data +Content-Type: application/x-www-form-urlencoded Accept: application/json Authorization: Bearer {access-token} @@ -8301,13 +8574,13 @@ Authorization: Bearer {access-token} ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', method: 'post', headers: headers, @@ -8320,21 +8593,17 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "logo": "@/path/to/logo.jpg", - "images": "@/path/to/image-collection.zip", - "image1": "@/path/to/image1.jpg", - "image2": "@/path/to/image2.jpg", - "youtube": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", - "sketchfab": "https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74" + "replyid": 0, + "content": "Hey @XanT, you should check out this mod!" }'; const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', { method: 'POST', body: inputBody, @@ -8351,11 +8620,11 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'multipart/form-data', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments', params={ }, headers = headers) @@ -8363,7 +8632,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -8378,34 +8647,55 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/media` - -This endpoint is very flexible and will add any images posted to the mods gallery regardless of their body name providing they are a valid image. The request `Content-Type` header __must__ be `multipart/form-data` to submit image files. Successful request will return a [Message Object](#message-object). +`POST /games/{game-id}/mods/{mod-id}/comments` - __NOTE:__ You can also add media to [your mods profile](https://mod.io/me/library) on the mod.io website. This is the easiest way. +Add a comment for the corresponding mod. Successful request will return the newly created [Comment Object](#comment-object) and fire a __MOD_COMMENT_ADDED__ event. Parameter|Type|Required|Description ---|---|---|---| - logo|file||Image file which will represent your mods logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this logo to create three thumbnails with the dimensions of 320x180, 640x360 and 1280x720. - images|zip||Zip archive of images to add to the mods gallery. Only valid gif, jpg and png images in the zip file will be processed. The filename __must be images.zip__ all other zips will be ignored. Alternatively you can POST one or more images to this endpoint and they will be detected and added to the mods gallery. - youtube[]|string||Full Youtube link(s) you want to add. Every Youtube link to add requires a separate field with youtube[] as the key (eg. youtube[]=https://www.youtube.com/watch?v=IGVZOLV9SPo, youtube[]=https://www.youtube.com/watch?v=5nY6fjZ3EUc) - sketchfab[]|string||Full Sketchfab link(s) you want to add. Every Sketchfab link to add requires a separate field with sketchfab[] as the key (eg. sketchfab[]=https://sketchfab.com/models/71f04e390ff54e5f8d9a51b4e1caab7e, sketchfab[]=https://sketchfab.com/models/5c85e649dd854cb58c2b9af081ebb0ff) + content|string|true|Contents of the comment. You can include @mentions to users, which will notify them that they have been tagged in this comment.

__Mention Markup__
- Format: `@`
- Example: `Hey @XanT, you should check out this mod!` + reply_id|integer||Id of the parent comment to reply to (can be 0 if the comment is not a reply and thus will not be nested). Default is 0. > Example response ```json { - "code": 201, - "message": "You have successfully added new media to the specified mod." + "id": 2, + "game_id": 2, + "mod_id": 2, + "resource_id": 2, + "user": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1499841487, + "reply_id": 0, + "thread_position": "01", + "karma": 1, + "karma_guest": 0, + "content": "Hey guest, you should check out this mod!" } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Message Object](#message-object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15035|The authenticated user does not have permission to add media for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Comment Object](#schemacomment_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15042|The authenticated user does not have permission to submit comments on mod.io due to their access being revoked.|[Error Object](#schemaerror_object) ### Response Headers Status|Header|Type|Format|Description @@ -8416,43 +8706,35 @@ Status|Header|Type|Format|Description To perform this request, you must be authenticated via one of the following methods: OAuth 2 (Scopes: write) -## Delete Mod Media +## Get Mod Comment > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' \ - -d 'images[]=filename.jpg' \ - -d 'youtube[]=https://www.youtube.com/watch?v=dQw4w9WgXcQ' \ - -d 'sketchfab[]=https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74' +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}?api_key=YourApiKey \ + -H 'Accept: application/json' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded + Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', - method: 'delete', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -8462,22 +8744,16 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "images": "filename.jpg", - "youtube": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", - "sketchfab": "https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74" -}'; + const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}?api_key=YourApiKey', { - method: 'DELETE', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -8490,22 +8766,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -8518,52 +8792,69 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}/media` - -Delete images, sketchfab or youtube links from a mod profile. Successful request will return `204 No Content`. - - __NOTE:__ You can also delete media from [your mods profile](https://mod.io/me/library) on the mod.io website. This is the easiest way. +`GET /games/{game-id}/mods/{mod-id}/comments/{comment-id}` - Parameter|Type|Required|Description - ---|---|---|---| - images[]|string||Filename of the image(s) you want to delete. Every image to delete requires a separate field with images[] as the key (eg. images[]=filename1.jpg, images[]=filename2.jpg) - youtube[]|string||Full Youtube link(s) you want to delete. Every Youtube link to delete requires a separate field with youtube[] as the key (eg. youtube[]=https://www.youtube.com/watch?v=IGVZOLV9SPo, youtube[]=https://www.youtube.com/watch?v=5nY6fjZ3EUc) - sketchfab[]|string||Full Sketchfab link(s) you want to delete. Every Sketchfab link to delete requires a separate field with sketchfab[] as the key (eg. sketchfab[]=https://sketchfab.com/models/71f04e390ff54e5f8d9a51b4e1caab7e, sketchfab[]=https://sketchfab.com/models/5c85e649dd854cb58c2b9af081ebb0ff) +Get a Mod Comment. Successful request will return a single [Comment Object](#comment-object). > Example response ```json - 204 No Content - -``` -

Responses

- -Status|Meaning|Error Ref|Description|Response Schema ----|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15036|The authenticated user does not have permission to delete media from this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) - -## Reorder Mod Media - -> Example request - -```shell -# You can also use wget -curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ +{ + "id": 2, + "game_id": 2, + "mod_id": 2, + "resource_id": 2, + "user": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1499841487, + "reply_id": 0, + "thread_position": "01", + "karma": 1, + "karma_guest": 0, + "content": "Hey guest, you should check out this mod!" +} + +``` +

Responses

+ +Status|Meaning|Error Ref|Description|Response Schema +---|---|----|---|---| +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Comment Object](#schemacomment_object) + +## Update Mod Comment + +> Example request + +```shell +# You can also use wget +curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id} \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' - -d 'images[]=filename.jpg' \ - -d 'youtube[]=https://www.youtube.com/watch?v=dQw4w9WgXcQ' \ - -d 'sketchfab[]=https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74' + -d 'content=Test comment' ``` ```http -PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder HTTP/1.1 +PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id} HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -8580,7 +8871,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', method: 'put', headers: headers, @@ -8593,9 +8884,7 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "images": "filename.jpg", - "youtube": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", - "sketchfab": "https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74" + "content": "Test comment" }'; const headers = { 'Authorization':'Bearer {access-token}', @@ -8604,7 +8893,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', { method: 'PUT', body: inputBody, @@ -8625,7 +8914,7 @@ headers = { 'Accept': 'application/json' } -r = requests.put('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder', params={ +r = requests.put('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', params={ }, headers = headers) @@ -8633,7 +8922,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); @@ -8648,66 +8937,92 @@ in.close(); System.out.println(response.toString()); ``` -`PUT /games/{game-id}/mods/{mod-id}/media/reorder` - -Reorder images, sketchfab or youtube links from a mod profile. Successful request will return `204 No Content`. +`PUT /games/{game-id}/mods/{mod-id}/comments/{comment-id}` - __NOTE:__ You can only reorder existing media, any differences in the media arrays will result in a `400 Bad Request` response. +Update a comment for the corresponding mod. Successful request will return the updated [Comment Object](#comment-object). Parameter|Type|Required|Description ---|---|---|---| - images[]|string||Filename of the image(s) you want to reorder. Every image to delete requires a separate field with images[] as the key (eg. images[]=filename1.jpg, images[]=filename2.jpg) - youtube[]|string||Full Youtube link(s) you want to reorder. Every Youtube link to delete requires a separate field with youtube[] as the key (eg. youtube[]=https://www.youtube.com/watch?v=IGVZOLV9SPo, youtube[]=https://www.youtube.com/watch?v=5nY6fjZ3EUc) - sketchfab[]|string||Full Sketchfab link(s) you want to reorder. Every Sketchfab link to delete requires a separate field with sketchfab[] as the key (eg. sketchfab[]=https://sketchfab.com/models/71f04e390ff54e5f8d9a51b4e1caab7e, sketchfab[]=https://sketchfab.com/models/5c85e649dd854cb58c2b9af081ebb0ff) + content|string|true|Updated contents of the comment. > Example response ```json - 204 No Content +{ + "id": 2, + "game_id": 2, + "mod_id": 2, + "resource_id": 2, + "user": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1499841487, + "reply_id": 0, + "thread_position": "01", + "karma": 1, + "karma_guest": 0, + "content": "Hey guest, you should check out this mod!" +} ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15036|The authenticated user does not have permission to delete media from this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15064|The request body contains media that does not exist on the mod, you can only reorder existing media.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Update Successful|[Comment Object](#schemacomment_object) -# Events - -## Get Mods Events +## Delete Mod Comment > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id} \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id} HTTP/1.1 Host: *.modapi.io Accept: application/json +Authorization: Bearer {access-token} +Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/events', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', + method: 'delete', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -8719,13 +9034,15 @@ $.ajax({ const request = require('node-fetch'); const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', { - method: 'GET', + method: 'DELETE', headers: headers }) @@ -8739,20 +9056,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey', ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/events', params={ - 'api_key': 'YourApiKey' +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -8765,83 +9084,61 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/events` - -Get all mods events for the corresponding game sorted by latest event first. Successful request will return an array of [Event Objects](#get-mod-events-2). - - __NOTE:__ We recommend you poll this endpoint to keep mods up-to-date. If polling this endpoint for updates you should store the `id` or `date_added` of the latest event, and on subsequent requests use that information [in the filter](#filtering), to return only newer events to process. +`DELETE /games/{game-id}/mods/{mod-id}/comments/{comment-id}` - Filter|Type|Description - ---|---|--- - id|integer|Unique id of the event object. - mod_id|integer|Unique id of the parent mod. - user_id|integer|Unique id of the user who performed the action. - date_added|integer|Unix timestamp of date mod event occurred. - event_type|string|Type of change that occurred:

__MODFILE_CHANGED__ = Live file changed
__MOD_AVAILABLE__ = Mod is marked as accepted and public
__MOD_UNAVAILABLE__ = Mod is marked as not accepted, deleted or hidden
__MOD_EDITED__ = The mod was updated (triggered when any column value changes)
__MOD_DELETED__ = The mod has been permanently erased. This is an orphan record, looking up this id will return no data
__MOD_TEAM_CHANGED__ = A user has joined or left the mod team
__MOD_COMMENT_ADDED__ = A comment has been published for a mod
__MOD_COMMENT_DELETED__ = A comment has been deleted from a mod - latest|boolean|_Default value is true_. Returns only the latest unique events, which is useful for checking if the live `modfile` has changed. - subscribed|boolean|_Default value is false_. Returns only events connected to mods the __authenticated user__ is subscribed to, which is useful for keeping the users mods up-to-date. +Delete a comment from a mod profile. Successful request will return `204 No Content` and fire a __MOD_COMMENT_DELETED__ event. > Example response ```json -{ - "data": [ - { - "id": 13, - "mod_id": 13, - "user_id": 13, - "date_added": 1499846132, - "event_type": "MODFILE_CHANGED" - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 -} + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Events](#schemaget_mod_events) +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15027|The authenticated user does not have permission to delete comments for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -## Get Mod Events +## Add Mod Comment Karma > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourApiKey \ - -H 'Accept: application/json' +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Accept: application/json' \ + -d 'karma=1' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourApiKey HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma', + method: 'post', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -8851,16 +9148,20 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "karma": "1" +}'; const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma', { - method: 'GET', - + method: 'POST', + body: inputBody, headers: headers }) .then(function(res) { @@ -8873,20 +9174,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourA ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events', params={ - 'api_key': 'YourApiKey' +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -8899,73 +9202,94 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/events` +`POST /games/{game-id}/mods/{mod-id}/comments/{comment-id}/karma` -Get the event log for a mod, showing changes made sorted by latest event first. Successful request will return an array of [Event Objects](#get-mod-events-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Update the Karma rating in single increments or decrements for a corresponding mod comment. Successful request will return the updated [Comment Object](#comment-object). + + Parameter|Type|Required|Description + ---|---|---|---| + karma|integer|true|Either 1 or -1 for positive and negative increments > Example response ```json { - "data": [ - { - "id": 13, - "mod_id": 13, - "user_id": 13, - "date_added": 1499846132, - "event_type": "MODFILE_CHANGED" - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "id": 2, + "game_id": 2, + "mod_id": 2, + "resource_id": 2, + "user": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1499841487, + "reply_id": 0, + "thread_position": "01", + "karma": 1, + "karma_guest": 0, + "content": "Hey guest, you should check out this mod!" } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Events](#schemaget_mod_events) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Update Successful|[Comment Object](#schemacomment_object) -# Tags +# Media -## Get Game Tag Options +## Add Game Media > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey \ - -H 'Accept: application/json' +curl -X POST https://*.modapi.io/v1/games/{game-id}/media \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: multipart/form-data' \ + -H 'Accept: application/json' \ + -d 'redirect_uris[]=undefined' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/media HTTP/1.1 Host: *.modapi.io - +Content-Type: multipart/form-data Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/tags', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/media', + method: 'post', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -8975,16 +9299,22 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "redirect_uris": [ + "string" + ] +}'; const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/media', { - method: 'GET', - + method: 'POST', + body: inputBody, headers: headers }) .then(function(res) { @@ -8997,20 +9327,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey', ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/tags', params={ - 'api_key': 'YourApiKey' +r = requests.post('https://*.modapi.io/v1/games/{game-id}/media', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/media"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -9023,69 +9355,59 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/tags` +`POST /games/{game-id}/media` -Get all tags for the corresponding game, that can be applied to any of its mods. Hidden tag groups will only be returned if the authenticated user is a team member of the parent game with either `Manager` or `Administrator` status. Successful request will return an array of [Game Tag Option Objects](#game-tag-option-object). +Upload new media to a game. The request `Content-Type` header __must__ be `multipart/form-data` to submit image files. Any request you make to this endpoint *should* contain a binary file for each of the fields you want to update below. Successful request will return [Message Object](#message-object). + + __NOTE:__ You can also add media to [your games profile](https://mod.io/me/library) on the mod.io website. This is the recommended approach. + + Parameter|Type|Required|Description + ---|---|---|---| + logo|file||Image file which will represent your games logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 640x360 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this logo to create three thumbnails with the dimensions of 320x180, 640x360 and 1280x720. + icon|file||Image file which will represent your games icon. Must be gif, jpg or png format and cannot exceed 1MB in filesize. Dimensions must be at least 64x64 and a transparent png that works on a colorful background is recommended. mod.io will use this icon to create three thumbnails with the dimensions of 64x64, 128x128 and 256x256. + header|file||Image file which will represent your games header. Must be gif, jpg or png format and cannot exceed 256KB in filesize. Dimensions of 400x100 and a light transparent png that works on a dark background is recommended. > Example response ```json { - "data": [ - { - "name": "Theme", - "type": "checkboxes", - "tags": [ - "Horror" - ], - "tag_count_map": { - "Horror": 52 - }, - "hidden": false, - "locked": false - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "code": 200, + "message": "You have successfully added new media to the specified game profile." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Game Tag Options](#schemaget_game_tag_options) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Media Successfully uploaded|[Message Object](#message-object) -## Add Game Tag Option +## Add Mod Media > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/tags \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Content-Type: multipart/form-data' \ -H 'Accept: application/json' \ - -d 'name=Difficulty' \ - -d 'type=dropdown' \ - -d 'hidden=false' \ - -d 'locked=false' \ - -d 'tags[]=easy&tags[]=medium&tags=hard' + -F 'logo=@/path/to/logo.jpg' \ + -F 'images=@/path/to/image-collection.zip' \ + -F 'image1=@/path/to/image1.jpg' \ + -F 'image2=@/path/to/image2.jpg' \ + -F 'youtube[]=https://www.youtube.com/watch?v=dQw4w9WgXcQ' \ + -F 'sketchfab[]=https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/tags HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded +Content-Type: multipart/form-data Accept: application/json Authorization: Bearer {access-token} @@ -9094,13 +9416,13 @@ Authorization: Bearer {access-token} ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/tags', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', method: 'post', headers: headers, @@ -9113,20 +9435,21 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "name": "Difficulty", - "type": "dropdown", - "hidden": "false", - "locked": "false", - "tags": "easy&tags[]=medium&tags=hard" + "logo": "@/path/to/logo.jpg", + "images": "@/path/to/image-collection.zip", + "image1": "@/path/to/image1.jpg", + "image2": "@/path/to/image2.jpg", + "youtube": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", + "sketchfab": "https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74" }'; const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', + 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/tags', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', { method: 'POST', body: inputBody, @@ -9143,11 +9466,11 @@ fetch('https://*.modapi.io/v1/games/{game-id}/tags', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/tags', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', params={ }, headers = headers) @@ -9155,7 +9478,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/tags"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -9170,37 +9493,34 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/tags` - -Add tags which mods can apply to their profiles. Successful request will return [Message Object](#message-object). +`POST /games/{game-id}/mods/{mod-id}/media` - Tagging is a critical feature that powers the searching and filtering of mods for your game, as well as allowing you to control how mods are installed and played. For example you might enforce mods to be a particular type (map, model, script, save, effects, blueprint), which dictates how you install it. You may use tags to specify what the mod replaces (building, prop, car, boat, character). Or perhaps the tags describe the theme of the mod (fun, scenic, realism). The implementation is up to you, but the more detail you support the better filtering and searching becomes. If you need to store more advanced information, you can also use [Metadata Key Value Pairs](#metadata). +This endpoint is very flexible and will add any images posted to the mods gallery regardless of their body name providing they are a valid image. The request `Content-Type` header __must__ be `multipart/form-data` to submit image files. Successful request will return a [Message Object](#message-object). - __NOTE:__ You can also manage tags by editing [your games profile](https://mod.io/me/library) on the mod.io website. This is the recommended approach. + __NOTE:__ You can also add media to [your mods profile](https://mod.io/me/library) on the mod.io website. This is the easiest way. Parameter|Type|Required|Description ---|---|---|---| - name|string|true|Name of the tag group, for example you may want to have 'Difficulty' as the name with 'Easy', 'Medium' and 'Hard' as the tag values.

__NOTE:__ If the tag name already exists, its parameters will be overwritten and new tags will be added to the group (an edit). There is a separate endpoint to [delete tags](#delete-game-tag-option). - type|string|true|Determines whether you allow users to only select one tag (dropdown) or multiple tags (checkbox):

- _dropdown_ = Mods can select only one tag from this group, dropdown menu shown on site profile.
- _checkboxes_ = Mods can select multiple tags from this group, checkboxes shown on site profile. - hidden|boolean||This group of tags should not be shown to users. Useful for games to tag special functionality, to filter on and use behind the scenes. You can also use [Metadata Key Value Pairs](#metadata) for more arbitrary data. - locked|boolean||This group of tags can only be edited by game admins. Useful for games to tag special functionality, which users can see and filter on. Can be combined with hidden if you want the tags group locked and hidden. - tags[]|string|true|Tags that mod creators can choose to apply to their mods. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=Easy, tags[]=Medium, tags[]=Hard). + logo|file||Image file which will represent your mods logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this logo to create three thumbnails with the dimensions of 320x180, 640x360 and 1280x720. + images|zip||Zip archive of images to add to the mods gallery. Only valid gif, jpg and png images in the zip file will be processed. The filename __must be images.zip__ all other zips will be ignored. Alternatively you can POST one or more images to this endpoint and they will be detected and added to the mods gallery. + youtube[]|string||Full Youtube link(s) you want to add. Every Youtube link to add requires a separate field with youtube[] as the key (eg. youtube[]=https://www.youtube.com/watch?v=IGVZOLV9SPo, youtube[]=https://www.youtube.com/watch?v=5nY6fjZ3EUc) + sketchfab[]|string||Full Sketchfab link(s) you want to add. Every Sketchfab link to add requires a separate field with sketchfab[] as the key (eg. sketchfab[]=https://sketchfab.com/models/71f04e390ff54e5f8d9a51b4e1caab7e, sketchfab[]=https://sketchfab.com/models/5c85e649dd854cb58c2b9af081ebb0ff) > Example response ```json { "code": 201, - "message": "You have successfully added categories/tags to the specified game." + "message": "You have successfully added new media to the specified mod." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#message-object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14012|The authenticated user does not have permission to submit tags for the specified game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Resource Created|[Message Object](#message-object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15035|The authenticated user does not have permission to add media for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) ### Response Headers Status|Header|Type|Format|Description @@ -9211,23 +9531,24 @@ Status|Header|Type|Format|Description To perform this request, you must be authenticated via one of the following methods: OAuth 2 (Scopes: write) -## Delete Game Tag Option +## Delete Mod Media > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/tags \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ - -d 'name=Difficulty' \ - -d 'tags[]=easy' + -d 'images[]=filename.jpg' \ + -d 'youtube[]=https://www.youtube.com/watch?v=dQw4w9WgXcQ' \ + -d 'sketchfab[]=https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/tags HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -9244,7 +9565,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/tags', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', method: 'delete', headers: headers, @@ -9257,8 +9578,9 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "name": "Difficulty", - "tags": "easy" + "images": "filename.jpg", + "youtube": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", + "sketchfab": "https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74" }'; const headers = { 'Authorization':'Bearer {access-token}', @@ -9267,7 +9589,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/tags', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', { method: 'DELETE', body: inputBody, @@ -9288,7 +9610,7 @@ headers = { 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/tags', params={ +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media', params={ }, headers = headers) @@ -9296,7 +9618,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/tags"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); @@ -9311,16 +9633,17 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/tags` +`DELETE /games/{game-id}/mods/{mod-id}/media` -Delete an entire group of tags or individual tags. Successful request will return `204 No Content`. +Delete images, sketchfab or youtube links from a mod profile. Successful request will return `204 No Content`. - __NOTE:__ You can also manage tags by editing [your games profile](https://mod.io/me/library) on the mod.io website. This is the recommended approach. + __NOTE:__ You can also delete media from [your mods profile](https://mod.io/me/library) on the mod.io website. This is the easiest way. Parameter|Type|Required|Description ---|---|---|---| - name|string|true|Name of the tag group that you want to delete tags from. - tags[]|string|true|Tags to delete from the game and all mod profiles. Every tag to delete requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2).

__NOTE:__ An empty value will delete the entire group. + images[]|string||Filename of the image(s) you want to delete. Every image to delete requires a separate field with images[] as the key (eg. images[]=filename1.jpg, images[]=filename2.jpg) + youtube[]|string||Full Youtube link(s) you want to delete. Every Youtube link to delete requires a separate field with youtube[] as the key (eg. youtube[]=https://www.youtube.com/watch?v=IGVZOLV9SPo, youtube[]=https://www.youtube.com/watch?v=5nY6fjZ3EUc) + sketchfab[]|string||Full Sketchfab link(s) you want to delete. Every Sketchfab link to delete requires a separate field with sketchfab[] as the key (eg. sketchfab[]=https://sketchfab.com/models/71f04e390ff54e5f8d9a51b4e1caab7e, sketchfab[]=https://sketchfab.com/models/5c85e649dd854cb58c2b9af081ebb0ff) > Example response @@ -9328,33 +9651,34 @@ Delete an entire group of tags or individual tags. Successful request will retur 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| 204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14014|The authenticated user does not have permission to delete tags for the specified game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15036|The authenticated user does not have permission to delete media from this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -## Rename Game Tag +## Reorder Mod Media > Example request ```shell # You can also use wget -curl -X PUT https://*.modapi.io/v1/games/{game-id}/tags/rename \ +curl -X PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' - -d 'from=Medium' \ - -d 'to=Intermediate' + -d 'images[]=filename.jpg' \ + -d 'youtube[]=https://www.youtube.com/watch?v=dQw4w9WgXcQ' \ + -d 'sketchfab[]=https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74' ``` ```http -PUT https://*.modapi.io/v1/games/{game-id}/tags/rename HTTP/1.1 +PUT https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -9371,7 +9695,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/tags/rename', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder', method: 'put', headers: headers, @@ -9384,8 +9708,9 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "from": "Medium", - "to": "Intermediate" + "images": "filename.jpg", + "youtube": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", + "sketchfab": "https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74" }'; const headers = { 'Authorization':'Bearer {access-token}', @@ -9394,7 +9719,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/tags/rename', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder', { method: 'PUT', body: inputBody, @@ -9415,7 +9740,7 @@ headers = { 'Accept': 'application/json' } -r = requests.put('https://*.modapi.io/v1/games/{game-id}/tags/rename', params={ +r = requests.put('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder', params={ }, headers = headers) @@ -9423,7 +9748,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/tags/rename"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/media/reorder"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); @@ -9438,47 +9763,50 @@ in.close(); System.out.println(response.toString()); ``` -`PUT /games/{game-id}/tags/rename` +`PUT /games/{game-id}/mods/{mod-id}/media/reorder` -Rename an existing tag, updating all mods in the progress. Successful request will return a [Message Object](#message-object). +Reorder images, sketchfab or youtube links from a mod profile. Successful request will return `204 No Content`. + + __NOTE:__ You can only reorder existing media, any differences in the media arrays will result in a `400 Bad Request` response. Parameter|Type|Required|Description ---|---|---|---| - from|string|true|The exact name of an existing tag you want to rename. - to|string|true|The name that you would like to rename the existing tag to. + images[]|string||Filename of the image(s) you want to reorder. Every image to delete requires a separate field with images[] as the key (eg. images[]=filename1.jpg, images[]=filename2.jpg) + youtube[]|string||Full Youtube link(s) you want to reorder. Every Youtube link to delete requires a separate field with youtube[] as the key (eg. youtube[]=https://www.youtube.com/watch?v=IGVZOLV9SPo, youtube[]=https://www.youtube.com/watch?v=5nY6fjZ3EUc) + sketchfab[]|string||Full Sketchfab link(s) you want to reorder. Every Sketchfab link to delete requires a separate field with sketchfab[] as the key (eg. sketchfab[]=https://sketchfab.com/models/71f04e390ff54e5f8d9a51b4e1caab7e, sketchfab[]=https://sketchfab.com/models/5c85e649dd854cb58c2b9af081ebb0ff) > Example response ```json -{ - "code": 200, - "message": "Your request was successful." -} + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request.|[Message Object](#schemamessage_object) -409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|14030|A request to rename the given tag is currently in progress.|[Error Object](#schemaerror_object) +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15036|The authenticated user does not have permission to delete media from this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15064|The request body contains media that does not exist on the mod, you can only reorder existing media.|[Error Object](#schemaerror_object) -## Get Mod Tags +# Events + +## Get Mods Events > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -9492,7 +9820,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/events', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -9510,7 +9838,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey', { method: 'GET', @@ -9529,7 +9857,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/events', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -9537,7 +9865,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/events?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -9552,14 +9880,21 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/tags` +`GET /games/{game-id}/mods/events` -Get all tags for the corresponding mod. Successful request will return an array of [Mod Tag Objects](#mod-tag-object). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Get all mods events for the corresponding game sorted by latest event first. Successful request will return an array of [Event Objects](#get-mod-events-2). + + __NOTE:__ We recommend you poll this endpoint to keep mods up-to-date. If polling this endpoint for updates you should store the `id` or `date_added` of the latest event, and on subsequent requests use that information [in the filter](#filtering), to return only newer events to process. Filter|Type|Description ---|---|--- - date_added|integer|Unix timestamp of date tag was added. - tag|string|String representation of the tag. You can check the eligible tags on the parent game object to determine all possible values for this field. + id|integer|Unique id of the event object. + mod_id|integer|Unique id of the parent mod. + user_id|integer|Unique id of the user who performed the action. + date_added|integer|Unix timestamp of date mod event occurred. + event_type|string|Type of change that occurred:

__MODFILE_CHANGED__ = Live file changed
__MOD_AVAILABLE__ = Mod is marked as accepted and public
__MOD_UNAVAILABLE__ = Mod is marked as not accepted, deleted or hidden
__MOD_EDITED__ = The mod was updated (triggered when any column value changes)
__MOD_DELETED__ = The mod has been permanently erased. This is an orphan record, looking up this id will return no data
__MOD_TEAM_CHANGED__ = A user has joined or left the mod team
__MOD_COMMENT_ADDED__ = A comment has been published for a mod
__MOD_COMMENT_DELETED__ = A comment has been deleted from a mod + latest|boolean|_Default value is true_. Returns only the latest unique events, which is useful for checking if the live `modfile` has changed. + subscribed|boolean|_Default value is false_. Returns only events connected to mods the __authenticated user__ is subscribed to, which is useful for keeping the users mods up-to-date. > Example response @@ -9567,8 +9902,11 @@ Get all tags for the corresponding mod. Successful request will return an array { "data": [ { - "name": "Unity", - "date_added": 1499841487 + "id": 13, + "mod_id": 13, + "user_id": 13, + "date_added": 1499846132, + "event_type": "MODFILE_CHANGED" }, { ... @@ -9581,50 +9919,44 @@ Get all tags for the corresponding mod. Successful request will return an array } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Tags](#schemaget_mod_tags) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Events](#schemaget_mod_events) -## Add Mod Tags +## Get Mod Events > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' \ - -d 'tags[]=easy' +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourApiKey \ + -H 'Accept: application/json' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded + Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', - method: 'post', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -9634,20 +9966,16 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "tags": "easy" -}'; + const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourApiKey', { - method: 'POST', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -9660,22 +9988,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/events?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -9688,74 +10014,73 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/tags` - -Add tags to a mod's profile. You can only add tags allowed by the parent game, which are listed in the `tag_option` column in the [Game's Object](#game-object). Successful request will return [Message Object](#message-object). +`GET /games/{game-id}/mods/{mod-id}/events` - Parameter|Type|Required|Description - ---|---|---|---| - tags[]|string|true|Tags to apply to the mod. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2). Only the tags pre-defined by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). +Get the event log for a mod, showing changes made sorted by latest event first. Successful request will return an array of [Event Objects](#get-mod-events-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. > Example response ```json { - "code": 200, - "message": "Your request was successful." + "data": [ + { + "id": 13, + "mod_id": 13, + "user_id": 13, + "date_added": 1499846132, + "event_type": "MODFILE_CHANGED" + }, + { + ... + } + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#schemamessage_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15037|The authenticated user does not have permission to submit tags for the specified mod. Ensure the user is part of the mod team before attempting the request again.|[Error Object](#schemaerror_object) -### Response Headers - -Status|Header|Type|Format|Description ----|---|---|---|---| -201|Location|string||URL to newly created resource - +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Events](#schemaget_mod_events) -## Delete Mod Tags +# Tags + +## Get Game Tag Options > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' \ - -d 'tags[]=easy' +curl -X GET https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey \ + -H 'Accept: application/json' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded + Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', - method: 'delete', - + url: 'https://*.modapi.io/v1/games/{game-id}/tags', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -9765,20 +10090,16 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "tags": "easy" -}'; + const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', +fetch('https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey', { - method: 'DELETE', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -9791,22 +10112,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/tags', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/tags?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -9819,48 +10138,67 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}/tags` - -Delete tags from a mod's profile. Deleting tags is identical to adding tags except the request method is `DELETE` instead of `POST`. Successful request will return `204 No Content`. +`GET /games/{game-id}/tags` - Parameter|Type|Required|Description - ---|---|---|---| - tags[]|string|true|Tags to delete from the mod's profile. Every tag to delete requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2). +Get all tags for the corresponding game, that can be applied to any of its mods. Hidden tag groups will only be returned if the authenticated user is a team member of the parent game with either `Manager` or `Administrator` status. Successful request will return an array of [Game Tag Option Objects](#game-tag-option-object). > Example response ```json - 204 No Content +{ + "data": [ + { + "name": "Theme", + "type": "checkboxes", + "tags": [ + "Horror" + ], + "tag_count_map": { + "Horror": 52 + }, + "hidden": false, + "locked": false + }, + { + ... + } + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 +} ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15038|The authenticated user does not have permission to delete tags for the specified mod. Ensure the user is part of the mod team before attempting the request again.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Game Tag Options](#schemaget_game_tag_options) -# Ratings - -## Add Mod Rating +## Add Game Tag Option > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/tags \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ - -d 'rating=1' + -d 'name=Difficulty' \ + -d 'type=dropdown' \ + -d 'hidden=false' \ + -d 'locked=false' \ + -d 'tags[]=easy&tags[]=medium&tags=hard' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/tags HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -9877,7 +10215,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings', + url: 'https://*.modapi.io/v1/games/{game-id}/tags', method: 'post', headers: headers, @@ -9890,16 +10228,20 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "rating": "1" -}'; -const headers = { - 'Authorization':'Bearer {access-token}', + "name": "Difficulty", + "type": "dropdown", + "hidden": "false", + "locked": "false", + "tags": "easy&tags[]=medium&tags=hard" +}'; +const headers = { + 'Authorization':'Bearer {access-token}', 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings', +fetch('https://*.modapi.io/v1/games/{game-id}/tags', { method: 'POST', body: inputBody, @@ -9920,7 +10262,7 @@ headers = { 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/tags', params={ }, headers = headers) @@ -9928,7 +10270,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/tags"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -9943,67 +10285,83 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/ratings` +`POST /games/{game-id}/tags` -Submit a positive or negative rating for a mod. Each user can supply only one rating for a mod, subsequent ratings will override the old value. Successful request will return [Message Object](#message-object). +Add tags which mods can apply to their profiles. Successful request will return [Message Object](#message-object). - __NOTE:__ You can order mods by their rating, and view their rating in the [Mod Object](#mod-object). + Tagging is a critical feature that powers the searching and filtering of mods for your game, as well as allowing you to control how mods are installed and played. For example you might enforce mods to be a particular type (map, model, script, save, effects, blueprint), which dictates how you install it. You may use tags to specify what the mod replaces (building, prop, car, boat, character). Or perhaps the tags describe the theme of the mod (fun, scenic, realism). The implementation is up to you, but the more detail you support the better filtering and searching becomes. If you need to store more advanced information, you can also use [Metadata Key Value Pairs](#metadata). + + __NOTE:__ You can also manage tags by editing [your games profile](https://mod.io/me/library) on the mod.io website. This is the recommended approach. Parameter|Type|Required|Description ---|---|---|---| - rating|integer|true|The _authenticated users_ mod rating:

__1__ = Positive rating (thumbs up)
__-1__ = Negative rating (thumbs down)
__0__ = No rating (removes any previous submitted rating) + name|string|true|Name of the tag group, for example you may want to have 'Difficulty' as the name with 'Easy', 'Medium' and 'Hard' as the tag values.

__NOTE:__ If the tag name already exists, its parameters will be overwritten and new tags will be added to the group (an edit). There is a separate endpoint to [delete tags](#delete-game-tag-option). + type|string|true|Determines whether you allow users to only select one tag (dropdown) or multiple tags (checkbox):

- _dropdown_ = Mods can select only one tag from this group, dropdown menu shown on site profile.
- _checkboxes_ = Mods can select multiple tags from this group, checkboxes shown on site profile. + hidden|boolean||This group of tags should not be shown to users. Useful for games to tag special functionality, to filter on and use behind the scenes. You can also use [Metadata Key Value Pairs](#metadata) for more arbitrary data. + locked|boolean||This group of tags can only be edited by game admins. Useful for games to tag special functionality, which users can see and filter on. Can be combined with hidden if you want the tags group locked and hidden. + tags[]|string|true|Tags that mod creators can choose to apply to their mods. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=Easy, tags[]=Medium, tags[]=Hard). > Example response ```json { "code": 201, - "message": "You have successfully submitted a rating for the specified mod." + "message": "You have successfully added categories/tags to the specified game." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| 201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#message-object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15028|The authenticated user has already submitted a rating for this mod.|[Error Object](#schemaerror_object) -400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15043|The authenticated user is trying to revert a rating that doesn't exist.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14012|The authenticated user does not have permission to submit tags for the specified game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) +### Response Headers + +Status|Header|Type|Format|Description +---|---|---|---|---| +201|Location|string||URL to newly created resource + -# Stats - -## Get Game Stats +## Delete Game Tag Option > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey \ - -H 'Accept: application/json' +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/tags \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Accept: application/json' \ + -d 'name=Difficulty' \ + -d 'tags[]=easy' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/tags HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/stats', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/tags', + method: 'delete', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -10013,16 +10371,21 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "name": "Difficulty", + "tags": "easy" +}'; const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/tags', { - method: 'GET', - + method: 'DELETE', + body: inputBody, headers: headers }) .then(function(res) { @@ -10035,20 +10398,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey', ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/stats', params={ - 'api_key': 'YourApiKey' +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/tags', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/tags"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -10061,62 +10426,69 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/stats` +`DELETE /games/{game-id}/tags` -Get game stats for the corresponding game. Successful request will return a single [Game Stats Object](#game-stats-object). +Delete an entire group of tags or individual tags. Successful request will return `204 No Content`. + + __NOTE:__ You can also manage tags by editing [your games profile](https://mod.io/me/library) on the mod.io website. This is the recommended approach. + + Parameter|Type|Required|Description + ---|---|---|---| + name|string|true|Name of the tag group that you want to delete tags from. + tags[]|string|true|Tags to delete from the game and all mod profiles. Every tag to delete requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2).

__NOTE:__ An empty value will delete the entire group. > Example response ```json -{ - "game_id": 2, - "mods_count_total": 13, - "mods_downloads_today": 204, - "mods_downloads_total": 27492, - "mods_downloads_daily_average": 1230, - "mods_subscribers_total": 16394, - "date_expires": 1492564103 -} + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Game Stats Object](#schemagame_stats_object) +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14014|The authenticated user does not have permission to delete tags for the specified game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) -## Get Mods Stats +## Rename Game Tag > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey \ +curl -X PUT https://*.modapi.io/v1/games/{game-id}/tags/rename \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' + -d 'from=Medium' \ + -d 'to=Intermediate' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey HTTP/1.1 +PUT https://*.modapi.io/v1/games/{game-id}/tags/rename HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/stats', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/tags/rename', + method: 'put', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -10126,16 +10498,21 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "from": "Medium", + "to": "Intermediate" +}'; const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/tags/rename', { - method: 'GET', - + method: 'PUT', + body: inputBody, headers: headers }) .then(function(res) { @@ -10148,20 +10525,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey', ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/stats', params={ - 'api_key': 'YourApiKey' +r = requests.put('https://*.modapi.io/v1/games/{game-id}/tags/rename', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/tags/rename"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -10174,75 +10553,47 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/stats` - -Get all mod stats for mods of the corresponding game. Successful request will return an array of [Mod Stats Objects](#get-mod-stats). +`PUT /games/{game-id}/tags/rename` - __NOTE:__ We highly recommend you apply filters to this endpoint to get only the results you need. For more information regarding filtering please see the [filtering](#filtering) section. +Rename an existing tag, updating all mods in the progress. Successful request will return a [Message Object](#message-object). - Filter|Type|Description - ---|---|--- - mod_id|integer|Unique id of the mod. - popularity_rank_position|integer|Current ranking by popularity for the corresponding mod. - popularity_rank_total_mods|integer|Global mod count in which `popularity_rank_position` is compared against. - downloads_total|integer|A sum of all modfile downloads for the corresponding mod. - subscribers_total|integer|A sum of all current subscribers for the corresponding mod. - ratings_positive|integer|Amount of positive ratings. - ratings_negative|integer|Amount of negative ratings. + Parameter|Type|Required|Description + ---|---|---|---| + from|string|true|The exact name of an existing tag you want to rename. + to|string|true|The name that you would like to rename the existing tag to. > Example response ```json { - "data": [ - { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "code": 200, + "message": "Your request was successful." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Stats](#schemaget_mod_stats) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request.|[Message Object](#schemamessage_object) +409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|14030|A request to rename the given tag is currently in progress.|[Error Object](#schemaerror_object) -## Get Mod Stats +## Get Mod Tags > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -10256,7 +10607,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -10274,7 +10625,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags?api_key=YourApiKey', { method: 'GET', @@ -10293,7 +10644,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -10301,7 +10652,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -10316,70 +10667,79 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/stats` +`GET /games/{game-id}/mods/{mod-id}/tags` -Get mod stats for the corresponding mod. Successful request will return a single [Mod Stats Object](#mod-stats-object). +Get all tags for the corresponding mod. Successful request will return an array of [Mod Tag Objects](#mod-tag-object). We recommended reading the [filtering documentation](#filtering) to return only the records you want. + + Filter|Type|Description + ---|---|--- + date_added|integer|Unix timestamp of date tag was added. + tag|string|String representation of the tag. You can check the eligible tags on the parent game object to determine all possible values for this field. > Example response ```json { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 -} - -``` -

Responses

- -Status|Meaning|Error Ref|Description|Response Schema ----|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Mod Stats Object](#schemamod_stats_object) + "data": [ + { + "name": "Unity", + "date_added": 1499841487 + }, + { + ... + } + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 +} + +``` +

Responses

+ +Status|Meaning|Error Ref|Description|Response Schema +---|---|----|---|---| +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Tags](#schemaget_mod_tags) -# Metadata - -## Get Mod KVP Metadata +## Add Mod Tags > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key=YourApiKey \ - -H 'Accept: application/json' +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Accept: application/json' \ + -d 'tags[]=easy' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key=YourApiKey HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', + method: 'post', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -10389,16 +10749,20 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "tags": "easy" +}'; const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', { - method: 'GET', - + method: 'POST', + body: inputBody, headers: headers }) .then(function(res) { @@ -10411,20 +10775,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key= ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', params={ - 'api_key': 'YourApiKey' +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -10437,55 +10803,55 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/metadatakvp` +`POST /games/{game-id}/mods/{mod-id}/tags` -Get all metadata stored by the game developer for this mod as searchable key value pairs. Successful request will return an array of [Metadata KVP Objects](#get-mod-kvp-metadata-2).

__NOTE:__ Metadata can also be stored as `metadata_blob` in the [Mod Object](#mod-object). +Add tags to a mod's profile. You can only add tags allowed by the parent game, which are listed in the `tag_option` column in the [Game's Object](#game-object). Successful request will return [Message Object](#message-object). + + Parameter|Type|Required|Description + ---|---|---|---| + tags[]|string|true|Tags to apply to the mod. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2). Only the tags pre-defined by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). > Example response ```json { - "data": [ - { - "metakey": "pistol-dmg", - "metavalue": "800" - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "code": 200, + "message": "Your request was successful." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod KVP Metadata](#schemaget_mod_kvp_metadata) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#schemamessage_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15037|The authenticated user does not have permission to submit tags for the specified mod. Ensure the user is part of the mod team before attempting the request again.|[Error Object](#schemaerror_object) +### Response Headers + +Status|Header|Type|Format|Description +---|---|---|---|---| +201|Location|string||URL to newly created resource + -## Add Mod KVP Metadata +## Delete Mod Tags > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ - -d 'metadata[]=pistol-dmg:88:400' + -d 'tags[]=easy' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -10502,8 +10868,8 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', - method: 'post', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', + method: 'delete', headers: headers, success: function(data) { @@ -10515,7 +10881,7 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "metadata": "pistol-dmg:88:400" + "tags": "easy" }'; const headers = { 'Authorization':'Bearer {access-token}', @@ -10524,9 +10890,9 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', { - method: 'POST', + method: 'DELETE', body: inputBody, headers: headers }) @@ -10545,7 +10911,7 @@ headers = { 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', params={ +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags', params={ }, headers = headers) @@ -10553,9 +10919,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/tags"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -10568,57 +10934,48 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/metadatakvp` - -Add metadata for this mod as searchable key value pairs. Metadata is useful to define how a mod works, or other information you need to display and manage the mod. Successful request will return [Message Object](#message-object).

For example: A mod might change gravity and the rate of fire of weapons, you could define these properties as key value pairs. We recommend the mod upload tool you create defines and submits metadata behind the scenes, because if these settings affect gameplay, invalid information may cause problems. +`DELETE /games/{game-id}/mods/{mod-id}/tags` - __NOTE:__ Metadata can also be stored as `metadata_blob` in the [Mod Object](#mod-object). +Delete tags from a mod's profile. Deleting tags is identical to adding tags except the request method is `DELETE` instead of `POST`. Successful request will return `204 No Content`. Parameter|Type|Required|Description ---|---|---|---| - metadata[]|string|true|Key value pairs you want to add where the the key and value are separated by a colon ':'. Every pair to add requires a separate field with metadata[] as the key (eg. metadata[]=pistol-dmg:800, metadata[]=gravity:9.8).

__NOTE:__ If the string contains multiple colons the split will occur on the first matched, eg. sword-speed-power:100:10 will become key: `sword-speed-power`, value: `100:10`). The following restrictions apply to the supplied metadata:

- Keys support alphanumeric, '_' and '-' characters only.
- Keys can map to multiple values (1-to-many relationship).
- Keys and values cannot exceed 255 characters in length.
- Key value pairs are searchable by exact match only. + tags[]|string|true|Tags to delete from the mod's profile. Every tag to delete requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2). > Example response ```json -{ - "code": 201, - "message": "You have successfully added new key-value metadata to the specified mod." -} + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#message-object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15033|The authenticated user does not have permission to add metadata to this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -### Response Headers - -Status|Header|Type|Format|Description ----|---|---|---|---| -201|Location|string||URL to newly created resource - +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15038|The authenticated user does not have permission to delete tags for the specified mod. Ensure the user is part of the mod team before attempting the request again.|[Error Object](#schemaerror_object) -## Delete Mod KVP Metadata +# Ratings + +## Add Mod Rating > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ - -d 'metadata[]=pistol-dmg:88:400' + -d 'rating=1' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -10635,8 +10992,8 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', - method: 'delete', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings', + method: 'post', headers: headers, success: function(data) { @@ -10648,7 +11005,7 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "metadata": "pistol-dmg:88:400" + "rating": "1" }'; const headers = { 'Authorization':'Bearer {access-token}', @@ -10657,9 +11014,9 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings', { - method: 'DELETE', + method: 'POST', body: inputBody, headers: headers }) @@ -10678,7 +11035,7 @@ headers = { 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings', params={ }, headers = headers) @@ -10686,9 +11043,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/ratings"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -10701,45 +11058,51 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}/metadatakvp` +`POST /games/{game-id}/mods/{mod-id}/ratings` -Delete key value pairs metadata defined for this mod. Successful request will return `204 No Content`. +Submit a positive or negative rating for a mod. Each user can supply only one rating for a mod, subsequent ratings will override the old value. Successful request will return [Message Object](#message-object). - Parameter|Type|Required|Description - ---|---|---|---| - metadata[]|string|true|Key value pairs you want to delete where the the key and value are separated by a colon ':'. Every pair to delete requires a separate field with metadata[] as the key (eg. metadata[]=pistol-dmg:800, metadata[]=gravity:9.8).

__NOTE:__ If the string contains only the key and no colon ':', _all_ metadata with that key will be removed. + __NOTE:__ You can order mods by their rating, and view their rating in the [Mod Object](#mod-object). + + Parameter|Type|Required|Description + ---|---|---|---| + rating|integer|true|The _authenticated users_ mod rating:

__1__ = Positive rating (thumbs up)
__-1__ = Negative rating (thumbs down)
__0__ = No rating (removes any previous submitted rating) > Example response ```json - 204 No Content +{ + "code": 201, + "message": "You have successfully submitted a rating for the specified mod." +} ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15034|The authenticated user does not have permission to delete metadata from this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#message-object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15028|The authenticated user has already submitted a rating for this mod.|[Error Object](#schemaerror_object) +400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|15043|The authenticated user is trying to revert a rating that doesn't exist.|[Error Object](#schemaerror_object) -# Dependencies +# Stats -## Get Mod Dependencies +## Get Game Stats > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -10753,7 +11116,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', + url: 'https://*.modapi.io/v1/games/{game-id}/stats', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -10771,7 +11134,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey', { method: 'GET', @@ -10790,7 +11153,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/stats', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -10798,7 +11161,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/stats?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -10813,122 +11176,62 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/dependencies` - -Get all dependencies the chosen mod has selected. This is useful if a mod requires other mods be installed for it to run. Successful request will return an array of [Mod Dependencies Objects](#get-mod-dependencies-2). - - __NOTE:__ This endpoint returns all mod dependencies, irrespective of their status, visibility or platform support. If your game automatically installs dependencies, we recommend moderating the use of this feature strictly, to ensure creators are not selecting _soft_ dependencies to promote or credit other mods, and dependencies are checked for suitability prior to install. - - For example: the official mod.io plugins where dependency support is enabled, typically subscribe users to all dependencies, so the mods suitability and synchronization can be managed by the subscription process. Following a similar process is recommend, particularly if enabling `recursive` dependency fetching, given it can result in many mods being returned. - - __DEPRECATION WARNING__: By default, this endpoint does not return dependencies recursively. However, in a future version of the API, dependencies _will_ be shown recursively by default. We suggest that you remove any custom implementation you may have in order to retrieve dependencies recursively, and instead use the `?recursive=true` query parameter to fetch all dependencies in a single request. +`GET /games/{game-id}/stats` - Filter|Type|Description - ---|---|--- - recursive|integer|Recommended. Include child dependencies in a recursive manner. A value of `true` will display dependencies up to a maximum depth of 5. A value of `false` will only display immediate dependencies.

Defaults to `false`.

__NOTE:__ This will be enabled by default in API v2. +Get game stats for the corresponding game. Successful request will return a single [Game Stats Object](#game-stats-object). > Example response ```json { - "data": [ - { - "mod_id": 231, - "name": "Example Mod", - "name_id": "rogue-knight-hd-pack", - "date_added": 1499841487, - "dependency_depth": 0, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "modfile": { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] - } - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "game_id": 2, + "mods_count_total": 13, + "mods_downloads_today": 204, + "mods_downloads_total": 27492, + "mods_downloads_daily_average": 1230, + "mods_subscribers_total": 16394, + "date_expires": 1492564103 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Dependencies](#schemaget_mod_dependencies) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Game Stats Object](#schemagame_stats_object) -## Add Mod Dependencies +## Get Mods Stats > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' \ - -d 'dependencies[]=284' +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey \ + -H 'Accept: application/json' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded + Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', - method: 'post', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/stats', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -10938,20 +11241,16 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "dependencies": "284" -}'; + const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey', { - method: 'POST', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -10964,22 +11263,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/stats', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/stats?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -10992,74 +11289,91 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/mods/{mod-id}/dependencies` +`GET /games/{game-id}/mods/stats` -Add mod dependencies required by the corresponding mod. A dependency is a mod that should be installed for this mod to run. Successful request will return [Message Object](#message-object). +Get all mod stats for mods of the corresponding game. Successful request will return an array of [Mod Stats Objects](#get-mod-stats). - Parameter|Type|Required|Description - ---|---|---|---| - dependencies[]|integer|true|One or more mod IDs that this mod is dependent on. Every dependency to add requires a separate field with dependencies[] as the key (eg. dependencies[]=1, dependencies[]=2). Max of 5 dependencies per request. + __NOTE:__ We highly recommend you apply filters to this endpoint to get only the results you need. For more information regarding filtering please see the [filtering](#filtering) section. + + Filter|Type|Description + ---|---|--- + mod_id|integer|Unique id of the mod. + popularity_rank_position|integer|Current ranking by popularity for the corresponding mod. + popularity_rank_total_mods|integer|Global mod count in which `popularity_rank_position` is compared against. + downloads_total|integer|A sum of all modfile downloads for the corresponding mod. + subscribers_total|integer|A sum of all current subscribers for the corresponding mod. + ratings_positive|integer|Amount of positive ratings. + ratings_negative|integer|Amount of negative ratings. > Example response ```json { - "code": 201, - "message": "You have successfully added new dependencies to the specified mod." + "data": [ + { + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 + }, + { + ... + } + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#message-object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15031|The authenticated user does not have permission to add dependencies for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -### Response Headers - -Status|Header|Type|Format|Description ----|---|---|---|---| -201|Location|string||URL to newly created resource - +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Stats](#schemaget_mod_stats) -## Delete Mod Dependencies +## Get Mod Stats > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' \ - -d 'dependencies[]=284' +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats?api_key=YourApiKey \ + -H 'Accept: application/json' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io -Content-Type: application/x-www-form-urlencoded + Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', - method: 'delete', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -11069,20 +11383,16 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); -const inputBody = '{ - "dependencies": "284" -}'; + const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats?api_key=YourApiKey', { - method: 'DELETE', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -11095,22 +11405,20 @@ fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/stats?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -11123,45 +11431,54 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/mods/{mod-id}/dependencies` - -Delete mod dependencies the corresponding mod has selected. Successful request will return `204 No Content`. +`GET /games/{game-id}/mods/{mod-id}/stats` - Parameter|Type|Required|Description - ---|---|---|---| - dependencies[]|integer|true|One or more mod IDs you want to delete as a dependency. Every dependency to delete requires a separate field with dependencies[] as the key (eg. dependencies[]=1, dependencies[]=2). +Get mod stats for the corresponding mod. Successful request will return a single [Mod Stats Object](#mod-stats-object). > Example response ```json - 204 No Content +{ + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 +} ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15032|The authenticated user does not have permission to delete dependencies for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Mod Stats Object](#schemamod_stats_object) -# Teams +# Metadata -## Get Mod Team Members +## Get Mod KVP Metadata > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -11175,7 +11492,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -11193,7 +11510,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key=YourApiKey', { method: 'GET', @@ -11212,7 +11529,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -11220,7 +11537,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -11235,18 +11552,9 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/mods/{mod-id}/team` - -Get all users that are part of a mod team. Successful request will return an array of [Team Member Objects](#team-member-object). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +`GET /games/{game-id}/mods/{mod-id}/metadatakvp` - Filter|Type|Required|Description - ---|---|---|---| - id|integer|Unique id of the team member record. - user_id|integer|Unique id of the user. - username|string|Username of the user. - level|integer|Level of permission the user has:

__1__ = Moderator (can moderate comments and content attached)
__4__ = Manager (moderator access, including uploading builds and editing settings except supply and team members)
__8__ = Administrator (full access, including editing the supply and team) - date_added|integer|Unix timestamp of the date the user was added to the team. - pending|integer|Has the user accepted the team invite?

__0__ = Accepted
__1__ = Pending +Get all metadata stored by the game developer for this mod as searchable key value pairs. Successful request will return an array of [Metadata KVP Objects](#get-mod-kvp-metadata-2).

__NOTE:__ Metadata can also be stored as `metadata_blob` in the [Mod Object](#mod-object). > Example response @@ -11254,28 +11562,8 @@ Get all users that are part of a mod team. Successful request will return an arr { "data": [ { - "id": 457, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "level": 8, - "date_added": 1492058857, - "position": "Turret Builder", - "invite_pending": 1 + "metakey": "pistol-dmg", + "metavalue": "800" }, { ... @@ -11288,37 +11576,35 @@ Get all users that are part of a mod team. Successful request will return an arr } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Team Members](#schemaget_team_members) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod KVP Metadata](#schemaget_mod_kvp_metadata) -# General - -## Get Resource Owner +## Add Mod KVP Metadata > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/general/ownership \ +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Accept: application/json' + -H 'Accept: application/json' \ + -d 'metadata[]=pistol-dmg:88:400' ``` ```http -POST https://*.modapi.io/v1/general/ownership HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json Authorization: Bearer {access-token} -Content-Type: application/x-www-form-urlencoded ``` @@ -11331,7 +11617,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/general/ownership', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', method: 'post', headers: headers, @@ -11343,7 +11629,9 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "metadata": "pistol-dmg:88:400" +}'; const headers = { 'Authorization':'Bearer {access-token}', 'Content-Type':'application/x-www-form-urlencoded', @@ -11351,10 +11639,10 @@ const headers = { }; -fetch('https://*.modapi.io/v1/general/ownership', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', { method: 'POST', - + body: inputBody, headers: headers }) .then(function(res) { @@ -11372,7 +11660,7 @@ headers = { 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/general/ownership', params={ +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', params={ }, headers = headers) @@ -11380,7 +11668,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/general/ownership"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); @@ -11395,71 +11683,57 @@ in.close(); System.out.println(response.toString()); ``` -`POST /general/ownership` +`POST /games/{game-id}/mods/{mod-id}/metadatakvp` -Get the user that is the original _submitter_ of a resource. Successful request will return a single [User Object](#user-object). +Add metadata for this mod as searchable key value pairs. Metadata is useful to define how a mod works, or other information you need to display and manage the mod. Successful request will return [Message Object](#message-object).

For example: A mod might change gravity and the rate of fire of weapons, you could define these properties as key value pairs. We recommend the mod upload tool you create defines and submits metadata behind the scenes, because if these settings affect gameplay, invalid information may cause problems. - __NOTE:__ Mods and games can be managed by teams of users, for the most accurate information you should use the [Team endpoints](#teams). + __NOTE:__ Metadata can also be stored as `metadata_blob` in the [Mod Object](#mod-object). Parameter|Type|Required|Description ---|---|---|---| - resource_type|string|true|Type of resource you are checking the ownership of. Must be one of the following values:

- _games_
- _mods_
- _files_ - resource_id|integer|true|Unique id of the resource you are checking the ownership of. + metadata[]|string|true|Key value pairs you want to add where the the key and value are separated by a colon ':'. Every pair to add requires a separate field with metadata[] as the key (eg. metadata[]=pistol-dmg:800, metadata[]=gravity:9.8).

__NOTE:__ If the string contains multiple colons the split will occur on the first matched, eg. sword-speed-power:100:10 will become key: `sword-speed-power`, value: `100:10`). The following restrictions apply to the supplied metadata:

- Keys support alphanumeric, '_' and '-' characters only.
- Keys can map to multiple values (1-to-many relationship).
- Keys and values cannot exceed 255 characters in length.
- Key value pairs are searchable by exact match only. > Example response ```json { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" + "code": 201, + "message": "You have successfully added new key-value metadata to the specified mod." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[User Object](#schemauser_object) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#message-object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15033|The authenticated user does not have permission to add metadata to this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +### Response Headers + +Status|Header|Type|Format|Description +---|---|---|---|---| +201|Location|string||URL to newly created resource + -# Reports - -## Submit Report +## Delete Mod KVP Metadata > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/report \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp \ -H 'Authorization: Bearer {access-token}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ - -d 'resource=mods' \ - -d 'id=3853' \ - -d 'type=1' \ - -d 'name=Name of the user submitting the report' \ - -d 'contact=Contact details of the user submitting the report' \ - -d 'summary=Detailed explanation for report here' + -d 'metadata[]=pistol-dmg:88:400' ``` ```http -POST https://*.modapi.io/v1/report HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp HTTP/1.1 Host: *.modapi.io Content-Type: application/x-www-form-urlencoded Accept: application/json @@ -11476,8 +11750,8 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/report', - method: 'post', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', + method: 'delete', headers: headers, success: function(data) { @@ -11489,12 +11763,7 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); const inputBody = '{ - "resource": "mods", - "id": "3853", - "type": "1", - "name": "Name of the user submitting the report", - "contact": "Contact details of the user submitting the report", - "summary": "Detailed explanation for report here" + "metadata": "pistol-dmg:88:400" }'; const headers = { 'Authorization':'Bearer {access-token}', @@ -11503,9 +11772,9 @@ const headers = { }; -fetch('https://*.modapi.io/v1/report', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', { - method: 'POST', + method: 'DELETE', body: inputBody, headers: headers }) @@ -11524,7 +11793,7 @@ headers = { 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/report', params={ +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp', params={ }, headers = headers) @@ -11532,9 +11801,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/report"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/metadatakvp"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -11547,76 +11816,45 @@ in.close(); System.out.println(response.toString()); ``` -`POST /report` - -The purpose of this endpoint is enable users to report a resource (game, mod or user) on mod.io. Successful request will return [Message Object](#message-object). - - __IMPORTANT:__ It is a requirement of the [Game Terms](https://mod.io/gameterms) with mod.io, and the platforms mod.io is used on (including but not limited to Steam, PlayStation, Nintendo and Xbox), to ensure all displayed content is reportable by users. You can enable a resource to be reported (by implementing a dialog similar to the example below) or linking to the report page on mod.io. - - __Example Dialog:__ - - - - __NOTE:__ If implementing your own report dialog, the Terms of Use and Privacy Policy must be correctly linked, or displayed inline using the [agreements endpoints](#agreements) to get the latest versions. - - If you wish to display the agreements in a web browser overlay, we recommend adding __/widget__ and __?no_links=true__ to the end of the agreement URLs, to remove the menus and external links, for example: - - - [https://mod.io/terms`/widget?no_links=true`](https://mod.io/terms/widget?no_links=true)
- - [https://mod.io/privacy`/widget?no_links=true`](https://mod.io/privacy/widget?no_links=true) - - __NOTE:__ If you prefer to display the report page in a web browser overlay, and you know the resource you want to report, the best URL to use is: __https://mod.io/report/`resource`/`id`/widget__ - - For example to report a mod with an ID of 1 the URL would be: [https://mod.io/report/`mods`/`1`/widget](https://mod.io/report/mods/1/widget). If you don't know the ID of the resource you wish to report, you can use the generic report URL: [https://mod.io/report/widget](https://mod.io/report) - - __NOTE:__ If you are a game owner or manager, you can [view all reports](https://mod.io/me/library) submitted for your game(s), and you are responsible for actioning reports. You can also configure in your games control panel the number of reports required before content is automatically taken down for review. +`DELETE /games/{game-id}/mods/{mod-id}/metadatakvp` - Read our [Terms of Use](https://mod.io/terms/widget) for information about what is/isn't acceptable. +Delete key value pairs metadata defined for this mod. Successful request will return `204 No Content`. - Parameter|Type|Required|Description - ---|---|---|---| - resource|string|true|Type of resource you are reporting. Must be one of the following values:

- _games_
- _mods_
- _users_ - id|integer|true|Unique id of the resource you are reporting. - type|integer|true|Type of report you are submitting. Must be one of the following values:

__0__ = Generic
__1__ = DMCA
__2__ = Not Working
__3__ = Rude Content
__4__ = Illegal Content
__5__ = Stolen Content
__6__ = False Information
__7__ = Other - name|string||Name of the user submitting the report. Recommended for DMCA reports. - contact|string||Contact details of the user submitting the report. Recommended for DMCA reports. - summary|string|true|Detailed description of your report. Make sure you include all relevant information and links to help moderators investigate and respond appropriately.

Our [online reporting process](https://mod.io/report/widget) shows the information we collect and put into the `name`, `contact` and `summary` fields as appropiate. We recommend you implement a similar flow in-game. + Parameter|Type|Required|Description + ---|---|---|---| + metadata[]|string|true|Key value pairs you want to delete where the the key and value are separated by a colon ':'. Every pair to delete requires a separate field with metadata[] as the key (eg. metadata[]=pistol-dmg:800, metadata[]=gravity:9.8).

__NOTE:__ If the string contains only the key and no colon ':', _all_ metadata with that key will be removed. > Example response ```json -{ - "code": 201, - "message": "You have successfully submitted a report and it will be reviewed by the mod.io team as soon as possible." -} + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Report Created|[Message Object](#message-object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15029|The authenticated user does not have permission to submit reports on mod.io due to their access being revoked.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15030|The specified resource is not able to be reported at this time, this is potentially due to the resource in question being removed.|[Error Object](#schemaerror_object) -404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|14000|The resource to be reported could not be found.|[Error Object](#schemaerror_object) +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15034|The authenticated user does not have permission to delete metadata from this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -# Agreements +# Dependencies -## Get Current Agreement +## Get Mod Dependencies > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -11630,7 +11868,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -11648,7 +11886,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies?api_key=YourApiKey', { method: 'GET', @@ -11667,7 +11905,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current', params={ +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -11675,7 +11913,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -11690,102 +11928,122 @@ in.close(); System.out.println(response.toString()); ``` -`GET /agreements/types/{agreement-type-id}/current` - -Get the current agreement (version) by type. Successful request will return a single [Agreement Version Object](#agreement-version-object). - - __Valid agreement types are:__ - - __1__ = Terms of Use - [https://mod.io/terms](https://mod.io/terms)
- __2__ = Privacy Policy - [https://mod.io/privacy](https://mod.io/privacy)
- __3__ = Game Terms - [https://mod.io/gameterms](https://mod.io/gameterms)
- __4__ = API Access Terms - [https://mod.io/apiterms](https://mod.io/apiterms)
- __5__ = Monetisation Terms - [https://mod.io/monetisationterms](https://mod.io/monetisationterms)
- __6__ = Acceptable Use Policy - [https://mod.io/aup](https://mod.io/aup) +`GET /games/{game-id}/mods/{mod-id}/dependencies` - There are three ways you can display mod.io agreements. Pick which is easiest and most suitable for your implementation. +Get all dependencies the chosen mod has selected. This is useful if a mod requires other mods be installed for it to run. Successful request will return an array of [Mod Dependencies Objects](#get-mod-dependencies-2). - __1. Linking to__ the applicable agreement using the URLs listed above. + __NOTE:__ This endpoint returns all mod dependencies, irrespective of their status, visibility or platform support. If your game automatically installs dependencies, we recommend moderating the use of this feature strictly, to ensure creators are not selecting _soft_ dependencies to promote or credit other mods, and dependencies are checked for suitability prior to install. - __2. Using this endpoint__ to fetch the applicable agreement and create a UI to display it inline. + For example: the official mod.io plugins where dependency support is enabled, typically subscribe users to all dependencies, so the mods suitability and synchronization can be managed by the subscription process. Following a similar process is recommend, particularly if enabling `recursive` dependency fetching, given it can result in many mods being returned. - __3. Web browser overlay__ to display the applicable agreement inline. If doing this, we recommend prefixing the agreement URL path with `/legal` to remove all menus, and if wanting to remove all links add `?no_links=true` to the end of the URL. For example use: + __DEPRECATION WARNING__: By default, this endpoint does not return dependencies recursively. However, in a future version of the API, dependencies _will_ be shown recursively by default. We suggest that you remove any custom implementation you may have in order to retrieve dependencies recursively, and instead use the `?recursive=true` query parameter to fetch all dependencies in a single request. - - [https://mod.io/legal/terms](https://mod.io/legal/terms) to remove menus
- - [https://mod.io/legal/terms?no_links=true](https://mod.io/legal/terms?no_links=true) to remove menus and links + Filter|Type|Description + ---|---|--- + recursive|integer|Recommended. Include child dependencies in a recursive manner. A value of `true` will display dependencies up to a maximum depth of 5. A value of `false` will only display immediate dependencies.

Defaults to `false`.

__NOTE:__ This will be enabled by default in API v2. > Example response ```json { - "id": 1, - "is_active": true, - "type": 2, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1509922961, - "date_updated": 1509922961, - "date_live": 1509922961, - "name": "Terms of Use", - "changelog": "", - "description": "Privacy Agreement - 20/11/2020....." -} - -``` -

Responses

- -Status|Meaning|Error Ref|Description|Response Schema ----|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Agreement Version Object](#schemaagreement_version_object) -404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|14000|Agreement could not be found.|[Error Object](#schemaerror_object) - -## Get Agreement Version - -> Example request - -```shell -# You can also use wget -curl -X GET https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key=YourApiKey \ - -H 'Accept: application/json' + "data": [ + { + "mod_id": 231, + "name": "Example Mod", + "name_id": "rogue-knight-hd-pack", + "date_added": 1499841487, + "dependency_depth": 0, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "modfile": { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] + } + }, + { + ... + } + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 +} + +``` +

Responses

+ +Status|Meaning|Error Ref|Description|Response Schema +---|---|----|---|---| +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Mod Dependencies](#schemaget_mod_dependencies) + +## Add Mod Dependencies + +> Example request + +```shell +# You can also use wget +curl -X POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Accept: application/json' \ + -d 'dependencies[]=284' ``` ```http -GET https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key=YourApiKey HTTP/1.1 +POST https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/agreements/versions/{agreement-version-id}', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', + method: 'post', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -11795,16 +12053,20 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "dependencies": "284" +}'; const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', { - method: 'GET', - + method: 'POST', + body: inputBody, headers: headers }) .then(function(res) { @@ -11817,20 +12079,22 @@ fetch('https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/agreements/versions/{agreement-version-id}', params={ - 'api_key': 'YourApiKey' +r = requests.post('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -11843,72 +12107,57 @@ in.close(); System.out.println(response.toString()); ``` -`GET /agreements/versions/{agreement-version-id}` +`POST /games/{game-id}/mods/{mod-id}/dependencies` -Get the specified agreement version. Successful request will return an [Agreement Version Object](#agreement-version-object). +Add mod dependencies required by the corresponding mod. A dependency is a mod that should be installed for this mod to run. Successful request will return [Message Object](#message-object). + + Parameter|Type|Required|Description + ---|---|---|---| + dependencies[]|integer|true|One or more mod IDs that this mod is dependent on. Every dependency to add requires a separate field with dependencies[] as the key (eg. dependencies[]=1, dependencies[]=2). Max of 5 dependencies per request. > Example response ```json { - "id": 1, - "is_active": true, - "type": 2, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1509922961, - "date_updated": 1509922961, - "date_live": 1509922961, - "name": "Terms of Use", - "changelog": "", - "description": "Privacy Agreement - 20/11/2020....." + "code": 201, + "message": "You have successfully added new dependencies to the specified mod." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Agreement Version Object](#schemaagreement_version_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14019|Only administrators can view agreement templates.|[Error Object](#schemaerror_object) -404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|14000|Agreement could not be found.|[Error Object](#schemaerror_object) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Message Object](#message-object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15031|The authenticated user does not have permission to add dependencies for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) +### Response Headers + +Status|Header|Type|Format|Description +---|---|---|---|---| +201|Location|string||URL to newly created resource + -# Users - -## Mute a User +## Delete Mod Dependencies > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/users/{user-id}/mute \ +curl -X DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies \ -H 'Authorization: Bearer {access-token}' \ - -H 'Accept: application/json' + -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Accept: application/json' \ + -d 'dependencies[]=284' ``` ```http -POST https://*.modapi.io/v1/users/{user-id}/mute HTTP/1.1 +DELETE https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json Authorization: Bearer {access-token} @@ -11917,13 +12166,14 @@ Authorization: Bearer {access-token} ```javascript var headers = { 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/users/{user-id}/mute', - method: 'post', + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', + method: 'delete', headers: headers, success: function(data) { @@ -11934,17 +12184,20 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "dependencies": "284" +}'; const headers = { 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/users/{user-id}/mute', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', { - method: 'POST', - + method: 'DELETE', + body: inputBody, headers: headers }) .then(function(res) { @@ -11958,10 +12211,11 @@ fetch('https://*.modapi.io/v1/users/{user-id}/mute', import requests headers = { 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/users/{user-id}/mute', params={ +r = requests.delete('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies', params={ }, headers = headers) @@ -11969,9 +12223,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/users/{user-id}/mute"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/dependencies"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -11984,9 +12238,13 @@ in.close(); System.out.println(response.toString()); ``` -`POST /users/{user-id}/mute` +`DELETE /games/{game-id}/mods/{mod-id}/dependencies` -Mute a user. This will prevent mod.io from returning mods to you authored by the muted user. Successful request will return `204 No Content`. +Delete mod dependencies the corresponding mod has selected. Successful request will return `204 No Content`. + + Parameter|Type|Required|Description + ---|---|---|---| + dependencies[]|integer|true|One or more mod IDs you want to delete as a dependency. Every dependency to delete requires a separate field with dependencies[] as the key (eg. dependencies[]=1, dependencies[]=2). > Example response @@ -11994,49 +12252,47 @@ Mute a user. This will prevent mod.io from returning mods to you authored by the 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| 204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|17039|You cannot mute yourself, you should potentially show restraint instead.|[Error Object](#schemaerror_object) -404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|17000|The user with the supplied id could not be found.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15032|The authenticated user does not have permission to delete dependencies for this mod, this action is restricted to team managers & administrators only.|[Error Object](#schemaerror_object) -## Unmute a User +# Teams + +## Get Mod Team Members > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/users/{user-id}/mute \ - -H 'Authorization: Bearer {access-token}' \ +curl -X GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -DELETE https://*.modapi.io/v1/users/{user-id}/mute HTTP/1.1 +GET https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/users/{user-id}/mute', - method: 'delete', - + url: 'https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team', + method: 'get', + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -12048,14 +12304,13 @@ $.ajax({ const request = require('node-fetch'); const headers = { - 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/users/{user-id}/mute', +fetch('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team?api_key=YourApiKey', { - method: 'DELETE', + method: 'GET', headers: headers }) @@ -12069,21 +12324,20 @@ fetch('https://*.modapi.io/v1/users/{user-id}/mute', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/users/{user-id}/mute', params={ - +r = requests.get('https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/users/{user-id}/mute"); +URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/mods/{mod-id}/team?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -12096,44 +12350,93 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /users/{user-id}/mute` - -Unmute a previously muted user. This will re-enable mod.io to returning mods to you authored by the muted user. Successful request will return `204 No Content`. - -> Example response +`GET /games/{game-id}/mods/{mod-id}/team` -```json - 204 No Content - -``` -

Responses

+Get all users that are part of a mod team. Successful request will return an array of [Team Member Objects](#team-member-object). We recommended reading the [filtering documentation](#filtering) to return only the records you want. + + Filter|Type|Required|Description + ---|---|---|---| + id|integer|Unique id of the team member record. + user_id|integer|Unique id of the user. + username|string|Username of the user. + level|integer|Level of permission the user has:

__1__ = Moderator (can moderate comments and content attached)
__4__ = Manager (moderator access, including uploading builds and editing settings except supply and team members)
__8__ = Administrator (full access, including editing the supply and team) + date_added|integer|Unix timestamp of the date the user was added to the team. + pending|integer|Has the user accepted the team invite?

__0__ = Accepted
__1__ = Pending + +> Example response + +```json +{ + "data": [ + { + "id": 457, + "user": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "level": 8, + "date_added": 1492058857, + "position": "Turret Builder", + "invite_pending": 1 + }, + { + ... + } + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 +} + +``` +

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|17000|The user with the supplied id could not be found.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Team Members](#schemaget_team_members) -# Me +# Reports -## Get Authenticated User +## Submit Report > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/me \ +curl -X POST https://*.modapi.io/v1/report \ -H 'Authorization: Bearer {access-token}' \ - -H 'Accept: application/json' + -H 'Content-Type: application/x-www-form-urlencoded' \ + -H 'Accept: application/json' \ + -d 'resource=mods' \ + -d 'id=3853' \ + -d 'type=1' \ + -d 'name=Name of the user submitting the report' \ + -d 'contact=Contact details of the user submitting the report' \ + -d 'summary=Detailed explanation for report here' ``` ```http -GET https://*.modapi.io/v1/me HTTP/1.1 +POST https://*.modapi.io/v1/report HTTP/1.1 Host: *.modapi.io - +Content-Type: application/x-www-form-urlencoded Accept: application/json Authorization: Bearer {access-token} @@ -12142,13 +12445,14 @@ Authorization: Bearer {access-token} ```javascript var headers = { 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/me', - method: 'get', + url: 'https://*.modapi.io/v1/report', + method: 'post', headers: headers, success: function(data) { @@ -12159,17 +12463,25 @@ $.ajax({ ```javascript--nodejs const request = require('node-fetch'); - +const inputBody = '{ + "resource": "mods", + "id": "3853", + "type": "1", + "name": "Name of the user submitting the report", + "contact": "Contact details of the user submitting the report", + "summary": "Detailed explanation for report here" +}'; const headers = { 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/me', +fetch('https://*.modapi.io/v1/report', { - method: 'GET', - + method: 'POST', + body: inputBody, headers: headers }) .then(function(res) { @@ -12183,10 +12495,11 @@ fetch('https://*.modapi.io/v1/me', import requests headers = { 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/me', params={ +r = requests.post('https://*.modapi.io/v1/report', params={ }, headers = headers) @@ -12194,9 +12507,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/me"); +URL obj = new URL("https://*.modapi.io/v1/report"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -12209,54 +12522,76 @@ in.close(); System.out.println(response.toString()); ``` -`GET /me` +`POST /report` -Get the _authenticated user_ details. Successful request will return a single [User Object](#user-object). +The purpose of this endpoint is enable users to report a resource (game, mod or user) on mod.io. Successful request will return [Message Object](#message-object). + + __IMPORTANT:__ It is a requirement of the [Game Terms](https://mod.io/gameterms) with mod.io, and the platforms mod.io is used on (including but not limited to Steam, PlayStation, Nintendo and Xbox), to ensure all displayed content is reportable by users. You can enable a resource to be reported (by implementing a dialog similar to the example below) or linking to the report page on mod.io. + + __Example Dialog:__ + + + + __NOTE:__ If implementing your own report dialog, the Terms of Use and Privacy Policy must be correctly linked, or displayed inline using the [agreements endpoints](#agreements) to get the latest versions. + + If you wish to display the agreements in a web browser overlay, we recommend adding __/widget__ and __?no_links=true__ to the end of the agreement URLs, to remove the menus and external links, for example: + + - [https://mod.io/terms`/widget?no_links=true`](https://mod.io/terms/widget?no_links=true)
+ - [https://mod.io/privacy`/widget?no_links=true`](https://mod.io/privacy/widget?no_links=true) + + __NOTE:__ If you prefer to display the report page in a web browser overlay, and you know the resource you want to report, the best URL to use is: __https://mod.io/report/`resource`/`id`/widget__ + + For example to report a mod with an ID of 1 the URL would be: [https://mod.io/report/`mods`/`1`/widget](https://mod.io/report/mods/1/widget). If you don't know the ID of the resource you wish to report, you can use the generic report URL: [https://mod.io/report/widget](https://mod.io/report) + + __NOTE:__ If you are a game owner or manager, you can [view all reports](https://mod.io/me/library) submitted for your game(s), and you are responsible for actioning reports. You can also configure in your games control panel the number of reports required before content is automatically taken down for review. + + Read our [Terms of Use](https://mod.io/terms/widget) for information about what is/isn't acceptable. + + Parameter|Type|Required|Description + ---|---|---|---| + resource|string|true|Type of resource you are reporting. Must be one of the following values:

- _games_
- _mods_
- _users_ + id|integer|true|Unique id of the resource you are reporting. + type|integer|true|Type of report you are submitting. Must be one of the following values:

__0__ = Generic
__1__ = DMCA
__2__ = Not Working
__3__ = Rude Content
__4__ = Illegal Content
__5__ = Stolen Content
__6__ = False Information
__7__ = Other + name|string||Name of the user submitting the report. Recommended for DMCA reports. + contact|string||Contact details of the user submitting the report. Recommended for DMCA reports. + summary|string|true|Detailed description of your report. Make sure you include all relevant information and links to help moderators investigate and respond appropriately.

Our [online reporting process](https://mod.io/report/widget) shows the information we collect and put into the `name`, `contact` and `summary` fields as appropiate. We recommend you implement a similar flow in-game. > Example response ```json { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" + "code": 201, + "message": "You have successfully submitted a report and it will be reviewed by the mod.io team as soon as possible." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[User Object](#schemauser_object) +201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Report Created|[Message Object](#message-object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15029|The authenticated user does not have permission to submit reports on mod.io due to their access being revoked.|[Error Object](#schemaerror_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|15030|The specified resource is not able to be reported at this time, this is potentially due to the resource in question being removed.|[Error Object](#schemaerror_object) +404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|14000|The resource to be reported could not be found.|[Error Object](#schemaerror_object) -## Get User Events +# Agreements + +## Get Current Agreement > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/me/events?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/me/events?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -12270,7 +12605,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/me/events', + url: 'https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current', method: 'get', data: '?api_key=YourApiKey', headers: headers, @@ -12288,7 +12623,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/me/events?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current?api_key=YourApiKey', { method: 'GET', @@ -12307,7 +12642,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/me/events', params={ +r = requests.get('https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current', params={ 'api_key': 'YourApiKey' }, headers = headers) @@ -12315,7 +12650,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/me/events?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/agreements/types/{agreement-type-id}/current?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -12330,84 +12665,102 @@ in.close(); System.out.println(response.toString()); ``` -`GET /me/events` +`GET /agreements/types/{agreement-type-id}/current` -Get events that have been fired specific to the user. Successful request will return an array of [Event Objects](#get-user-events-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Get the current agreement (version) by type. Successful request will return a single [Agreement Version Object](#agreement-version-object). - Filter|Type|Description - ---|---|--- - id|integer|Unique id of the event object. - game_id|integer|Unique id of the parent game. - mod_id|integer|Unique id of the parent mod. - user_id|integer|Unique id of the user who performed the action. - date_added|integer|Unix timestamp of date mod was updated. - event_type|string|Type of change that occurred:

__USER_TEAM_JOIN__ = User has joined a team.
__USER_TEAM_LEAVE__ = User has left a team.
__USER_SUBSCRIBE__ = User has subscribed to a mod.
__USER_UNSUBSCRIBE__ = User has un-subscribed from a mod. + __Valid agreement types are:__ + + __1__ = Terms of Use - [https://mod.io/terms](https://mod.io/terms)
+ __2__ = Privacy Policy - [https://mod.io/privacy](https://mod.io/privacy)
+ __3__ = Game Terms - [https://mod.io/gameterms](https://mod.io/gameterms)
+ __4__ = API Access Terms - [https://mod.io/apiterms](https://mod.io/apiterms)
+ __5__ = Monetisation Terms - [https://mod.io/monetisationterms](https://mod.io/monetisationterms)
+ __6__ = Acceptable Use Policy - [https://mod.io/aup](https://mod.io/aup) + + There are three ways you can display mod.io agreements. Pick which is easiest and most suitable for your implementation. + + __1. Linking to__ the applicable agreement using the URLs listed above. + + __2. Using this endpoint__ to fetch the applicable agreement and create a UI to display it inline. + + __3. Web browser overlay__ to display the applicable agreement inline. If doing this, we recommend prefixing the agreement URL path with `/legal` to remove all menus, and if wanting to remove all links add `?no_links=true` to the end of the URL. For example use: + + - [https://mod.io/legal/terms](https://mod.io/legal/terms) to remove menus
+ - [https://mod.io/legal/terms?no_links=true](https://mod.io/legal/terms?no_links=true) to remove menus and links > Example response ```json { - "data": [ - { - "id": 13, - "game_id": 7, - "mod_id": 13, - "user_id": 13, - "date_added": 1499846132, - "event_type": "USER_SUBSCRIBE" + "id": 1, + "is_active": true, + "type": 2, + "user": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1509922961, + "date_updated": 1509922961, + "date_live": 1509922961, + "name": "Terms of Use", + "changelog": "", + "description": "Privacy Agreement - 20/11/2020....." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get User Events](#schemaget_user_events) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Agreement Version Object](#schemaagreement_version_object) +404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|14000|Agreement could not be found.|[Error Object](#schemaerror_object) -## Get User Modfiles +## Get Agreement Version > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/me/files \ - -H 'Authorization: Bearer {access-token}' \ +curl -X GET https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/me/files HTTP/1.1 +GET https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/me/files', + url: 'https://*.modapi.io/v1/agreements/versions/{agreement-version-id}', method: 'get', - + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -12419,12 +12772,11 @@ $.ajax({ const request = require('node-fetch'); const headers = { - 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/me/files', +fetch('https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key=YourApiKey', { method: 'GET', @@ -12440,19 +12792,18 @@ fetch('https://*.modapi.io/v1/me/files', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/me/files', params={ - +r = requests.get('https://*.modapi.io/v1/agreements/versions/{agreement-version-id}', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/me/files"); +URL obj = new URL("https://*.modapi.io/v1/agreements/versions/{agreement-version-id}?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -12467,95 +12818,70 @@ in.close(); System.out.println(response.toString()); ``` -`GET /me/files` - -Get all modfiles the _authenticated user_ uploaded. Successful request will return an array of [Modfile Objects](#get-modfiles-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. - - __NOTE:__ If the [game](#edit-game) requires mod downloads to be initiated via the API, the `binary_url` returned will contain a verification hash. This hash must be supplied to get the modfile, and will expire after a certain period of time. Saving and reusing the `binary_url` won't work in this situation given it's dynamic nature. +`GET /agreements/versions/{agreement-version-id}` - Filter|Type|Description - ---|---|--- - id|integer|Unique id of the file. - mod_id|integer|Unique id of the mod. - date_added|integer|Unix timestamp of date file was added. - date_scanned|integer|Unix timestamp of date file was virus scanned. - virus_status|integer|Current virus scan status of the file. For newly added files that have yet to be scanned this field will change frequently until a scan is complete:

__0__ = Not scanned
__1__ = Scan complete
__2__ = In progress
__3__ = Too large to scan
__4__ = File not found
__5__ = Error Scanning - virus_positive|integer|Was a virus detected:

__0__ = No threats detected
__1__ = Flagged as malicious
__2__ = Flagged as containing potentially harmful files (i.e. EXEs) - filesize|integer|Size of the file in bytes. - filehash|string|MD5 hash of the file. - filename|string|Filename including extension. - version|string|Release version this file represents. - changelog|string|Changelog for the file. - metadata_blob|string|Metadata stored by the game developer for this file. - platform_status|string|If the parent game has enabled per-platform files, by default only files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To request pending files, you can filter results by their current platform status, using `pending_only`, `approved_only` or `live_and_pending`. +Get the specified agreement version. Successful request will return an [Agreement Version Object](#agreement-version-object). > Example response ```json { - "data": [ - { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] + "id": 1, + "is_active": true, + "type": 2, + "user": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1509922961, + "date_updated": 1509922961, + "date_live": 1509922961, + "name": "Terms of Use", + "changelog": "", + "description": "Privacy Agreement - 20/11/2020....." } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Modfiles](#schemaget_modfiles) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Agreement Version Object](#schemaagreement_version_object) +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14019|Only administrators can view agreement templates.|[Error Object](#schemaerror_object) +404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|14000|Agreement could not be found.|[Error Object](#schemaerror_object) -## Get User Games +# Users + +## Mute a User > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/me/games \ +curl -X POST https://*.modapi.io/v1/users/{user-id}/mute \ -H 'Authorization: Bearer {access-token}' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/me/games HTTP/1.1 +POST https://*.modapi.io/v1/users/{user-id}/mute HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -12571,8 +12897,8 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/me/games', - method: 'get', + url: 'https://*.modapi.io/v1/users/{user-id}/mute', + method: 'post', headers: headers, success: function(data) { @@ -12590,9 +12916,9 @@ const headers = { }; -fetch('https://*.modapi.io/v1/me/games', +fetch('https://*.modapi.io/v1/users/{user-id}/mute', { - method: 'GET', + method: 'POST', headers: headers }) @@ -12610,7 +12936,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/me/games', params={ +r = requests.post('https://*.modapi.io/v1/users/{user-id}/mute', params={ }, headers = headers) @@ -12618,9 +12944,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/me/games"); +URL obj = new URL("https://*.modapi.io/v1/users/{user-id}/mute"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -12633,166 +12959,154 @@ in.close(); System.out.println(response.toString()); ``` -`GET /me/games` +`POST /users/{user-id}/mute` -Get all games the _authenticated user_ added or is a team member of. Successful request will return an array of [Game Objects](#get-games-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Mute a user. This will prevent mod.io from returning mods to you authored by the muted user. Successful request will return `204 No Content`. - Filter|Type|Description - ---|---|--- - id|integer|Unique id of the game. - status|integer|Status of the game (only admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not Accepted
__1__ = Accepted
__3__ = Deleted - submitted_by|integer|Unique id of the user who has ownership of the game. - date_added|integer|Unix timestamp of date game was registered. - date_updated|integer|Unix timestamp of date game was updated. - date_live|integer|Unix timestamp of date game was set live. - name|string|Name of the game. - name_id|string|Path for the game on mod.io. For example: https://mod.io/g/gamename - summary|string|Summary of the games mod support. - instructions_url|string|Link to a mod.io guide, modding wiki or a page where modders can learn how to make and submit mods. - ugc_name|string|Word used to describe user-generated content (mods, items, addons etc). - presentation_option|integer|Presentation style used on the mod.io website:

__0__ = Grid View: Displays mods in a grid
__1__ = Table View: Displays mods in a table - submission_option|integer|Submission process modders must follow:

__0__ = Mod uploads must occur via the API using a tool created by the game developers
__1__ = Mod uploads can occur from anywhere, including the website and API - curation_option|integer|Curation options enabled by this game to approve mods:

__0__ = No curation: Mods are immediately available to play
__1__ = Price change approval: Pricing changes for marketplace mods queued for acceptance
__2__ = Full curation: All mods must be accepted by someone to be listed
__?__ = Combine to enable multiple features (see BITWISE fields) - community_options|integer|Community features enabled for this game:

__0__ = None
__1__ = Enable comments
__2__ = Enable guides
__4__ = Pin on homepage
__8__ = Show on homepage
__16__ = Show more on homepage
__32__ = Allow change status
__64__ = Enable Previews (Game must be hidden)
__128__ = Allow Preview Share-URL (Previews must be enabled)
__?__ = Combine to find games with multiple options enabled (see [BITWISE fields](#bitwise-and-bitwise-and)) - monetisation_options|integer|Monetisation features mods can enable:

__0__ = None
__1__ = Enabled
__2__ = Allow mods to be sold (marketplace)
__?__ = Combine to find games with multiple options enabled (see [BITWISE fields](#bitwise-and-bitwise-and)) - api_access_options|integer|Level of API access allowed by this game:

__0__ = None
__1__ = Allow 3rd parties to access this games API endpoints
__2__ = Allow mods to be downloaded directly (if disabled all download URLs will contain a frequently changing verification hash to stop unauthorized use)
__?__ = Combine to find games with multiple options enabled (see [BITWISE fields](#bitwise-and-bitwise-and) - maturity_options|integer|Mature content setup for this game:

__0__ = Don't allow mature content in mods
__1__ = Allow mature content in mods
__2__ = This game is for mature audiences only
__?__ = Combine to find games with multiple options enabled (see [BITWISE fields](#bitwise-and-bitwise-and) +> Example response - Display|Type|Description - ---|---|--- - show_hidden_tags|bool|show the hidden tags associated with the given game. +```json + 204 No Content + +``` +

Responses

- Sort|Description - ---|--- - popular|Sort results by popularity using [_sort filter](#filtering), value should be `popular` for descending or `-popular` for ascending results.

__NOTE:__ Popularity is calculated hourly and reset daily (results are ranked from 1 to X). You should sort this column in ascending order `-popular` to get the top ranked results. - popular_overall|Sort results by 'Popular Overall' using [_sort filter](#filtering), value should be `popular_overall` for descending or `-popular_overall` for ascending results.

__NOTE:__ You should sort this column in ascending order `-popular_overall` to get the top ranked results. This filter differs from popular by filtering on the amount of downloads the game has received overall, and not just in the last 24 hours. - subscribers|Sort results by most subscribers using [_sort filter](#filtering), value should be `subscribers` for descending or `-subscribers` for ascending results. +Status|Meaning|Error Ref|Description|Response Schema +---|---|----|---|---| +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|17039|You cannot mute yourself, you should potentially show restraint instead.|[Error Object](#schemaerror_object) +404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|17000|The user with the supplied id could not be found.|[Error Object](#schemaerror_object) + +## Unmute a User -> Example response +> Example request -```json +```shell +# You can also use wget +curl -X DELETE https://*.modapi.io/v1/users/{user-id}/mute \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Accept: application/json' + +``` + +```http +DELETE https://*.modapi.io/v1/users/{user-id}/mute HTTP/1.1 +Host: *.modapi.io + +Accept: application/json +Authorization: Bearer {access-token} + +``` + +```javascript +var headers = { + 'Authorization':'Bearer {access-token}', + 'Accept':'application/json' + +}; + +$.ajax({ + url: 'https://*.modapi.io/v1/users/{user-id}/mute', + method: 'delete', + + headers: headers, + success: function(data) { + console.log(JSON.stringify(data)); + } +}) +``` + +```javascript--nodejs +const request = require('node-fetch'); + +const headers = { + 'Authorization':'Bearer {access-token}', + 'Accept':'application/json' + +}; + +fetch('https://*.modapi.io/v1/users/{user-id}/mute', { - "data": [ - { - "id": 2, - "status": 1, - "submitted_by": null, - "date_added": 1493702614, - "date_updated": 1499410290, - "date_live": 1499841403, - "presentation_option": 0, - "submission_option": 1, - "curation_option": 0, - "community_options": 3, - "monetisation_options": 0, - "revenue_options": 0, - "api_access_options": 3, - "maturity_options": 0, - "ugc_name": "mods", - "icon": { - "filename": "icon.png", - "original": "https://assets.modcdn.io/images/placeholder/icon.png", - "thumb_64x64": "https://assets.modcdn.io/images/placeholder/icon.png", - "thumb_128x128": "https://assets.modcdn.io/images/placeholder/icon.png", - "thumb_256x256": "https://assets.modcdn.io/images/placeholder/icon.png" - }, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "header": { - "filename": "modio-logo-bluedark.png", - "original": "https://assets.modcdn.io/images/branding/modio-logo-bluedark.png" - }, - "name": "Rogue Knight", - "name_id": "rogue-knight", - "summary": "Rogue Knight is a brand new 2D pixel platformer that supports custom levels and characters.", - "instructions": "Instructions on the process to upload mods.", - "instructions_url": "https://www.rogue-knight-game.com/modding/getting-started", - "profile_url": "https://mod.io/g/rogue-knight", - "other_urls": [ - { - "label": "Our Steam Page", - "url": "https://www.steampowered.com/2348329042" - } - ], - "tag_options": [ - { - "name": "Theme", - "type": "checkboxes", - "tags": [ - "Horror" - ], - "tag_count_map": { - "Horror": 52 - }, - "hidden": false, - "locked": false - } - ], - "stats": { - "game_id": 2, - "mods_count_total": 13, - "mods_downloads_today": 204, - "mods_downloads_total": 27492, - "mods_downloads_daily_average": 1230, - "mods_subscribers_total": 16394, - "date_expires": 1492564103 - }, - "theme": { - "primary": "#44bfd5", - "dark": "#2c2c3f", - "light": "#ffffff", - "success": "#68D391", - "warning": "#d6af2e", - "danger": "#ff000e" - }, - "platforms": [ - { - "platform": "ps5", - "label": "PlayStation 5", - "moderated": true, - "locked": true - } - ] - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + method: 'DELETE', + + headers: headers +}) +.then(function(res) { + return res.json(); +}).then(function(body) { + console.log(body); +}); +``` + +```python +import requests +headers = { + 'Authorization': 'Bearer {access-token}', + 'Accept': 'application/json' +} + +r = requests.delete('https://*.modapi.io/v1/users/{user-id}/mute', params={ + +}, headers = headers) + +print r.json() +``` + +```java +URL obj = new URL("https://*.modapi.io/v1/users/{user-id}/mute"); +HttpURLConnection con = (HttpURLConnection) obj.openConnection(); +con.setRequestMethod("DELETE"); +int responseCode = con.getResponseCode(); +BufferedReader in = new BufferedReader( + new InputStreamReader(con.getInputStream())); +String inputLine; +StringBuffer response = new StringBuffer(); +while ((inputLine = in.readLine()) != null) { + response.append(inputLine); } +in.close(); +System.out.println(response.toString()); +``` + +`DELETE /users/{user-id}/mute` + +Unmute a previously muted user. This will re-enable mod.io to returning mods to you authored by the muted user. Successful request will return `204 No Content`. + +> Example response + +```json + 204 No Content ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Games](#schemaget_games) +204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None +404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|17000|The user with the supplied id could not be found.|[Error Object](#schemaerror_object) -## Get User Subscriptions +# Me + +## Get Authenticated User > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/me/subscribed \ +curl -X GET https://*.modapi.io/v1/me \ -H 'Authorization: Bearer {access-token}' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/me/subscribed HTTP/1.1 +GET https://*.modapi.io/v1/me HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -12808,7 +13122,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/me/subscribed', + url: 'https://*.modapi.io/v1/me', method: 'get', headers: headers, @@ -12827,7 +13141,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/me/subscribed', +fetch('https://*.modapi.io/v1/me', { method: 'GET', @@ -12847,7 +13161,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/me/subscribed', params={ +r = requests.get('https://*.modapi.io/v1/me', params={ }, headers = headers) @@ -12855,7 +13169,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/me/subscribed"); +URL obj = new URL("https://*.modapi.io/v1/me"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -12870,221 +13184,70 @@ in.close(); System.out.println(response.toString()); ``` -`GET /me/subscribed` - -Get all mod's the _authenticated user_ is subscribed to. Successful request will return an array of [Mod Objects](#get-mods-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. - - Filter|Type|Description - ---|---|--- - id|integer|Unique id of the mod. - game_id|integer|Unique id of the parent game. - status|integer|Status of the mod (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted _(default)_
__1__ = Accepted _(default)_
__3__ = Deleted - visible|integer|Visibility of the mod (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Hidden _(default)_
__1__ = Public _(default)_ - submitted_by|integer|Unique id of the user who has ownership of the mod. - date_added|integer|Unix timestamp of date mod was registered. - date_updated|integer|Unix timestamp of date mod was updated. - date_live|integer|Unix timestamp of date mod was set live. - maturity_option|integer|Maturity option(s) set by the mod creator:

__0__ = None
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) - monetisation_options|integer|Monetisation option(s) enabled by the mod creator:

__0__ = None
__1__ = Enabled
__2__ = Marketplace On
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) - name|string|Name of the mod. - name_id|string|Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__ - modfile|integer|Unique id of the file that is the current active release (see [mod files](#files)). - metadata_blob|string|Metadata stored by the game developer. - metadata_kvp|string|Colon-separated values representing the key-value pairs you want to filter the results by. If you supply more than one key-pair, separate the pairs by a comma. Will only filter by an exact key-pair match. - tags|string|Comma-separated values representing the tags you want to filter the results by. If you specify multiple tags, only mods which have all tags will be returned, and only tags that are supported by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). If you want to ensure mods returned do not contain particular tag(s), you can use the `tags-not-in` filter either independently or alongside this filter. - platform_status|string|If the parent game has enabled per-platform files, by default only mods with files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To QA mods with pending files, you can filter results by their current platform status, using `pending_only` or `live_and_pending`.

__NOTE:__ only game admins can filter by this field. +`GET /me` - Sort|Description - ---|--- - downloads|Sort results by most downloads using [_sort filter](#filtering) parameter, value should be `downloads` for descending or `-downloads` for ascending results. - popular|Sort results by popularity using [_sort filter](#filtering), value should be `popular` for descending or `-popular` for ascending results.

__NOTE:__ Popularity is calculated hourly and reset daily (results are ranked from 1 to X). You should sort this column in ascending order `-popular` to get the top ranked results. - rating|Sort results by weighted rating using [_sort filter](#filtering), value should be `rating` for descending or `-rating` for ascending results. - subscribers|Sort results by most subscribers using [_sort filter](#filtering), value should be `subscribers` for descending or `-subscribers` for ascending results. +Get the _authenticated user_ details. Successful request will return a single [User Object](#user-object). > Example response ```json { - "data": [ - { - "id": 2, - "game_id": 2, - "status": 1, - "visible": 1, - "submitted_by": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1492564103, - "date_updated": 1499841487, - "date_live": 1499841403, - "maturity_option": 0, - "community_options": 3, - "monetisation_options": 0, - "price": 0, - "tax": 0, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "homepage_url": "https://www.rogue-hdpack.com/", - "name": "Rogue Knight HD Pack", - "name_id": "rogue-knight-hd-pack", - "summary": "It's time to bask in the glory of beautiful 4k textures!", - "description": "

Rogue HD Pack does exactly what you thi...", - "description_plaintext": "Rogue HD Pack does exactly what you thi...", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", - "media": { - "youtube": [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ], - "sketchfab": [ - "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" - ], - "images": [ - { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - } - ] - }, - "modfile": { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] - }, - "platforms": [ - { - "platform": "windows", - "modfile_live": 1 - } - ], - "metadata_kvp": [ - { - "metakey": "pistol-dmg", - "metavalue": "800" - } - ], - "tags": [ - { - "name": "Unity", - "date_added": 1499841487 - } - ], - "stats": { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 - } - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" } ``` -

Cross-Platform Filtering

- -If the parent game has platform filtering enabled, this endpoint supports the [targeting a platform](#targeting-a-platform) request header to return the [mods](#mod-object) that are approved for the requested platform. Note: To target a platform for this endpoint, you MUST also include the `game_id` filter for the game that has cross-platform filtering enabled. - -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Mods](#schemaget_mods) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[User Object](#schemauser_object) -## Get User Mods +## Get User Events > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/me/mods \ - -H 'Authorization: Bearer {access-token}' \ +curl -X GET https://*.modapi.io/v1/me/events?api_key=YourApiKey \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/me/mods HTTP/1.1 +GET https://*.modapi.io/v1/me/events?api_key=YourApiKey HTTP/1.1 Host: *.modapi.io Accept: application/json -Authorization: Bearer {access-token} ``` ```javascript var headers = { - 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/me/mods', + url: 'https://*.modapi.io/v1/me/events', method: 'get', - + data: '?api_key=YourApiKey', headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -13096,12 +13259,11 @@ $.ajax({ const request = require('node-fetch'); const headers = { - 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/me/mods', +fetch('https://*.modapi.io/v1/me/events?api_key=YourApiKey', { method: 'GET', @@ -13117,19 +13279,18 @@ fetch('https://*.modapi.io/v1/me/mods', ```python import requests headers = { - 'Authorization': 'Bearer {access-token}', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/me/mods', params={ - +r = requests.get('https://*.modapi.io/v1/me/events', params={ + 'api_key': 'YourApiKey' }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/me/mods"); +URL obj = new URL("https://*.modapi.io/v1/me/events?api_key=YourApiKey"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -13144,36 +13305,18 @@ in.close(); System.out.println(response.toString()); ``` -`GET /me/mods` +`GET /me/events` -Get all mods the _authenticated user_ added or is a team member of. Successful request will return an array of [Mod Objects](#get-mods-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. +Get events that have been fired specific to the user. Successful request will return an array of [Event Objects](#get-user-events-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. Filter|Type|Description ---|---|--- - id|integer|Unique id of the mod. + id|integer|Unique id of the event object. game_id|integer|Unique id of the parent game. - status|integer|Status of the mod:

__0__ = Not accepted _(default)_
__1__ = Accepted _(default)_
__3__ = Deleted _(default)_ - visible|integer|Visibility of the mod:

__0__ = Hidden _(default)_
__1__ = Public _(default)_ - submitted_by|integer|Unique id of the user who has ownership of the mod. - date_added|integer|Unix timestamp of date mod was registered. - date_updated|integer|Unix timestamp of date mod was updated. - date_live|integer|Unix timestamp of date mod was set live. - maturity_option|integer|Maturity option(s) set by the mod creator:

__0__ = None
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) - monetisation_options|integer|Monetisation option(s) enabled by the mod creator:

__0__ = None
__1__ = Enabled
__2__ = Marketplace On
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) - name|string|Name of the mod. - name_id|string|Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__ - modfile|integer|Unique id of the file that is the current active release (see [mod files](#files)). - metadata_blob|string|Metadata stored by the game developer. - metadata_kvp|string|Colon-separated values representing the key-value pairs you want to filter the results by. If you supply more than one key-pair, separate the pairs by a comma. Will only filter by an exact key-pair match. - tags|string|Comma-separated values representing the tags you want to filter the results by. If you specify multiple tags, only mods which have all tags will be returned, and only tags that are supported by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). If you want to ensure mods returned do not contain particular tag(s), you can use the `tags-not-in` filter either independently or alongside this filter. - platform_status|string|If the parent game has enabled per-platform files, by default only mods with files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To request mods with pending files, you can filter results by their current platform status, using `pending_only` or `live_and_pending`. - - Sort|Description - ---|--- - downloads|Sort results by most downloads using [_sort filter](#filtering) parameter, value should be `downloads` for descending or `-downloads` for ascending results. - popular|Sort results by popularity using [_sort filter](#filtering), value should be `popular` for descending or `-popular` for ascending results.

__NOTE:__ Popularity is calculated hourly and reset daily (results are ranked from 1 to X). You should sort this column in ascending order `-popular` to get the top ranked results. - rating|Sort results by weighted rating using [_sort filter](#filtering), value should be `rating` for descending or `-rating` for ascending results. - subscribers|Sort results by most subscribers using [_sort filter](#filtering), value should be `subscribers` for descending or `-subscribers` for ascending results. + mod_id|integer|Unique id of the parent mod. + user_id|integer|Unique id of the user who performed the action. + date_added|integer|Unix timestamp of date mod was updated. + event_type|string|Type of change that occurred:

__USER_TEAM_JOIN__ = User has joined a team.
__USER_TEAM_LEAVE__ = User has left a team.
__USER_SUBSCRIBE__ = User has subscribed to a mod.
__USER_UNSUBSCRIBE__ = User has un-subscribed from a mod. > Example response @@ -13181,127 +13324,12 @@ Get all mods the _authenticated user_ added or is a team member of. Successful r { "data": [ { - "id": 2, - "game_id": 2, - "status": 1, - "visible": 1, - "submitted_by": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1492564103, - "date_updated": 1499841487, - "date_live": 1499841403, - "maturity_option": 0, - "community_options": 3, - "monetisation_options": 0, - "price": 0, - "tax": 0, - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "homepage_url": "https://www.rogue-hdpack.com/", - "name": "Rogue Knight HD Pack", - "name_id": "rogue-knight-hd-pack", - "summary": "It's time to bask in the glory of beautiful 4k textures!", - "description": "

Rogue HD Pack does exactly what you thi...", - "description_plaintext": "Rogue HD Pack does exactly what you thi...", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", - "media": { - "youtube": [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ], - "sketchfab": [ - "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" - ], - "images": [ - { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - } - ] - }, - "modfile": { - "id": 2, - "mod_id": 2, - "date_added": 1499841487, - "date_scanned": 1499841487, - "virus_status": 0, - "virus_positive": 0, - "virustotal_hash": "", - "filesize": 15181, - "filesize_uncompressed": 16384, - "filehash": { - "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" - }, - "filename": "rogue-knight-v1.zip", - "version": "1.3", - "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", - "metadata_blob": "rogue,hd,high-res,4k,hd textures", - "download": { - "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", - "date_expires": 1579316848 - }, - "platforms": [ - { - "platform": "windows", - "status": 1 - } - ] - }, - "platforms": [ - { - "platform": "windows", - "modfile_live": 1 - } - ], - "metadata_kvp": [ - { - "metakey": "pistol-dmg", - "metavalue": "800" - } - ], - "tags": [ - { - "name": "Unity", - "date_added": 1499841487 - } - ], - "stats": { - "mod_id": 2, - "popularity_rank_position": 13, - "popularity_rank_total_mods": 204, - "downloads_today": 327, - "downloads_total": 27492, - "subscribers_total": 16394, - "ratings_total": 1230, - "ratings_positive": 1047, - "ratings_negative": 183, - "ratings_percentage_positive": 91, - "ratings_weighted_aggregate": 87.38, - "ratings_display_text": "Very Positive", - "date_expires": 1492564103 - } + "id": 13, + "game_id": 7, + "mod_id": 13, + "user_id": 13, + "date_added": 1499846132, + "event_type": "USER_SUBSCRIBE" }, { ... @@ -13314,29 +13342,29 @@ Get all mods the _authenticated user_ added or is a team member of. Successful r } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Mods](#schemaget_mods) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get User Events](#schemaget_user_events) -## Get Users Muted +## Get User Modfiles > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/me/users/muted \ +curl -X GET https://*.modapi.io/v1/me/files \ -H 'Authorization: Bearer {access-token}' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/me/users/muted HTTP/1.1 +GET https://*.modapi.io/v1/me/files HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -13352,7 +13380,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/me/users/muted', + url: 'https://*.modapi.io/v1/me/files', method: 'get', headers: headers, @@ -13371,7 +13399,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/me/users/muted', +fetch('https://*.modapi.io/v1/me/files', { method: 'GET', @@ -13391,7 +13419,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/me/users/muted', params={ +r = requests.get('https://*.modapi.io/v1/me/files', params={ }, headers = headers) @@ -13399,7 +13427,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/me/users/muted"); +URL obj = new URL("https://*.modapi.io/v1/me/files"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -13414,9 +13442,27 @@ in.close(); System.out.println(response.toString()); ``` -`GET /me/users/muted` +`GET /me/files` -Get all users muted by the _authenticated user_. Successful request will return an array of [User Objects](#user-object). +Get all modfiles the _authenticated user_ uploaded. Successful request will return an array of [Modfile Objects](#get-modfiles-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. + + __NOTE:__ If the [game](#edit-game) requires mod downloads to be initiated via the API, the `binary_url` returned will contain a verification hash. This hash must be supplied to get the modfile, and will expire after a certain period of time. Saving and reusing the `binary_url` won't work in this situation given it's dynamic nature. + + Filter|Type|Description + ---|---|--- + id|integer|Unique id of the file. + mod_id|integer|Unique id of the mod. + date_added|integer|Unix timestamp of date file was added. + date_scanned|integer|Unix timestamp of date file was virus scanned. + virus_status|integer|Current virus scan status of the file. For newly added files that have yet to be scanned this field will change frequently until a scan is complete:

__0__ = Not scanned
__1__ = Scan complete
__2__ = In progress
__3__ = Too large to scan
__4__ = File not found
__5__ = Error Scanning + virus_positive|integer|Was a virus detected:

__0__ = No threats detected
__1__ = Flagged as malicious
__2__ = Flagged as containing potentially harmful files (i.e. EXEs) + filesize|integer|Size of the file in bytes. + filehash|string|MD5 hash of the file. + filename|string|Filename including extension. + version|string|Release version this file represents. + changelog|string|Changelog for the file. + metadata_blob|string|Metadata stored by the game developer for this file. + platform_status|string|If the parent game has enabled per-platform files, by default only files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To request pending files, you can filter results by their current platform status, using `pending_only`, `approved_only` or `live_and_pending`. > Example response @@ -13424,56 +13470,67 @@ Get all users muted by the _authenticated user_. Successful request will return { "data": [ { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] }, { ... } ], - "result_count": 1, + "result_count": 70, "result_offset": 0, "result_limit": 100, - "result_total": 1 + "result_total": 70 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Muted Users](#schemaget_muted_users) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Modfiles](#schemaget_modfiles) -## Get User Ratings +## Get User Games > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/me/ratings \ +curl -X GET https://*.modapi.io/v1/me/games \ -H 'Authorization: Bearer {access-token}' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/me/ratings HTTP/1.1 +GET https://*.modapi.io/v1/me/games HTTP/1.1 Host: *.modapi.io Accept: application/json @@ -13489,7 +13546,7 @@ var headers = { }; $.ajax({ - url: 'https://*.modapi.io/v1/me/ratings', + url: 'https://*.modapi.io/v1/me/games', method: 'get', headers: headers, @@ -13508,7 +13565,7 @@ const headers = { }; -fetch('https://*.modapi.io/v1/me/ratings', +fetch('https://*.modapi.io/v1/me/games', { method: 'GET', @@ -13528,7 +13585,7 @@ headers = { 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/me/ratings', params={ +r = requests.get('https://*.modapi.io/v1/me/games', params={ }, headers = headers) @@ -13536,7 +13593,7 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/me/ratings"); +URL obj = new URL("https://*.modapi.io/v1/me/games"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -13551,16 +13608,40 @@ in.close(); System.out.println(response.toString()); ``` -`GET /me/ratings` +`GET /me/games` -Get all mod rating's submitted by the _authenticated user_. Successful request will return an array of [Rating Objects](#get-user-ratings). +Get all games the _authenticated user_ added or is a team member of. Successful request will return an array of [Game Objects](#get-games-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. Filter|Type|Description ---|---|--- - game_id|integer|Unique id of the parent game. - mod_id|integer|Unique id of the mod. - rating|integer|Type of rating applied:

__-1__ = Negative Rating
__1__ = Positive Rating - date_added|integer|Unix timestamp of date rating was submitted. + id|integer|Unique id of the game. + status|integer|Status of the game (only admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not Accepted
__1__ = Accepted
__3__ = Deleted + submitted_by|integer|Unique id of the user who has ownership of the game. + date_added|integer|Unix timestamp of date game was registered. + date_updated|integer|Unix timestamp of date game was updated. + date_live|integer|Unix timestamp of date game was set live. + name|string|Name of the game. + name_id|string|Path for the game on mod.io. For example: https://mod.io/g/gamename + summary|string|Summary of the games mod support. + instructions_url|string|Link to a mod.io guide, modding wiki or a page where modders can learn how to make and submit mods. + ugc_name|string|Word used to describe user-generated content (mods, items, addons etc). + presentation_option|integer|Presentation style used on the mod.io website:

__0__ = Grid View: Displays mods in a grid
__1__ = Table View: Displays mods in a table + submission_option|integer|Submission process modders must follow:

__0__ = Mod uploads must occur via the API using a tool created by the game developers
__1__ = Mod uploads can occur from anywhere, including the website and API + curation_option|integer|Curation options enabled by this game to approve mods:

__0__ = No curation: Mods are immediately available to play
__1__ = Price change approval: Pricing changes for marketplace mods queued for acceptance
__2__ = Full curation: All mods must be accepted by someone to be listed
__?__ = Combine to enable multiple features (see BITWISE fields) + community_options|integer|Community features enabled for this game:

__0__ = None
__1__ = Enable comments
__2__ = Enable guides
__4__ = Pin on homepage
__8__ = Show on homepage
__16__ = Show more on homepage
__32__ = Allow change status
__64__ = Enable Previews (Game must be hidden)
__128__ = Allow Preview Share-URL (Previews must be enabled)
__?__ = Combine to find games with multiple options enabled (see [BITWISE fields](#bitwise-and-bitwise-and)) + monetisation_options|integer|Monetisation features mods can enable:

__0__ = None
__1__ = Enabled
__2__ = Allow mods to be sold (marketplace)
__?__ = Combine to find games with multiple options enabled (see [BITWISE fields](#bitwise-and-bitwise-and)) + api_access_options|integer|Level of API access allowed by this game:

__0__ = None
__1__ = Allow 3rd parties to access this games API endpoints
__2__ = Allow mods to be downloaded directly (if disabled all download URLs will contain a frequently changing verification hash to stop unauthorized use)
__?__ = Combine to find games with multiple options enabled (see [BITWISE fields](#bitwise-and-bitwise-and) + maturity_options|integer|Mature content setup for this game:

__0__ = Don't allow mature content in mods
__1__ = Allow mature content in mods
__2__ = This game is for mature audiences only
__?__ = Combine to find games with multiple options enabled (see [BITWISE fields](#bitwise-and-bitwise-and) + + Display|Type|Description + ---|---|--- + show_hidden_tags|bool|show the hidden tags associated with the given game. + + Sort|Description + ---|--- + popular|Sort results by popularity using [_sort filter](#filtering), value should be `popular` for descending or `-popular` for ascending results.

__NOTE:__ Popularity is calculated hourly and reset daily (results are ranked from 1 to X). You should sort this column in ascending order `-popular` to get the top ranked results. + popular_overall|Sort results by 'Popular Overall' using [_sort filter](#filtering), value should be `popular_overall` for descending or `-popular_overall` for ascending results.

__NOTE:__ You should sort this column in ascending order `-popular_overall` to get the top ranked results. This filter differs from popular by filtering on the amount of downloads the game has received overall, and not just in the last 24 hours. + subscribers|Sort results by most subscribers using [_sort filter](#filtering), value should be `subscribers` for descending or `-subscribers` for ascending results. > Example response @@ -13568,10 +13649,90 @@ Get all mod rating's submitted by the _authenticated user_. Successful request w { "data": [ { - "game_id": 2, - "mod_id": 2, - "rating": -1, - "date_added": 1492564103 + "id": 2, + "status": 1, + "submitted_by": null, + "date_added": 1493702614, + "date_updated": 1499410290, + "date_live": 1499841403, + "presentation_option": 0, + "submission_option": 1, + "curation_option": 0, + "community_options": 3, + "monetisation_options": 0, + "revenue_options": 0, + "api_access_options": 3, + "maturity_options": 0, + "ugc_name": "mods", + "icon": { + "filename": "icon.png", + "original": "https://assets.modcdn.io/images/placeholder/icon.png", + "thumb_64x64": "https://assets.modcdn.io/images/placeholder/icon.png", + "thumb_128x128": "https://assets.modcdn.io/images/placeholder/icon.png", + "thumb_256x256": "https://assets.modcdn.io/images/placeholder/icon.png" + }, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "header": { + "filename": "modio-logo-bluedark.png", + "original": "https://assets.modcdn.io/images/branding/modio-logo-bluedark.png" + }, + "name": "Rogue Knight", + "name_id": "rogue-knight", + "summary": "Rogue Knight is a brand new 2D pixel platformer that supports custom levels and characters.", + "instructions": "Instructions on the process to upload mods.", + "instructions_url": "https://www.rogue-knight-game.com/modding/getting-started", + "profile_url": "https://mod.io/g/rogue-knight", + "other_urls": [ + { + "label": "Our Steam Page", + "url": "https://www.steampowered.com/2348329042" + } + ], + "tag_options": [ + { + "name": "Theme", + "type": "checkboxes", + "tags": [ + "Horror" + ], + "tag_count_map": { + "Horror": 52 + }, + "hidden": false, + "locked": false + } + ], + "stats": { + "game_id": 2, + "mods_count_total": 13, + "mods_downloads_today": 204, + "mods_downloads_total": 27492, + "mods_downloads_daily_average": 1230, + "mods_subscribers_total": 16394, + "date_expires": 1492564103 + }, + "theme": { + "primary": "#44bfd5", + "dark": "#2c2c3f", + "light": "#ffffff", + "success": "#68D391", + "warning": "#d6af2e", + "danger": "#ff000e" + }, + "platforms": [ + { + "platform": "ps5", + "label": "PlayStation 5", + "moderated": true, + "locked": true + } + ] }, { ... @@ -13584,46 +13745,47 @@ Get all mod rating's submitted by the _authenticated user_. Successful request w } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get User Ratings](#schemaget_user_ratings) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Games](#schemaget_games) -# Guides - -## Get Guides +## Get User Subscriptions > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/me/subscribed \ + -H 'Authorization: Bearer {access-token}' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/me/subscribed HTTP/1.1 Host: *.modapi.io Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides', + url: 'https://*.modapi.io/v1/me/subscribed', method: 'get', - data: '?api_key=YourApiKey', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -13635,11 +13797,12 @@ $.ajax({ const request = require('node-fetch'); const headers = { + 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/me/subscribed', { method: 'GET', @@ -13655,18 +13818,19 @@ fetch('https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey', ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides', params={ - 'api_key': 'YourApiKey' +r = requests.get('https://*.modapi.io/v1/me/subscribed', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/me/subscribed"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -13681,25 +13845,36 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/guides` +`GET /me/subscribed` -Get all guides for a game. Successful request will return an array of [Guide Objects](#get-guides). +Get all mod's the _authenticated user_ is subscribed to. Successful request will return an array of [Mod Objects](#get-mods-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. Filter|Type|Description ---|---|--- - id|integer|Unique id of the guide. + id|integer|Unique id of the mod. game_id|integer|Unique id of the parent game. - status|integer|Status of the guide (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted
__1__ = Accepted _(default)_ - date_added|integer|Unix timestamp of date guide was registered. - date_updated|integer|Unix timestamp of date guide was updated. - date_live|integer|Unix timestamp of date guide was set live. - name_id|string|Path for the guide on mod.io. For example: https://mod.io/g/gamename/r/__guide-name-id-here__ - tags|string|Comma-separated values representing the tags you want to filter the results by. If you specify multiple tags, only guides which have all tags will be returned. + status|integer|Status of the mod (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted _(default)_
__1__ = Accepted _(default)_
__3__ = Deleted + visible|integer|Visibility of the mod (only game admins can filter by this field, see [status and visibility](#status-amp-visibility) for details):

__0__ = Hidden _(default)_
__1__ = Public _(default)_ + submitted_by|integer|Unique id of the user who has ownership of the mod. + date_added|integer|Unix timestamp of date mod was registered. + date_updated|integer|Unix timestamp of date mod was updated. + date_live|integer|Unix timestamp of date mod was set live. + maturity_option|integer|Maturity option(s) set by the mod creator:

__0__ = None
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) + monetisation_options|integer|Monetisation option(s) enabled by the mod creator:

__0__ = None
__1__ = Enabled
__2__ = Marketplace On
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) + name|string|Name of the mod. + name_id|string|Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__ + modfile|integer|Unique id of the file that is the current active release (see [mod files](#files)). + metadata_blob|string|Metadata stored by the game developer. + metadata_kvp|string|Colon-separated values representing the key-value pairs you want to filter the results by. If you supply more than one key-pair, separate the pairs by a comma. Will only filter by an exact key-pair match. + tags|string|Comma-separated values representing the tags you want to filter the results by. If you specify multiple tags, only mods which have all tags will be returned, and only tags that are supported by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). If you want to ensure mods returned do not contain particular tag(s), you can use the `tags-not-in` filter either independently or alongside this filter. + platform_status|string|If the parent game has enabled per-platform files, by default only mods with files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To QA mods with pending files, you can filter results by their current platform status, using `pending_only` or `live_and_pending`.

__NOTE:__ only game admins can filter by this field. Sort|Description ---|--- + downloads|Sort results by most downloads using [_sort filter](#filtering) parameter, value should be `downloads` for descending or `-downloads` for ascending results. popular|Sort results by popularity using [_sort filter](#filtering), value should be `popular` for descending or `-popular` for ascending results.

__NOTE:__ Popularity is calculated hourly and reset daily (results are ranked from 1 to X). You should sort this column in ascending order `-popular` to get the top ranked results. - popular_overall|Sort results by 'Popular Overall' using [_sort filter](#filtering), value should be `popular_overall` for descending or `-popular_overall` for ascending results.

__NOTE:__ You should sort this column in ascending order `-popular_overall` to get the top ranked results. This filter differs from popular by filtering on the amount of visits it has received overall, and not just in the last 24 hours. + rating|Sort results by weighted rating using [_sort filter](#filtering), value should be `rating` for descending or `-rating` for ascending results. + subscribers|Sort results by most subscribers using [_sort filter](#filtering), value should be `subscribers` for descending or `-subscribers` for ascending results. > Example response @@ -13707,17 +13882,11 @@ Get all guides for a game. Successful request will return an array of [Guide Obj { "data": [ { - "id": 1209, - "game_id": 3, - "game_name": "My Awesome Game", - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "user": { + "id": 2, + "game_id": 2, + "status": 1, + "visible": 1, + "submitted_by": { "id": 1, "name_id": "xant", "username": "XanT", @@ -13734,29 +13903,106 @@ Get all guides for a game. Successful request will return an array of [Guide Obj "language": "", "profile_url": "https://mod.io/u/xant" }, - "date_added": 1509922961, - "date_updated": 1509922961, - "date_live": 1509922961, - "status": 1, - "url": "https://mod.io/g/rogue-knight/r/getting-started", - "name": "Getting Started", - "name_id": "getting-started", - "summary": "Alright, so let's get started with modding on mod.io", - "description": "

Getting Started

Download this suspiciou....", - "tags": [ + "date_added": 1492564103, + "date_updated": 1499841487, + "date_live": 1499841403, + "maturity_option": 0, + "community_options": 3, + "monetisation_options": 0, + "price": 0, + "tax": 0, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "homepage_url": "https://www.rogue-hdpack.com/", + "name": "Rogue Knight HD Pack", + "name_id": "rogue-knight-hd-pack", + "summary": "It's time to bask in the glory of beautiful 4k textures!", + "description": "

Rogue HD Pack does exactly what you thi...", + "description_plaintext": "Rogue HD Pack does exactly what you thi...", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", + "media": { + "youtube": [ + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ], + "sketchfab": [ + "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" + ], + "images": [ + { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + } + ] + }, + "modfile": { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] + }, + "platforms": [ { - "name": "Instructions", - "date_added": 1499841487, - "count": 22 + "platform": "windows", + "modfile_live": 1 } ], - "stats": [ + "metadata_kvp": [ { - "guide_id": 2, - "visits_total": 0, - "comments_total": 0 + "metakey": "pistol-dmg", + "metavalue": "800" } - ] + ], + "tags": [ + { + "name": "Unity", + "date_added": 1499841487 + } + ], + "stats": { + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 + } }, { ... @@ -13769,44 +14015,51 @@ Get all guides for a game. Successful request will return an array of [Guide Obj } ``` -

Responses

+

Cross-Platform Filtering

+ +If the parent game has platform filtering enabled, this endpoint supports the [targeting a platform](#targeting-a-platform) request header to return the [mods](#mod-object) that are approved for the requested platform. Note: To target a platform for this endpoint, you MUST also include the `game_id` filter for the game that has cross-platform filtering enabled. + +

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Guides](#schemaget_guides) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Mods](#schemaget_mods) -## Get Guide +## Get User Mods > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiKey \ +curl -X GET https://*.modapi.io/v1/me/mods \ + -H 'Authorization: Bearer {access-token}' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiKey HTTP/1.1 +GET https://*.modapi.io/v1/me/mods HTTP/1.1 Host: *.modapi.io Accept: application/json +Authorization: Bearer {access-token} ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', + url: 'https://*.modapi.io/v1/me/mods', method: 'get', - data: '?api_key=YourApiKey', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -13818,11 +14071,12 @@ $.ajax({ const request = require('node-fetch'); const headers = { + 'Authorization':'Bearer {access-token}', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/me/mods', { method: 'GET', @@ -13838,18 +14092,19 @@ fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiK ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', params={ - 'api_key': 'YourApiKey' +r = requests.get('https://*.modapi.io/v1/me/mods', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/me/mods"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); @@ -13864,310 +14119,216 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/guides/{guide-id}` +`GET /me/mods` -Get a guide. Successful request will return a single [Guide Object](#guide-object). +Get all mods the _authenticated user_ added or is a team member of. Successful request will return an array of [Mod Objects](#get-mods-2). We recommended reading the [filtering documentation](#filtering) to return only the records you want. + + Filter|Type|Description + ---|---|--- + id|integer|Unique id of the mod. + game_id|integer|Unique id of the parent game. + status|integer|Status of the mod:

__0__ = Not accepted _(default)_
__1__ = Accepted _(default)_
__3__ = Deleted _(default)_ + visible|integer|Visibility of the mod:

__0__ = Hidden _(default)_
__1__ = Public _(default)_ + submitted_by|integer|Unique id of the user who has ownership of the mod. + date_added|integer|Unix timestamp of date mod was registered. + date_updated|integer|Unix timestamp of date mod was updated. + date_live|integer|Unix timestamp of date mod was set live. + maturity_option|integer|Maturity option(s) set by the mod creator:

__0__ = None
__1__ = Alcohol
__2__ = Drugs
__4__ = Violence
__8__ = Explicit
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) + monetisation_options|integer|Monetisation option(s) enabled by the mod creator:

__0__ = None
__1__ = Enabled
__2__ = Marketplace On
__?__ = Add the options you want together, to enable multiple filters (see [BITWISE fields](#bitwise-and-bitwise-and)) + name|string|Name of the mod. + name_id|string|Path for the mod on mod.io. For example: https://mod.io/g/gamename/m/__mod-name-id-here__ + modfile|integer|Unique id of the file that is the current active release (see [mod files](#files)). + metadata_blob|string|Metadata stored by the game developer. + metadata_kvp|string|Colon-separated values representing the key-value pairs you want to filter the results by. If you supply more than one key-pair, separate the pairs by a comma. Will only filter by an exact key-pair match. + tags|string|Comma-separated values representing the tags you want to filter the results by. If you specify multiple tags, only mods which have all tags will be returned, and only tags that are supported by the parent game can be applied. To determine what tags are eligible, see the tags values within `tag_options` column on the parent [Game Object](#game-object). If you want to ensure mods returned do not contain particular tag(s), you can use the `tags-not-in` filter either independently or alongside this filter. + platform_status|string|If the parent game has enabled per-platform files, by default only mods with files which are approved and live for the [target platform](#targeting-a-platform) will be returned.

To request mods with pending files, you can filter results by their current platform status, using `pending_only` or `live_and_pending`. + + Sort|Description + ---|--- + downloads|Sort results by most downloads using [_sort filter](#filtering) parameter, value should be `downloads` for descending or `-downloads` for ascending results. + popular|Sort results by popularity using [_sort filter](#filtering), value should be `popular` for descending or `-popular` for ascending results.

__NOTE:__ Popularity is calculated hourly and reset daily (results are ranked from 1 to X). You should sort this column in ascending order `-popular` to get the top ranked results. + rating|Sort results by weighted rating using [_sort filter](#filtering), value should be `rating` for descending or `-rating` for ascending results. + subscribers|Sort results by most subscribers using [_sort filter](#filtering), value should be `subscribers` for descending or `-subscribers` for ascending results. > Example response ```json { - "id": 1209, - "game_id": 3, - "game_name": "My Awesome Game", - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" - }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1509922961, - "date_updated": 1509922961, - "date_live": 1509922961, - "status": 1, - "url": "https://mod.io/g/rogue-knight/r/getting-started", - "name": "Getting Started", - "name_id": "getting-started", - "summary": "Alright, so let's get started with modding on mod.io", - "description": "

Getting Started

Download this suspiciou....", - "tags": [ - { - "name": "Instructions", - "date_added": 1499841487, - "count": 22 - } - ], - "stats": [ + "data": [ { - "guide_id": 2, - "visits_total": 0, - "comments_total": 0 - } - ] -} - -``` -

Responses

- -Status|Meaning|Error Ref|Description|Response Schema ----|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Guide Object](#schemaguide_object) - -## Add Guide - -> Example request - -```shell -# You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/guides \ - -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: multipart/form-data' \ - -H 'Content-Type: multipart/form-data' \ - -H 'Accept: application/json' \ - -F 'name=Modding Guide for Rogue Knight' \ - -F 'summary=Short descriptive summary here' \ - -F 'description=

Getting started with..' \ - -F 'logo=@/path/to/image.jpg' \ - -F 'date_live=1626667557' - -``` - -```http -POST https://*.modapi.io/v1/games/{game-id}/guides HTTP/1.1 -Host: *.modapi.io -Content-Type: multipart/form-data -Accept: application/json -Authorization: Bearer {access-token} -Content-Type: multipart/form-data - -``` - -```javascript -var headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', - 'Content-Type':'multipart/form-data', - 'Accept':'application/json' - -}; - -$.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides', - method: 'post', - - headers: headers, - success: function(data) { - console.log(JSON.stringify(data)); - } -}) -``` - -```javascript--nodejs -const request = require('node-fetch'); -const inputBody = '{ - "name": "Modding Guide for Rogue Knight", - "summary": "Short descriptive summary here", - "description": "

Getting started with..", - "logo": "@/path/to/image.jpg", - "date_live": 1626667557 -}'; -const headers = { - 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', - 'Content-Type':'multipart/form-data', - 'Accept':'application/json' - -}; - -fetch('https://*.modapi.io/v1/games/{game-id}/guides', -{ - method: 'POST', - body: inputBody, - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); -``` - -```python -import requests -headers = { - 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'multipart/form-data', - 'Content-Type': 'multipart/form-data', - 'Accept': 'application/json' -} - -r = requests.post('https://*.modapi.io/v1/games/{game-id}/guides', params={ - -}, headers = headers) - -print r.json() -``` - -```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); -``` - -`POST /games/{game-id}/guides` - -Add a guide for a game. Successful request will return a single [Guide Object](#guide-object). - - Parameter|Type|Required|Description - ---|---|---|---| - logo|file|true|Image file which will represent your guides logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this image to make three thumbnails for the dimensions 320x180, 640x360 and 1280x720. - name|string|true|Name of your guide. - name_id|string||Path for the guide on mod.io. For example: https://mod.io/g/gamename/r/__guide-name-id-here__. If no `name_id` is specified the `name` will be used. For example: _'Stellaris Shader Guide'_ will become _'stellaris-shader-guide'_. Cannot exceed 80 characters. - summary|string|true|Summary for your guide, giving a brief overview of what it's about. Cannot exceed 250 characters. - description|string||Detailed description for your guide, which can include details such as 'About', 'Features', 'Install Instructions', 'FAQ', etc. HTML supported and encouraged. - url|string||Official homepage for your guide. Must be a valid URL. - tags[]|string||Tags to apply to the guide. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2). - date_live|integer||Unix timestamp of when this guide should go live. To release the guide immediately provide the current time along with the `status` value of 1. If this field is not provided and the `status` is 0, the guide will not be released. - -> Example response - -```json -{ - "id": 1209, - "game_id": 3, - "game_name": "My Awesome Game", - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + "id": 2, + "game_id": 2, + "status": 1, + "visible": 1, + "submitted_by": { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" + }, + "date_added": 1492564103, + "date_updated": 1499841487, + "date_live": 1499841403, + "maturity_option": 0, + "community_options": 3, + "monetisation_options": 0, + "price": 0, + "tax": 0, + "logo": { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + }, + "homepage_url": "https://www.rogue-hdpack.com/", + "name": "Rogue Knight HD Pack", + "name_id": "rogue-knight-hd-pack", + "summary": "It's time to bask in the glory of beautiful 4k textures!", + "description": "

Rogue HD Pack does exactly what you thi...", + "description_plaintext": "Rogue HD Pack does exactly what you thi...", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "profile_url": "https://mod.io/g/rogue-knight/m/rogue-knight-hd-pack", + "media": { + "youtube": [ + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ], + "sketchfab": [ + "https://sketchfab.com/models/ef40b2d300334d009984c8865b2db1c8" + ], + "images": [ + { + "filename": "card.png", + "original": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", + "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" + } + ] + }, + "modfile": { + "id": 2, + "mod_id": 2, + "date_added": 1499841487, + "date_scanned": 1499841487, + "virus_status": 0, + "virus_positive": 0, + "virustotal_hash": "", + "filesize": 15181, + "filesize_uncompressed": 16384, + "filehash": { + "md5": "2d4a0e2d7273db6b0a94b0740a88ad0d" + }, + "filename": "rogue-knight-v1.zip", + "version": "1.3", + "changelog": "VERSION 1.3 -- Changes -- Fixed critical castle floor bug.", + "metadata_blob": "rogue,hd,high-res,4k,hd textures", + "download": { + "binary_url": "https://*.modapi.io/v1/games/1/mods/1/files/1/download/c489a0354111a4d76640d47f0cdcb294", + "date_expires": 1579316848 + }, + "platforms": [ + { + "platform": "windows", + "status": 1 + } + ] + }, + "platforms": [ + { + "platform": "windows", + "modfile_live": 1 + } + ], + "metadata_kvp": [ + { + "metakey": "pistol-dmg", + "metavalue": "800" + } + ], + "tags": [ + { + "name": "Unity", + "date_added": 1499841487 + } + ], + "stats": { + "mod_id": 2, + "popularity_rank_position": 13, + "popularity_rank_total_mods": 204, + "downloads_today": 327, + "downloads_total": 27492, + "subscribers_total": 16394, + "ratings_total": 1230, + "ratings_positive": 1047, + "ratings_negative": 183, + "ratings_percentage_positive": 91, + "ratings_weighted_aggregate": 87.38, + "ratings_display_text": "Very Positive", + "date_expires": 1492564103 + } }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1509922961, - "date_updated": 1509922961, - "date_live": 1509922961, - "status": 1, - "url": "https://mod.io/g/rogue-knight/r/getting-started", - "name": "Getting Started", - "name_id": "getting-started", - "summary": "Alright, so let's get started with modding on mod.io", - "description": "

Getting Started

Download this suspiciou....", - "tags": [ { - "name": "Instructions", - "date_added": 1499841487, - "count": 22 + ... } ], - "stats": [ - { - "guide_id": 2, - "visits_total": 0, - "comments_total": 0 - } - ] + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)||Created|[Guide Object](#schemaguide_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14027|The authenticated user does not have permission to add guides to this game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Mods](#schemaget_mods) -## Edit Guide +## Get Users Muted > Example request ```shell # You can also use wget -curl -X POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id} \ +curl -X GET https://*.modapi.io/v1/me/users/muted \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: multipart/form-data' \ - -H 'Content-Type: multipart/form-data' \ - -H 'Accept: application/json' \ - -F 'name=Modding Guide for Rogue Knight' \ - -F 'summary=Short descriptive summary here' \ - -F 'description=

Getting started with..' \ - -F 'logo=@/path/to/image.jpg' \ - -F 'date_live=1626667557' + -H 'Accept: application/json' ``` ```http -POST https://*.modapi.io/v1/games/{game-id}/guides/{guide-id} HTTP/1.1 +GET https://*.modapi.io/v1/me/users/muted HTTP/1.1 Host: *.modapi.io -Content-Type: multipart/form-data + Accept: application/json Authorization: Bearer {access-token} -Content-Type: multipart/form-data ``` ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', - 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', - method: 'post', + url: 'https://*.modapi.io/v1/me/users/muted', + method: 'get', headers: headers, success: function(data) { @@ -14175,28 +14336,20 @@ $.ajax({ } }) ``` - -```javascript--nodejs -const request = require('node-fetch'); -const inputBody = '{ - "name": "Modding Guide for Rogue Knight", - "summary": "Short descriptive summary here", - "description": "

Getting started with..", - "logo": "@/path/to/image.jpg", - "date_live": 1626667557 -}'; + +```javascript--nodejs +const request = require('node-fetch'); + const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'multipart/form-data', - 'Content-Type':'multipart/form-data', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', +fetch('https://*.modapi.io/v1/me/users/muted', { - method: 'POST', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -14210,12 +14363,10 @@ fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'multipart/form-data', - 'Content-Type': 'multipart/form-data', 'Accept': 'application/json' } -r = requests.post('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', params={ +r = requests.get('https://*.modapi.io/v1/me/users/muted', params={ }, headers = headers) @@ -14223,9 +14374,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}"); +URL obj = new URL("https://*.modapi.io/v1/me/users/muted"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("POST"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -14238,124 +14389,83 @@ in.close(); System.out.println(response.toString()); ``` -`POST /games/{game-id}/guides/{guide-id}` - -Update an existing guide. Successful request will return the updated [Guide Object](#guide-object). +`GET /me/users/muted` - Parameter|Type|Required|Description - ---|---|---|---| - status|integer||Status of the guide, see [status and visibility](#status-amp-visibility) for details):

__0__ = Not accepted
__1__ = Accepted (game admins only)
__3__ = Deleted (use the [delete guide](#delete-guide) endpoint to set this status) - logo|file||Image file which will represent your guides logo. Must be gif, jpg or png format and cannot exceed 8MB in filesize. Dimensions must be at least 512x288 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this image to make three thumbnails for the dimensions 320x180, 640x360 and 1280x720. - name|string||Name of your guide. - name_id|string||Path for the guide on mod.io. For example: https://mod.io/g/gamename/r/__guide-name-id-here__. If no `name_id` is specified the `name` will be used. For example: _'Stellaris Shader Guide'_ will become _'stellaris-shader-guide'_. Cannot exceed 80 characters. - summary|string||Summary for your guide, giving a brief overview of what it's about. Cannot exceed 250 characters. - description|string||Detailed description for your guide, which can include details such as 'About', 'Features', 'Install Instructions', 'FAQ', etc. HTML supported and encouraged. - url|string||Official homepage for your guide. Must be a valid URL. - tags[]|string||Tags to apply to the guide. Every tag to apply requires a separate field with tags[] as the key (eg. tags[]=tag1, tags[]=tag2).

__NOTE:__ When editing a guide any tags you add or remove from the existing tags list will be added/removed, so if you do not wish to remove any tags you must re-submit all existing tags. - date_live|integer||Unix timestamp of when this guide should go live. To release the guide immediately provide the current time along with the `status` 1. If this field is not provided and the `status` is 0, the guide will not be released. +Get all users muted by the _authenticated user_. Successful request will return an array of [User Objects](#user-object). > Example response ```json { - "id": 1209, - "game_id": 3, - "game_name": "My Awesome Game", - "logo": { - "filename": "card.png", - "original": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_320x180": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_640x360": "https://assets.modcdn.io/images/placeholder/card.png", - "thumb_1280x720": "https://assets.modcdn.io/images/placeholder/card.png" - }, - "user": { - "id": 1, - "name_id": "xant", - "username": "XanT", - "display_name_portal": null, - "date_online": 1509922961, - "date_joined": 1509922961, - "avatar": { - "filename": "avatar.png", - "original": "https://assets.modcdn.io/images/placeholder/avatar.png", - "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", - "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + "data": [ + { + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" }, - "timezone": "", - "language": "", - "profile_url": "https://mod.io/u/xant" - }, - "date_added": 1509922961, - "date_updated": 1509922961, - "date_live": 1509922961, - "status": 1, - "url": "https://mod.io/g/rogue-knight/r/getting-started", - "name": "Getting Started", - "name_id": "getting-started", - "summary": "Alright, so let's get started with modding on mod.io", - "description": "

Getting Started

Download this suspiciou....", - "tags": [ { - "name": "Instructions", - "date_added": 1499841487, - "count": 22 + ... } ], - "stats": [ - { - "guide_id": 2, - "visits_total": 0, - "comments_total": 0 - } - ] + "result_count": 1, + "result_offset": 0, + "result_limit": 100, + "result_total": 1 } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||OK|[Guide Object](#schemaguide_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14036|The authenticated user does not have permission to edit guides to this game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14031|The guide status cannot be changed to accepted due to the request originating from a non-site admin whilst there is a DMCA report active against the guide.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get Muted Users](#schemaget_muted_users) -## Delete Guide +## Get User Ratings > Example request ```shell # You can also use wget -curl -X DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id} \ +curl -X GET https://*.modapi.io/v1/me/ratings \ -H 'Authorization: Bearer {access-token}' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' ``` ```http -DELETE https://*.modapi.io/v1/games/{game-id}/guides/{guide-id} HTTP/1.1 +GET https://*.modapi.io/v1/me/ratings HTTP/1.1 Host: *.modapi.io Accept: application/json Authorization: Bearer {access-token} -Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', - method: 'delete', + url: 'https://*.modapi.io/v1/me/ratings', + method: 'get', headers: headers, success: function(data) { @@ -14369,14 +14479,13 @@ const request = require('node-fetch'); const headers = { 'Authorization':'Bearer {access-token}', - 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', +fetch('https://*.modapi.io/v1/me/ratings', { - method: 'DELETE', + method: 'GET', headers: headers }) @@ -14391,11 +14500,10 @@ fetch('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', import requests headers = { 'Authorization': 'Bearer {access-token}', - 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.delete('https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}', params={ +r = requests.get('https://*.modapi.io/v1/me/ratings', params={ }, headers = headers) @@ -14403,9 +14511,9 @@ print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/{guide-id}"); +URL obj = new URL("https://*.modapi.io/v1/me/ratings"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("DELETE"); +con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -14418,56 +14526,85 @@ in.close(); System.out.println(response.toString()); ``` -`DELETE /games/{game-id}/guides/{guide-id}` +`GET /me/ratings` -Delete a guide. Successful request will return `204 No Content`. +Get all mod rating's submitted by the _authenticated user_. Successful request will return an array of [Rating Objects](#get-user-ratings). + + Filter|Type|Description + ---|---|--- + game_id|integer|Unique id of the parent game. + mod_id|integer|Unique id of the mod. + rating|integer|Type of rating applied:

__-1__ = Negative Rating
__1__ = Positive Rating + date_added|integer|Unix timestamp of date rating was submitted. > Example response ```json - 204 No Content +{ + "data": [ + { + "game_id": 2, + "mod_id": 2, + "rating": -1, + "date_added": 1492564103 + }, + { + ... + } + ], + "result_count": 70, + "result_offset": 0, + "result_limit": 100, + "result_total": 70 +} ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)||Successful Request. No Body Returned.|None -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14028|The authenticated user does not have permission to delete guides to this game. Ensure the user is part of the game team before attempting the request again.|[Error Object](#schemaerror_object) -403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|14031|The guide cannot be deleted due to the request originating from a non-site admin whilst there is a DMCA report active against the guide.|[Error Object](#schemaerror_object) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Request Successful|[Get User Ratings](#schemaget_user_ratings) -## Get Guides Tags +# General + +## Get Resource Owner > Example request ```shell # You can also use wget -curl -X GET https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey \ +curl -X POST https://*.modapi.io/v1/general/ownership \ + -H 'Authorization: Bearer {access-token}' \ + -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' ``` ```http -GET https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey HTTP/1.1 +POST https://*.modapi.io/v1/general/ownership HTTP/1.1 Host: *.modapi.io Accept: application/json +Authorization: Bearer {access-token} +Content-Type: application/x-www-form-urlencoded ``` ```javascript var headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; $.ajax({ - url: 'https://*.modapi.io/v1/games/{game-id}/guides/tags', - method: 'get', - data: '?api_key=YourApiKey', + url: 'https://*.modapi.io/v1/general/ownership', + method: 'post', + headers: headers, success: function(data) { console.log(JSON.stringify(data)); @@ -14479,13 +14616,15 @@ $.ajax({ const request = require('node-fetch'); const headers = { + 'Authorization':'Bearer {access-token}', + 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json' }; -fetch('https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey', +fetch('https://*.modapi.io/v1/general/ownership', { - method: 'GET', + method: 'POST', headers: headers }) @@ -14499,20 +14638,22 @@ fetch('https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey', ```python import requests headers = { + 'Authorization': 'Bearer {access-token}', + 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' } -r = requests.get('https://*.modapi.io/v1/games/{game-id}/guides/tags', params={ - 'api_key': 'YourApiKey' +r = requests.post('https://*.modapi.io/v1/general/ownership', params={ + }, headers = headers) print r.json() ``` ```java -URL obj = new URL("https://*.modapi.io/v1/games/{game-id}/guides/tags?api_key=YourApiKey"); +URL obj = new URL("https://*.modapi.io/v1/general/ownership"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); +con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); @@ -14525,39 +14666,47 @@ in.close(); System.out.println(response.toString()); ``` -`GET /games/{game-id}/guides/tags` +`POST /general/ownership` -Get all guide tags for a game. Successful request will return an array of [Guide Tag Objects](#get-guide-tags). +Get the user that is the original _submitter_ of a resource. Successful request will return a single [User Object](#user-object). + + __NOTE:__ Mods and games can be managed by teams of users, for the most accurate information you should use the [Team endpoints](#teams). + + Parameter|Type|Required|Description + ---|---|---|---| + resource_type|string|true|Type of resource you are checking the ownership of. Must be one of the following values:

- _games_
- _mods_
- _files_ + resource_id|integer|true|Unique id of the resource you are checking the ownership of. > Example response ```json { - "data": [ - { - "name": "Instructions", - "date_added": 1499841487, - "count": 22 - }, - { - ... - } - ], - "result_count": 70, - "result_offset": 0, - "result_limit": 100, - "result_total": 70 + "id": 1, + "name_id": "xant", + "username": "XanT", + "display_name_portal": null, + "date_online": 1509922961, + "date_joined": 1509922961, + "avatar": { + "filename": "avatar.png", + "original": "https://assets.modcdn.io/images/placeholder/avatar.png", + "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png", + "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png" + }, + "timezone": "", + "language": "", + "profile_url": "https://mod.io/u/xant" } ``` -

Responses

+

Responses

Status|Meaning|Error Ref|Description|Response Schema ---|---|----|---|---| -200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[Get Guide Tags](#schemaget_guide_tags) +200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)||Successful Request|[User Object](#schemauser_object) # Response Schemas ## Access Token Object