Skip to content

Instantly share code, notes, and snippets.

@jamztang
Forked from pinglamb/api_spec.json
Created November 3, 2011 17:00
Show Gist options
  • Save jamztang/1337052 to your computer and use it in GitHub Desktop.
Save jamztang/1337052 to your computer and use it in GitHub Desktop.
damn-api sample spec
{
"host": ["api.example.com", "api-staging.example.com"],
"headers": {
"X-EXAMPLE-DEVICE-TYPE": ["iphone", "android"],
"X-EXAMPLE-DEVICE-UUID": {
"value": "mock",
"optional": true
},
"X-EXAMPLE-APP-ID": ["com.example.iphone.app1", "com.example.iphone.app2", "com.example.android.app1"]
},
"api_groups": [
{
"name": "Account API",
"apis": [
{
"name": "Account Registration",
"type": "json",
"path": "/api/v1/account/register.json",
"method": "POST",
"body": {
"user[username]": "*",
"user[password]": "*",
"user[password_confirmation]": "*"
}
},
{
"name": "Get Account Info",
"type": "json",
"path": "/api/v1/account/profile.json",
"method": "GET",
"headers": {
"X-EXAMPLE-AUTH-TOKEN": "mock"
}
}
]
},
{
"name": "Articles API",
"apis": [
{
"name": "Get New Article Form",
"type": "web",
"path": "/api/v1/articles/new",
"method": "GET"
},
{
"name": "List Articles",
"type": "json",
"path": "/api/v1/articles.json",
"method": "GET",
"params": {
"page": "[0-9]*",
"per_page": {
"value": "[0-9]*",
"optional": true
}
}
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment