-
Notifications
You must be signed in to change notification settings - Fork 5
API spec
LomaxRx edited this page Nov 19, 2016
·
23 revisions
An API for accessing New America's CMS data
Version: 1.0.0
BasePath:/api
[ Jump to Models ]
<pre class="get"><code class="huge"><span class="http-method">get</span> /post</code></pre></div>
<div class="method-summary">Posts (<span class="nickname">postGet</span>)</div>
<div class="method-notes">All posts </div>
<h3 class="field-label">Query parameters</h3>
<div class="field-items">
<div class="param">**program** (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — limit by parent program </div><div class="param">**content_type** (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — type of content </div><div class="param">**subprogram** (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — associate subprogram </div><div class="param">**after** (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — inclusive greater than start date format: date</div><div class="param">**before** (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — inclusive less than end date format: date</div>
</div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
array[<a href="#Post">Post</a>]
</div>
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>[ {
"date" : "2000-01-23T04:56:07.000+00:00", "content_type" : { "api_name" : "aeiou", "name" : "aeiou" }, "story_excerpt" : "aeiou", "id" : "aeiou", "programs" : [ { "name" : "aeiou", "description" : "aeiou", "logo" : "aeiou", "id" : "aeiou", "subprograms" : [ { "name" : "aeiou", "id" : "aeiou", "url" : "aeiou" } ], "url" : "aeiou" } ], "subprograms" : [ "" ], "title" : "aeiou", "subheading" : "aeiou", "url" : "aeiou", "story_image" : "aeiou" } ]
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul>
<li><code>application/json</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
An array of posts
<h4 class="field-label">0</h4>
Unexpected error
<a href="#Error">Error</a>
get /author
Author Bio (authorGet)
**program** (optional)
<div class="param-desc"><span class="param-type">Query Parameter</span> — limit authors by programs </div><div class="param">**subprogram** (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — limit authors by subprograms </div><div class="param">**role** (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — search by role's name name </div><div class="param">**name** (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — search by author's name </div>
array[Author]
Content-Type: application/json
[ {
"profile_image" : "aeiou",
"full_name" : "aeiou",
"role" : "aeiou",
"short_bio" : "aeiou",
"last_name" : "aeiou",
"long_bio" : "aeiou",
"id" : "aeiou",
"position" : "aeiou",
"first_name" : "aeiou",
"posts" : [ {
"date" : "2000-01-23T04:56:07.000+00:00",
"content_type" : {
"api_name" : "aeiou",
"name" : "aeiou"
},
"story_excerpt" : "aeiou",
"id" : "aeiou",
"programs" : [ {
"name" : "aeiou",
"description" : "aeiou",
"logo" : "aeiou",
"id" : "aeiou",
"subprograms" : [ {
"name" : "aeiou",
"id" : "aeiou",
"url" : "aeiou"
} ],
"url" : "aeiou"
} ],
"subprograms" : [ "" ],
"title" : "aeiou",
"subheading" : "aeiou",
"url" : "aeiou",
"story_image" : "aeiou"
} ]
} ]
application/json
get /meta
Meta Data (metaGet)
Get data about content types, programs and subprograms
Content-Type: application/json
{
"content_types" : [ {
"api_name" : "aeiou",
"name" : "aeiou"
} ],
"programs" : [ {
"name" : "aeiou",
"description" : "aeiou",
"logo" : "aeiou",
"id" : "aeiou",
"subprograms" : [ {
"name" : "aeiou",
"id" : "aeiou",
"url" : "aeiou"
} ],
"url" : "aeiou"
} ],
"subprograms" : [ {
"name" : "aeiou",
"parent_programs" : [ "" ],
"id" : "aeiou"
} ]
}
application/json
get /meta/content_type
Content Types (metaContentTypesGet)
get list of all content types
Content-Type: application/json
{
"api_name" : "aeiou",
"name" : "aeiou"
}
application/json
get /meta/program
Programs (metaProgramsGet)
get list of all programs
Content-Type: application/json
{
"name" : "aeiou",
"description" : "aeiou",
"logo" : "aeiou",
"id" : "aeiou",
"subprograms" : [ {
"name" : "aeiou",
"id" : "aeiou",
"url" : "aeiou"
} ],
"url" : "aeiou"
}
application/json
<pre class="get"><code class="huge"><span class="http-method">get</span> /meta/subprogram</code></pre></div>
<div class="method-summary">Subprograms (<span class="nickname">metaSubprogramGet</span>)</div>
<div class="method-notes">get list of all subprograms</div>
<h3 class="field-label">Return type</h3>
<div class="return-type">
<a href="#Subprogram">Subprogram</a>
</div>
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"name" : "aeiou", "id" : "aeiou", "url": "aeiou", "parent_programs" : [ { "name" : "aeiou", "id" : "aeiou", "url" : "aeiou" } ] }
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul>
<li><code>application/json</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
Program list information
<a href="#Program">Program</a>
<h4 class="field-label">0</h4>
Unexpected error
<a href="#Error">Error</a>
id (optional)
String unique id
full_name (optional)
String full name of author
first_name (optional)
String author's first name
last_name (optional)
String author's last name
profile_image (optional)
String absolute path to author's image
role (optional)
String e.g executive, central
short_bio (optional)
long_bio (optional)
position (optional)
String position at new america
posts (optional)
programs (optional)
subprograms (optional)
content_type (optional)
id (optional)
String A unique string
title (optional)
String title of post
subheading (optional)
String subheading for
date (optional)
date publication date format: date
content_type (optional)
programs (optional)
array[Program] all associated programs
subprograms (optional)
array[Program] all associate subprograms
url (optional)
String absolute path to post
story_excerpt (optional)
String short excerpt for post
story_image (optional)
String absolute path to post's cover image