Skip to content

Instantly share code, notes, and snippets.

View mamund's full-sized avatar

Mike Amundsen mamund

View GitHub Profile

Shopping API

  • Supports the book browsing experience and cart management
  • Scope: Public

Complete Shopping Profile

Operation Name Description Participants Resource(s) Emitted Events Operation Details Traits
listBooks() List books by category or release date Customer, Call Center Book Books.Listed Request Parameters: categoryId, releaseDate Returns: Books[] read
@mamund
mamund / suggest-working.md
Last active March 12, 2021 03:39
Working Skeleton for HAL-FORMS SUGGEST control

Below is an updated workinging model for HAL-FORMS options control. See notes below for details. Comments welcome.

{
  "_templates" : {
    "default" : {
      ...
      "properties" : [
        {
 "name" : "...", 
@mamund
mamund / loadUtils.js
Created May 20, 2020 19:15
Mike Amundsen's Postman Utilities
// ***********************************************
// Testing Utilities
// 2020-04 : @mamund
//
// NOTE:
// store in global variables
// load in Postman pre-request script block:
// var utils = eval(globals.loadUtils);
// use as needed:
// utils.checkStatus(200)
@mamund
mamund / setAuth0JWT.js
Last active November 27, 2023 14:42
auth0 JWT in Postman API Testing
/************************************************
Retrieve a JWT from Auth0 for Postman
2020-05-15 : @mamund @greatwebapis
NOTES:
1) create API definition in Auth0 with
"client_credential" (machine-to-machine)
2) pull the following from Auth0 API config:
- domain
@mamund
mamund / 2020-01-23b.js
Last active January 24, 2020 13:56
self-describing messages
/*
who does it better?
*/
// this
{
"rel" : "http://example.org/vocabularies/customer-communiations#customers/update-name-and-sms"
"href" : "http://example.org/customers/123"
"type" : "..."
}
@mamund
mamund / def-sample.xml
Last active August 17, 2020 21:49
ALPS document w/ various examples of the `def` element
<alps>
<doc>Sample Service</doc>
<!-- properties -->
<descriptor id="identifier" def="https://schema.org/identifier" />
<descriptor id="givenName" def="https://schema.org/givenName" />
<descriptor id="familyName" def="https://schema.org/familyName" />
<descriptor id="status" def="https://schema.org/status" />
<descriptor id="dateCreated" def="https://schema.org/dateCreated" />
<descriptor id="dateModified" def="https://schema.org/dateModified" />
@mamund
mamund / actions-01.json
Last active November 5, 2018 01:21
2018-11-OSLC-Gists
{
"task": [
{
"url" : "http://api.examples.org/137h96l7mpv",
"edit" : "http://api.examples.org/edit?id=137h96l7mpv",
"id": "137h96l7mpv",
"title": "LAX",
"completeFlag": "true",
"assignedUser": "bob",
"dateCreated": "2016-01-14T17:48:42.083Z",

Representors

JSON/NodeJS edition...

Item

{
  "Representer": {
@mamund
mamund / bulk-update.txt
Last active July 23, 2018 03:33
sample "bulk update" over http
**** REQUEST ****
GET /bulk-users?list=1,2,3 HTTP/1.1
HOST: example.org
**** RESPONSE ****
HTTP/1.1 200 OK
Location: http://bulk-users?list?1,2,3
ETag: "1q2w3e4r5t"
Content-Type: application/ps.bulk+json
@mamund
mamund / 01-h-factors.html
Last active July 16, 2017 21:41
H-Factors
<html>
<body>
<!-- Link Embed (LE) -->
<img src="http://www.example.org/images/logo" title="company logo" />
<!-- Link Outbound (LO) -->
<a href="http://www.example.org/search" title="view search page">Search</a>
<!-- Link Template (LT) -->