Skip to content

Instantly share code, notes, and snippets.

@ivanvanderbyl
Last active December 11, 2015 19:09
Show Gist options
  • Select an option

  • Save ivanvanderbyl/4646960 to your computer and use it in GitHub Desktop.

Select an option

Save ivanvanderbyl/4646960 to your computer and use it in GitHub Desktop.

Revisions

  1. ivanvanderbyl revised this gist Feb 3, 2013. 1 changed file with 29 additions and 25 deletions.
    54 changes: 29 additions & 25 deletions Versions.md
    Original file line number Diff line number Diff line change
    @@ -15,14 +15,15 @@
    {
    "versions": [
    {
    "id": "ae45868e-3f1a-11e2-92da-1231394268a3",
    "app_id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "bundle_url": "https://www.filepicker.io/api/file/SECRET",
    "id": "c541ce63-2851-44c2-835f-10c9e55390f3",
    "app_id": "b197bce7-5eaa-4ab1-aae8-9c53f961b490",
    "state": "ready",
    "bundle_url": "https://www.filepicker.io/api/file/3JAgsZ0QSBl7vAhV79Pw",
    "version_string": "1.0",
    "default_image": "https://www.filepicker.io/api/file/SECRET",
    "default_image": "https://www.filepicker.io/api/file/cLpSGCypTz2Cs8NYTr6W",
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "created_at": "2013-02-03T10:08:13Z",
    "updated_at": "2013-02-03T10:08:29Z",
    "comments": [

    ]
    @@ -48,14 +49,15 @@
    ```json
    {
    "version": {
    "id": "ae45868e-3f1a-11e2-92da-1231394268a3",
    "app_id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "bundle_url": "https://www.filepicker.io/api/file/SECRET",
    "id": "c541ce63-2851-44c2-835f-10c9e55390f3",
    "app_id": "b197bce7-5eaa-4ab1-aae8-9c53f961b490",
    "state": "ready",
    "bundle_url": "https://www.filepicker.io/api/file/3JAgsZ0QSBl7vAhV79Pw",
    "version_string": "1.0",
    "default_image": "https://www.filepicker.io/api/file/SECRET",
    "default_image": "https://www.filepicker.io/api/file/cLpSGCypTz2Cs8NYTr6W",
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "created_at": "2013-02-03T10:08:13Z",
    "updated_at": "2013-02-03T10:08:29Z",
    "comments": [

    ]
    @@ -81,14 +83,15 @@
    ```json
    {
    "version": {
    "id": "ae45868e-3f1a-11e2-92da-1231394268a3",
    "app_id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "bundle_url": "https://www.filepicker.io/api/file/SECRET",
    "version_string": "1.0",
    "default_image": "https://www.filepicker.io/api/file/SECRET",
    "id": "c541ce63-2851-44c2-835f-10c9e55390f3",
    "app_id": "b197bce7-5eaa-4ab1-aae8-9c53f961b490",
    "state": "pending",
    "bundle_url": "https://www.filepicker.io/api/file/3JAgsZ0QSBl7vAhV79Pw",
    "version_string": null,
    "default_image": null,
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "created_at": "2013-02-03T10:08:13Z",
    "updated_at": "2013-02-03T10:08:13Z",
    "comments": [

    ]
    @@ -118,14 +121,15 @@
    ```json
    {
    "version": {
    "id": "ae45868e-3f1a-11e2-92da-1231394268a3",
    "app_id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "bundle_url": "https://www.filepicker.io/api/file/SECRET",
    "id": "c541ce63-2851-44c2-835f-10c9e55390f3",
    "app_id": "b197bce7-5eaa-4ab1-aae8-9c53f961b490",
    "state": "ready",
    "bundle_url": "https://www.filepicker.io/api/file/3JAgsZ0QSBl7vAhV79Pw",
    "version_string": "1.0",
    "default_image": "https://www.filepicker.io/api/file/SECRET",
    "default_image": "https://www.filepicker.io/api/file/cLpSGCypTz2Cs8NYTr6W",
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2013-01-27T16:09:01Z",
    "created_at": "2013-02-03T10:08:13Z",
    "updated_at": "2013-02-03T10:08:29Z",
    "comments": [

    ]
  2. ivanvanderbyl revised this gist Feb 3, 2013. 2 changed files with 10 additions and 8 deletions.
    8 changes: 4 additions & 4 deletions Apps.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@
    "device_type": "iPhone",
    "created_at": "2012-12-05T20:30:59Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "version_ids": [
    "versions": [
    "ae45868e-3f1a-11e2-92da-1231394268a3"
    ]
    }
    @@ -59,7 +59,7 @@
    "device_type": "iPhone",
    "created_at": "2012-12-05T20:30:59Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "version_ids": [
    "versions": [
    "ae45868e-3f1a-11e2-92da-1231394268a3"
    ]
    }
    @@ -91,7 +91,7 @@
    "device_type": "iPhone",
    "created_at": "2012-12-05T20:30:59Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "version_ids": [
    "versions": [
    "ae45868e-3f1a-11e2-92da-1231394268a3"
    ]
    }
    @@ -124,7 +124,7 @@
    "device_type": "iPhone",
    "created_at": "2012-12-05T20:30:59Z",
    "updated_at": "2013-1-20T18:31:09Z",
    "version_ids": [
    "versions": [
    "ae45868e-3f1a-11e2-92da-1231394268a3"
    ]
    }
    10 changes: 6 additions & 4 deletions Versions.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "comment_ids": [
    "comments": [

    ]
    }
    @@ -56,7 +56,7 @@
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "comment_ids": [
    "comments": [

    ]
    }
    @@ -89,7 +89,7 @@
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "comment_ids": [
    "comments": [

    ]
    }
    @@ -126,7 +126,7 @@
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2013-01-27T16:09:01Z",
    "comment_ids": [
    "comments": [

    ]
    }
    @@ -135,6 +135,8 @@

    ## Delete a Version `DELETE /api/versions/:id`

    **Warning**: This is a destructive action. Through the API we provide no undo functionality.

    - `DELETE /api/versions/:id` deletes this Version, returning nothing.

    ### Parameters
  3. ivanvanderbyl revised this gist Jan 27, 2013. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -66,12 +66,12 @@ If you incorrectly access a resource the API will respond with an `HTTP` status

    ### Error codes and their meaning:

    You can decide how to handle errors in your code based on the HTTP status code. These are some of the status codes we support in error responses, and their meaning:
    You can decide how to handle errors in your code based on the HTTP status code. These are some of the status codes we support in responses, and their meaning:

    - `200 OK` Your request was successful.
    - `201 Created` Your resource was created successfully.
    - `204 No Content` Your resource was deleted successfully _(Nothing to return, always contains an empty body)_.
    - `400 Bad Request` One of your inputs was imporperly encoded and could not be processed.
    - `400 Bad Request` One of your inputs was incorrectly encoded and could not be processed.
    - `401 Unauthorized` You need to provide authentication credentials, or your credentials were rejected.
    - `422` Record is invalid. One of the values you supplied for an attribute did not pass validation. Please retry with another value.
    - `500 Internal Server Error` We fucked up. We've been notified of the issue and our engineering team will fix the issue shortly. Please try again in a few hours.
    @@ -102,3 +102,9 @@ You can safely swap and replace any resource name mentioned in the docs with a a

    POST /api/apps


    Throughout the documentation we make reference to resources which may be nested under other resources, for example:

    GET /api/apps/:app_id/versions/:id

    In this case you can safely swap `app_id` with either the App `public_key` or App UUID formatted ID. For brevity this may not be mentioned in the documentation for every resource.
  4. ivanvanderbyl revised this gist Jan 27, 2013. 3 changed files with 45 additions and 5 deletions.
    8 changes: 5 additions & 3 deletions Apps.md
    Original file line number Diff line number Diff line change
    @@ -133,13 +133,15 @@

    ## Delete an App `DELETE /api/apps/:id`

    **Warning**: This is a destructive action. Through the API we provide no undo functionality.

    - `DELETE /api/apps/:id` deletes your App, returning nothing.
    - `DELETE /api/apps/:public_key` deletes your App, returning nothing.

    ### Inputs
    ### Parameters

    Nothing
    - `id` _Required_ String: The ID of the App to delete.

    ### Response:
    ### Response

    Status: 204 No Content
    38 changes: 38 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -64,3 +64,41 @@ If you incorrectly access a resource the API will respond with an `HTTP` status
    }
    ```

    ### Error codes and their meaning:

    You can decide how to handle errors in your code based on the HTTP status code. These are some of the status codes we support in error responses, and their meaning:

    - `200 OK` Your request was successful.
    - `201 Created` Your resource was created successfully.
    - `204 No Content` Your resource was deleted successfully _(Nothing to return, always contains an empty body)_.
    - `400 Bad Request` One of your inputs was imporperly encoded and could not be processed.
    - `401 Unauthorized` You need to provide authentication credentials, or your credentials were rejected.
    - `422` Record is invalid. One of the values you supplied for an attribute did not pass validation. Please retry with another value.
    - `500 Internal Server Error` We fucked up. We've been notified of the issue and our engineering team will fix the issue shortly. Please try again in a few hours.

    ## Understanding the documentation

    Our API makes extensive use of HTTP verbs to define endpoints, and instruct the server as to the nature of your request.

    The HTTP verbs we support are:

    - `GET`
    - `POST`
    - `PUT`
    - `DELETE`

    Each documented endpoint is written in a format similar to the following:

    GET /api/resource/:identifier
    PUT /api/apps/123

    To access this these resources using the `curl` command line utility you would run this command:

    $ curl https://kickfolio.com/api/apps/123 -X PUT -d '{"app" : {"name" : "New App Name"}}'

    The `:identifier` component is a variable component which you should replace with the record identifer you need.

    You can safely swap and replace any resource name mentioned in the docs with a another and access it in the same way. For example, all update actions are done using the `PUT` verb, and all creation actions are done using the `POST` verb.

    POST /api/apps

    4 changes: 2 additions & 2 deletions Versions.md
    Original file line number Diff line number Diff line change
    @@ -137,9 +137,9 @@

    - `DELETE /api/versions/:id` deletes this Version, returning nothing.

    ### Inputs
    ### Parameters

    Nothing
    - `id` _Required_ String: The ID of the Version to delete.

    ### Response

  5. ivanvanderbyl revised this gist Jan 27, 2013. 2 changed files with 50 additions and 1 deletion.
    2 changes: 1 addition & 1 deletion Apps.md
    Original file line number Diff line number Diff line change
    @@ -136,7 +136,7 @@
    - `DELETE /api/apps/:id` deletes your App, returning nothing.
    - `DELETE /api/apps/:public_key` deletes your App, returning nothing.

    ### Input:
    ### Inputs

    Nothing

    49 changes: 49 additions & 0 deletions Versions.md
    Original file line number Diff line number Diff line change
    @@ -95,3 +95,52 @@
    }
    }
    ```

    ## Update a Version `PUT /api/versions/:id`

    - `PUT /api/versions/:id` returns the updated representation of this Version.
    - `PUT /api/apps/:app_id/versions/:id` returns the updated representation of this Version.

    ### Parameters

    - `id` _Required_ String: The ID of the Version you want to update.

    ### Inputs

    - `app_id` _Required_ String: The ID of the App this Version belongs to. This can be omitted from the payload if supplied in the URI.
    - `bundle_url` _Required_ String: The URL to fetch your `.app` bundle from. This can be an valid URL which returns a ZIP file containing your App bundle.
    - `version_string` _Optional_ String: The version string for this Version of your App. E.g. `1.2.4`

    ### Response

    Status: 200 OK

    ```json
    {
    "version": {
    "id": "ae45868e-3f1a-11e2-92da-1231394268a3",
    "app_id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "bundle_url": "https://www.filepicker.io/api/file/SECRET",
    "version_string": "1.0",
    "default_image": "https://www.filepicker.io/api/file/SECRET",
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2013-01-27T16:09:01Z",
    "comment_ids": [

    ]
    }
    }
    ```

    ## Delete a Version `DELETE /api/versions/:id`

    - `DELETE /api/versions/:id` deletes this Version, returning nothing.

    ### Inputs

    Nothing

    ### Response

    Status: 204 No Content
  6. ivanvanderbyl revised this gist Jan 27, 2013. 1 changed file with 34 additions and 1 deletion.
    35 changes: 34 additions & 1 deletion Versions.md
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@

    ## Fetch a single Version `GET /api/versions/:id`

    - `GET /api/versions/:id` returns a single version
    - `GET /api/versions/:id` returns a single Version.
    - `GET /api/apps/:app_id/versions/:id` returns a single version, scoped by `app_id`. This will return a `404` if this version doesn't belong to `app_id`.

    ### Parameters
    @@ -62,3 +62,36 @@
    }
    }
    ```

    ## Create a Version `POST /api/versions`

    - `POST /api/versions` returns the newly created Version.
    - `POST /api/apps/:app_id/versions` returns the newly created Version.

    ### Input

    - `app_id` _Required_ String: The ID of the App this Version belongs to. This can be omitted from the payload if supplied in the URI.
    - `bundle_url` _Required_ String: The URL to fetch your `.app` bundle from. This can be an valid URL which returns a ZIP file containing your App bundle.
    - `version_string` _Optional_ String: The version string for this Version of your App. E.g. `1.2.4`

    ### Response

    Status: 201 Created

    ```json
    {
    "version": {
    "id": "ae45868e-3f1a-11e2-92da-1231394268a3",
    "app_id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "bundle_url": "https://www.filepicker.io/api/file/SECRET",
    "version_string": "1.0",
    "default_image": "https://www.filepicker.io/api/file/SECRET",
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "comment_ids": [

    ]
    }
    }
    ```
  7. ivanvanderbyl revised this gist Jan 27, 2013. 1 changed file with 33 additions and 1 deletion.
    34 changes: 33 additions & 1 deletion Versions.md
    Original file line number Diff line number Diff line change
    @@ -29,4 +29,36 @@
    }
    ]
    }
    ```
    ```

    ## Fetch a single Version `GET /api/versions/:id`

    - `GET /api/versions/:id` returns a single version
    - `GET /api/apps/:app_id/versions/:id` returns a single version, scoped by `app_id`. This will return a `404` if this version doesn't belong to `app_id`.

    ### Parameters

    - `id` _Required_ String: The ID of the Version you want to fetch.
    - `app_id` _Optional_ String: The ID of the App to scope this query to.

    ### Response

    Status: 200 OK

    ```json
    {
    "version": {
    "id": "ae45868e-3f1a-11e2-92da-1231394268a3",
    "app_id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "bundle_url": "https://www.filepicker.io/api/file/SECRET",
    "version_string": "1.0",
    "default_image": "https://www.filepicker.io/api/file/SECRET",
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "comment_ids": [

    ]
    }
    }
    ```
  8. ivanvanderbyl revised this gist Jan 27, 2013. 1 changed file with 32 additions and 0 deletions.
    32 changes: 32 additions & 0 deletions Versions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    ## List all Versions `GET /api/versions`

    - `GET /api/versions` returns a collection of all Versions on your account.
    - `GET /api/apps/:app_id/versions` returns a collection of Versions scoped to `app_id`

    ### Parameters

    - `ids` _Optional_ Array: An array of IDs to filter the collection. Designed to work with Ember Data bulk loading.

    ### Response

    Status: 200 OK

    ```json
    {
    "versions": [
    {
    "id": "ae45868e-3f1a-11e2-92da-1231394268a3",
    "app_id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "bundle_url": "https://www.filepicker.io/api/file/SECRET",
    "version_string": "1.0",
    "default_image": "https://www.filepicker.io/api/file/SECRET",
    "default_image_landscape": null,
    "created_at": "2012-12-05T20:31:00Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "comment_ids": [

    ]
    }
    ]
    }
    ```
  9. ivanvanderbyl revised this gist Jan 27, 2013. 1 changed file with 145 additions and 0 deletions.
    145 changes: 145 additions & 0 deletions Apps.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,145 @@
    ## List all Apps `GET /api/apps`

    - `GET /api/apps` returns a collection of Apps.

    ### Parameters

    - `ids` _Optional_ Array: An array of IDs to filter the collection. Designed to work with Ember Data bulk loading.

    ### Response

    Status: 200 OK

    ```json
    {
    "apps": [
    {
    "id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "user_id": "57198bee-3f1a-11e2-92da-1231394268a3",
    "name": "Kickfolio",
    "public_key": "ABCD123",
    "bundle": "com.kickfolio.app",
    "default_to_landscape": false,
    "icon": "https://www.filepicker.io/api/file/SECRET",
    "device_type": "iPhone",
    "created_at": "2012-12-05T20:30:59Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "version_ids": [
    "ae45868e-3f1a-11e2-92da-1231394268a3"
    ]
    }
    ]
    }
    ```

    ## Fetch a single App `GET /api/apps/:id`

    - `GET /api/apps/:id` returns a single App record.
    - `GET /api/apps/:public_key` returns a single App record.

    ### Input

    - `id` _Required_ 128bit UUID: App ID. Only required if `public_key` is not used.
    - `public_key` _Optional_ String: App public key, used in place of an `id` for short urls.

    ### Response

    Status: 200 OK

    ```json
    {
    "app": {
    "id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "user_id": "57198bee-3f1a-11e2-92da-1231394268a3",
    "name": "Kickfolio",
    "public_key": "ABCD123",
    "bundle": "com.kickfolio.app",
    "default_to_landscape": false,
    "icon": "https://www.filepicker.io/api/file/SECRET",
    "device_type": "iPhone",
    "created_at": "2012-12-05T20:30:59Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "version_ids": [
    "ae45868e-3f1a-11e2-92da-1231394268a3"
    ]
    }
    }
    ```

    ## Create a new App `POST /api/apps`

    - `POST /api/apps` creates a new App, returning the new record.

    ### Input

    - `name` _Required_ String: The name of your App.

    ### Response

    Status: 201 Created

    ```json
    {
    "app": {
    "id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "user_id": "57198bee-3f1a-11e2-92da-1231394268a3",
    "name": "Kickfolio",
    "public_key": "ABCD123",
    "bundle": "com.kickfolio.app",
    "default_to_landscape": false,
    "icon": "https://www.filepicker.io/api/file/SECRET",
    "device_type": "iPhone",
    "created_at": "2012-12-05T20:30:59Z",
    "updated_at": "2012-12-05T20:31:09Z",
    "version_ids": [
    "ae45868e-3f1a-11e2-92da-1231394268a3"
    ]
    }
    }
    ```

    ## Update an App `PUT /api/apps/:id`

    - `PUT /api/apps/:id` updates attributes of an existing app, returning result.
    - `PUT /api/apps/:public_key` updates attributes of an existing app, returning result.

    ### Input

    - `name` _Required_ String: The name of your App.

    ### Response

    Status: 200 OK

    ```json
    {
    "app": {
    "id": "ae42f072-3f1a-11e2-92da-1231394268a3",
    "user_id": "57198bee-3f1a-11e2-92da-1231394268a3",
    "name": "Kickfolio",
    "public_key": "ABCD123",
    "bundle": "com.kickfolio.app",
    "default_to_landscape": false,
    "icon": "https://www.filepicker.io/api/file/SECRET",
    "device_type": "iPhone",
    "created_at": "2012-12-05T20:30:59Z",
    "updated_at": "2013-1-20T18:31:09Z",
    "version_ids": [
    "ae45868e-3f1a-11e2-92da-1231394268a3"
    ]
    }
    }
    ```

    ## Delete an App `DELETE /api/apps/:id`

    - `DELETE /api/apps/:id` deletes your App, returning nothing.
    - `DELETE /api/apps/:public_key` deletes your App, returning nothing.

    ### Input:

    Nothing

    ### Response:

    Status: 204 No Content
  10. ivanvanderbyl revised this gist Jan 27, 2013. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -48,7 +48,7 @@ The versioning format is `application/vnd.kickfolio.v1` where `v1` is the versio

    ## Errors

    If you incorrectly access a resource the API will respond with a `HTTP` status code in the `4xx` space or `5xx` space depending on the cause. The body of the response will contain a JSON formatted error message based on the following schema:
    If you incorrectly access a resource the API will respond with an `HTTP` status code in the `4xx` space or `5xx` space depending on the cause. The body of the response will contain a JSON formatted error message based on the following schema:

    ```json
    {
    @@ -62,4 +62,5 @@ If you incorrectly access a resource the API will respond with a `HTTP` status c
    }
    ]
    }
    ```
    ```

  11. ivanvanderbyl revised this gist Jan 27, 2013. 1 changed file with 0 additions and 0 deletions.
    Binary file modified Readme.md
    Binary file not shown.
  12. ivanvanderbyl created this gist Jan 27, 2013.
    Binary file added Readme.md
    Binary file not shown.