iron-bound-designs / exchange-addon-licensing

iThemes Exchange Licensing Add-on
GNU Affero General Public License v3.0
6 stars 2 forks source link

API Version Action #12

Closed TimothyBJacobs closed 9 years ago

TimothyBJacobs commented 9 years ago

This issue describes the /version/ API action. An outline of the API is specified in issue #8.

The version action is used to retrieve information about the latest version of the software, and a url to the download location.

Request

URL: https://www.youstore.com/itelic-api/version/ Verb: GET

Response

If the request is successful, i.e. a valid, active license key, the following response will be returned. Code: 200 OK

{
  "success": true,
  "body": {
    "version": "1.2.1",
    "package": "https://www.yourstore.com/itelic-api/secure-download-link",
    "expires": "2015-11-21T16:05:30"
  }
}

Fields

This will cover all possible errors, besides an authentication error resulting from not passing any license key. The message string MAY be changed in the future. The error code MUST NOT be changed.

Expired License Key

Code: 402 Payment Required Returned when the license key being used is Expired.

{
  "success": false,
  "error": {
    "code": 02,
    "message": "Your license key has expired."
  }
}
TimothyBJacobs commented 9 years ago

Complete.