Skip to content

Instantly share code, notes, and snippets.

View zdne's full-sized avatar
💭
🚀

Z zdne

💭
🚀
View GitHub Profile
@zdne
zdne / collection-api.raw.txt
Last active December 21, 2015 10:28
API Blueprint collection example – http://apiblueprint.org
# Collection API
# Group Coupons
Group of all coupon-related resources.
## Coupon [/coupons/{id}]
A resource representing one coupon.
+ Coupon Object (application/json)
@zdne
zdne / something.md
Created July 31, 2013 14:40
cURL trace parser output

POST /shopping-cart

  • Request
    • Headers

        User-Agent:curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
        Host:curltraceparser.apiary.io
        Accept:*/*
        Content-Type:application/json
        Content-Length:39
      
@zdne
zdne / BasicExample.md
Last active December 13, 2015 21:28
Deprecated. This is an example file for the upcoming Apiary.io blog post on New API Blueprint Format.

Format: 1A Host: http://blog.acme.com

Basic ACME Blog API

NOTE: This document is outdated. Refer to the actual API Blueprint examples.

Welcome to the ACME Blog API. This API provides access to the ACME Blog service.

@zdne
zdne / MSON.apib
Last active August 29, 2015 14:27
Simplest possible API Blueprint with MSON
# Data Document
This document contains a description of a data.
# Data Structures
## Some Data (object)
- name: Z (string) - Good old name.
#!/bin/bash
echo -n "GitHub User: "
read USER
echo -n "GitHub Password: "
read -s PASS
echo ""
echo -n "GitHub Repo (e.g. foo/bar): "
@zdne
zdne / outline.markdown
Last active August 29, 2015 14:09
API Blueprint Outline

$KEY: $VALUE

$API_NAME

$DESCRIPTION

group $GROUP_NAME

$DESCRIPTION

$RESOURCE_NAME [$URI_TEMPLATE]

$DESCRIPTION

@zdne
zdne / stackedittest
Created August 11, 2014 20:30
Gist%20Fox%20API%20%2B%20Auth.md
FORMAT: 1A
# Gist Fox API
Gist Fox API is a **pastes service** similar to [GitHub's Gist](http://gist.github.com).
## Authentication
*Gist Fox API* uses OAuth Authorization. First you create a new (or acquire existing) OAuth token using Basic Authentication. After you have acquired your token you can use it to access other resources within token' scope.
## Media Types
Where applicable this API uses the [HAL+JSON](https://github.com/mikekelly/hal_specification/blob/master/hal_specification.md) media-type to represent resources states and affordances.
@zdne
zdne / HAL.markdown
Last active August 29, 2015 14:04
HAL description in MSON

HAL Object

  • _links - Links (to URIs)
    • {relation name}

      A resource may have multiple links that share the same link relation. For link relations that may have multiple links, we use an array of links.

@zdne
zdne / gist:55b7a38f52ca642e123b
Created April 30, 2014 09:43
New API Blueprint parser structure
#include <string>
#include <vector>
#include <regex>
enum MarkdownNodeType {
RootMarkdownNodeType = 0,
HeaderMarkdownNodeType,
ListItemMarkdownNodeType,
ParagraphMarkdownNodeType,
UndefinedMarkdownNodeType = -1
@zdne
zdne / gist:9333604
Created March 3, 2014 20:12
Trivial express.js app in CoffeeScript
express = require 'express'
app = express()
PORT = 1234
app.get '/machines', (req, res) ->
res.setHeader 'Content-Type', 'application/json'
machine =
type: 'bulldozer'
name: 'willy'