MacID web API

In an ongoing mission to fulfil feature requests, I’ve started work creating a RESTful web API for macid.co.

So far there is only one endpoint, and it currently takes no parameters but I will expand this based on requests and suggestions.

The MacID web API is currently v1 and all responses are in JSON.

The API location is very simple and can be served over https or http. Here’s the basic syntax, it’s as you would probably expect:

https://macid.co/api/{api-version}/{api-endpoint}

Version

Slightly confusing that the API is in v1 but there is also an endpoint called version”, but nonetheless it exists. You can get the latest version information by using this endpoint:

https://macid.co/api/v1/version

Which will output JSON like this:

{
    "public_version": "1.3",
    "public_version_components": [
        "1",
        "3"
    ],
    "internal_version": "1.3.0.0.12",
    "internal_version_components": [
        "1",
        "3",
        "0",
        "0",
        "12"
    ],
    "date_published": "26 October 2015",
    "date_published_timestamp": 1445817600,
    "URL": "https:\/\/macid.co\/app\/1.3\/MacID-for-OS-X.zip",
    "hash": "c4b4a9c39646b2fdd7697a20ac0451ebb1625313",
    "file_size": 1913636
}

public_version is the version that is displayed publicly on the MacID website.

public_version_components is an array of each version component split by the decimal point. This is useful for version checking.

internal_version is the internal version number used and is the number displayed in MacID for OS X. The first four components make up the public version number and the last components make up the internal build number. For example. 1.3.0.0.12 is build 12 of 1.3.0.0.

internal_version_components is an array of components split by the decimal point. Again, useful for version checking.

date_published is the date the build was uploaded to the server. Dates are UK time.

date_published_timestamp is the timestamp created from date_published.

URL is the hosted location of the current version as a .zip file. You will be responsible for checking the hash of the file if you choose to download from here.

hash is that sha1 hash of the .zip file when it was uploaded to the server. This is not generated during the API call.

file_size is, as you would expect, the size of the .zip file. This is generated during the API call and should not be used for checking validity.

In the future I will also add an endpoint for the beta version which will work much the same way.

Let me know if you have any ideas or suggestions!

Leave a Reply

Your email address will not be published. Required fields are marked *