Memorandum For Members and Affiliates of the Intergalactic Computer Network Consider the situation in which several different centers are netted together, each center being highly individualistic and having its own special language and its own special way of doing things. Is it not desirable, or even necessary for all the centers to agree upon some language or, at least, upon some conventions for asking such questions as “What language do you speak?” At this extreme, the problem is essentially the one discussed by science fiction writers: “how do you get communications started among totally uncorrelated 'sapient' beings?.” GOOD API
WHAT WE THINK API IS GOOD API MACHINE EXPOSES INTERFACE ANOTHER MACHINE LEARNS & USES INTERFACE MACHINES MEET OVER THE NETWORK discovery machine to machine
REALITY GOOD API MACHINE EXPOSES INTERFACE ANOTHER HUMAN READS DOCUMENTATION HUMAN WRITES DOCUMENTATION ANOTHER MACHINE IS TAUGHT TO USE INTERFACE HUMANS MEET discovery
API TURK GOOD API MACHINE EXPOSES INTERFACE ANOTHER HUMAN READS DOCUMENTATION HUMAN WRITES DOCUMENTATION ANOTHER MACHINE IS TAUGHT TO USE INTERFACE HUMANS MEET
HUMANS INVOLVED • Error-prone • Opportunity for missed understanding • Doesn’t scale GOOD API speed and resources humans do errors is “title” the same as “heading”?
HUMANS IN API TURK GOOD API MACHINE EXPOSES INTERFACE ANOTHER HUMAN READS DOCUMENTATION HUMAN WRITES DOCUMENTATION ANOTHER MACHINE IS TAUGHT TO USE INTERFACE HUMANS MEET
HUMANS IN API TURK • API DISCOVERY • Understanding WHAT • Understanding HOW • Programming Is there a service… …that gives me weather in Paris… …and I know how to call? Great! Let’s hook it up with my program! GOOD API
AUTONOMOUS APIs GOOD API MACHINE EXPOSES INTERFACE & PROFILE AND REGISTER ITSELF AT DISCOVERY SERVICE ANOTHER MACHINE IS TRAINED TO USE A VOCABULARY & DISCOVERY SERVICE
• Share understanding at RUNTIME • Affordances • Data • Programming for a VOCABULARY not data structure • AUTONOMOUS service discovery GOOD API AUTONOMOUS APIs
DECLARATIVE CLIENT PROGRAMMING // Using a terms from schema.org dictionary, // find services that offers WeatherForecast. services = apiRegistry.find(WeatherForecast, { vocabulary: http:// schema.org}) // Query a service for WeatherForecast at GeoCoordinates. forecast = service.retrieve(WeatherForecast, { GeoCoordinates: … }) // Display Temperature print forecast(Temperature) GOOD API
• Reduce costs • Reduce errors • Reduce time to market • Enable scaling • Enable API changes, evolution, resilience • Enable reuse GOOD API FUTURE APIs Instagram client used for FB, Twitter, LinkedIn etc.
interactions: viewTodoCollection: description: | The `item` link is only available when there are items found in the lookup. scenarios: noTodos: when: storage: getTodos: [] then: links: - self actions: - create-todo status: success withTodo: when: storage: getTodos: - id: 1 body: Get milk completed: false then: links: - self - item actions: - create-todo status: success source: http://smizell.com/weblog/2016/hypermedia-design