#api.js-uiview.css-uiview.js-api.css-api
  //- TODO this should be an include with a markdown filter
  header.section API
  | WARNING: API is still subject to change

  h3 Overview
  ol
    li submit meta data (name, path, mime-type, size, user fields)
    li receive file ids (base64 ids)
    li upload files by id (ids must match)
    li retrieve meta data by id (/meta/${id})
      br
      | (this is useful for naming the file and showing progress)
    li retrieve file by id (/files/${id}/${name})
    li delete files or they will be deleted automatically
      | after 72 hours
  br
  | NOTE: if files are submitted with http auth
  | then they will require that auth to retrieve

  h3 CREATE meta data to retrieve ids
  pre
    code.
      # request
      curl dropsha.re/meta/new \\
        -X POST -H 'application/json' \\
        -d '[
                {
                    "name": "logo.png"
                  , "path": "/home/user/images/"
                  , "type": "image/png"
                  , "size": 1048
                  , "lastModifiedDate": "2011-09-20T16:16:48.000Z"
                }
              , {
                    "name": "anthem.m4a"
                  , "path": "/home/user/music/"
                  , "type": "audio/mp4"
                  , "size": 4440
                  , "lastModifiedDate": "2011-11-12T03:38:08.000Z"
                }
            ]'
      
      # response
      {
          "error": false
        , "errors": []
        , "result": [
              "xyz123"
            , "abc789"
          ]
      }

  h3 CREATE files
  pre
    code.
      # request
      curl dropsha.re/files/new \\
        -X POST \\
        --form xyz123=@/home/user/images/logo.png \\
        --form abc789=@/home/user/music/anthem.m4a
      
      # response
      {
          "error": false
        , "errors": []
        , "result": [
              {
                  "id": xyz123
                , "size": 1048
                , ...
              }
            , ...
          ]
      }

  h3 GET meta
  | You'll either get back meta data or an error
  pre
    code
      | curl dropsha.re/meta/xyz123

  h3 GET file
  | You'll either get back the file or an error
  pre
    code
      | curl dropsha.re/files/xyz123/any-name-you-like.any
