Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Package Releases

Kyle Klaus edited this page Oct 10, 2017 · 8 revisions

Browse all package releases that belong to a build

Request

GET /api/builds/{build_id}/releases HTTP/1.1
Authentication: Bearer some-token

Response

HTTP/1.1 200 OK
Location: UPLOAD_URL

    [
    {
        "id": 1,
        "package_id": 1,
        "version": "7.1.22",
        "md5": "c18d9c4e25f2d3faef3f2bc998068861",
        "url": "https://s3-us-west-1.amazonaws.com/solder/mods/buildcraft/buildcraft-7.1.22.zip"
    },
    {
        "id": 2,
        "package_id": 2,
        "version": "2.0.0-beta-1",
        "md5": "76b8b5e2c34f62c1029bc148673a64ac",
        "url": "https://s3-us-west-1.amazonaws.com/solder/mods/iron-tanks/iron-tanks-2.0.0-beta-1.zip"
    },
    ]

Add a package release

Creating a package release is a two step process. First, POST all of the meta data for the release before sending it. This is a huge benefit over multipart, as this small and simple HTTP request has a much better chance of being successful first time than a request with a 20mb zip file in it. This small web request is likely to sneak through, and reduce the chance of that version being lost, which is so so so annoying.

Then, the HTTP response of the video contains a Location header with a URL to the archive upload endpoint:

Request

POST /api/releases HTTP/1.1
Authentication: Bearer some-token

    {
        "package_id": 1,
        "version": "7.1.22"
    }

Response

HTTP/1.1 200 OK
Location: UPLOAD_URL

    {
        "id": 1,
        "package_id": 1,
        "version": "7.1.22",
        "md5": "",
        "url": ""
    }

Upload a file archive

Using the Location provided, PUT the binary data as required. Whatever is successfully received by the server will overwrite any existing file. So you can use this endpoint to re-upload file too.

PUT UPLOAD_URL HTTP/1.1
Authorization: Bearer AUTH_TOKEN
Content-Length: CONTENT_LENGTH
Content-Type: CONTENT_TYPE

BINARY_FILE_DATA

Response

HTTP/1.1 200 OK
Location: UPLOAD_URL

    {
        "id": 1,
        "version": "7.1.22",
        "md5": "c18d9c4e25f2d3faef3f2bc998068861",
        "url": "https://s3-us-west-1.amazonaws.com/solder/mods/buildcraft/buildcraft-7.1.22.zip"
    }