Skip to content

Instantly share code, notes, and snippets.

View mamund's full-sized avatar

Mike Amundsen mamund

View GitHub Profile
@mamund
mamund / read-only-items.js
Created May 21, 2014 14:40
read-only extension for items -- add the "read-only" property to the item element.
{ "collection" :
{
"version" : "1.0",
"href" : "http://api.example.com/users",
"links" : [
],
"items" : [
{
@mamund
mamund / a-products.js
Last active August 29, 2015 14:02
supporting saved searches w/ Cj representations
{
"collection" :
{
"version" : "1.0",
"href" : "http://api.example.org/products",
"links" : [
{"rel" : "search", "href" : "http://api.example.org/search", "prompt" : "Search"},
{"rel" : "profile", "href" : "http://schema.org/Product"}
],
@mamund
mamund / 01-message.js
Last active August 29, 2015 14:04
message extensions
{
"url" : "http://api.example.com/1",
"givenName" : "Mike",
"familyname" : "Amundsen",
"email" : "mca@amundsen.com",
"phone" : "123-456-7890"
}
@mamund
mamund / bioalps-mamund.js
Last active August 29, 2015 14:05 — forked from jenzopr/gist:6bab8db26fb2fb767c08
adjusted bio-alps example to move the custom "_property" section elements in into the existing "data" section for each item
{
"collection" : {
"version" : "1.0",
"href" : "http://example.org/assemblies/",
"links" : [
{
"rel" : "profile",
"href" : "http://alps.example.org/bioassembly.xml"
},
{
@mamund
mamund / 01-list.js
Created August 25, 2014 15:16
supporting custom templates in Cj
{
"collection" : {
"version" : "1.0",
"href" : "http://api.example.com/list",
"links" : [
{"rel" : "payment", "href" : "http://api.example.com/payment", "prompt" : "Select Payment Method"}
],
"items" : [
@mamund
mamund / 01-embedd.js
Created August 25, 2014 15:44
cross-compatible "embed" for Cj. clients that support the "embedded" extension can ignore the links that are marked "render" : "embedded"
{
"collection": {
"href": "/characters.json",
"links" : [
{"rel" : "collection", "href" : "/characters/the_doctor/actors.json", "render" : "embedded"}
],
"embedded": [
{
@mamund
mamund / people-search.xml
Last active August 29, 2015 14:05
Google People Search ALPS document
<alps version="1.0">
<link rel="self" href="https://rawgit.com/mamund/9ed1614903f5bddec660/raw/b5e5d0f7250ca5af4169e369036289e52fd6f290/people-search.xml" />
<link rel="help" href="https://developers.google.com/+/api/latest/people/search" />
<doc type="text">
Search all public profiles. Try it now or see an example.
For large result sets, results are paginated. For the most up-to-date search results,
do not use a pageToken older than five minutes. Instead, restart pagination by
repeating the original request (omitting pageToken).
</doc>
@mamund
mamund / restfest2014-todo.xml
Created September 1, 2014 22:26
RESTFest 2014 ToDo API ALPS Document
<alps version="1.0">
<link rel="help" href="https://github.com/RESTFest/2014-Greenville/wiki/Hack%20Day" />
<!-- semantic descriptors (data elements) -->
<descriptor id="todoid" type="semantic" />
<descriptor id="todoTitle" type="semantic" />
<descriptor id="todoDateDue" type="semantic" />
<descriptor id="todoNotes" type="semantic" />
<descriptor id="categoryid" type="semantic" />
<descriptor id="categoryTitle" type="semantic" />
@mamund
mamund / comment-puzzler.js
Created September 4, 2014 20:37
OData puzzlers
// dealing with comments related to multiple entities
{
"comment" : {
"id" : "...",
"dateCreated" : "...",
"authorId" : "...",
"commentText" : "...",
"associations" : [
{"id" : "...", "type" : "problem"},
{"id" : "...", "type" : "incident"},
@mamund
mamund / 01-list.html
Last active August 29, 2015 14:07
InfoQ API Design Methodology Examples. To-Do List and Item representations for HTML, ALPS profile for To-Do Service
<html>
<head>
<!-- for test display only -->
<title>To Do List</title>
<style>
.name, .scheduledTime, .status, .item {display:block}
</style>
</head>
<body>
<!-- for test display only -->