Get Started. It's Free
or sign up with your email address
Rocket clouds
API Strategy by Mind Map: API Strategy

1. Pragmatic REST principles

1.1. URIs

1.1.1. Well designed URI makes it easy to discover, consume, and extend

1.1.2. Collections of objects should consist of a plural noun

1.1.2.1. /customers

1.1.3. Single objects consist of a plural noun followed by id

1.1.3.1. /customers/Bob

1.1.3.2. /accounts/123456

1.1.4. OK to start URI with identifying path. e.g. version mumber

1.1.4.1. /1

1.1.5. After the identifying path, only collections and objects

1.1.5.1. /1/accounts/123456

1.1.6. Standard set of query parameters

1.1.6.1. count - to determine how many objects to return

1.1.6.2. start - to determine where to count from

1.1.6.3. q -for generic freeform search over collections

1.1.7. Methods

1.1.7.1. Singular objects

1.1.7.1.1. GET to read

1.1.7.1.2. PUT for update

1.1.7.1.3. DELETE for delete

1.1.7.2. Collections

1.1.7.2.1. GET to read whole or part of collection

1.1.7.2.2. POST to add new object to collection

1.2. Parameters

1.2.1. Use standard and easy to guess optional parameters

1.3. Return codes

1.3.1. Leverage HTML standards

1.3.1.1. e.g. 404 when path does not resolve to a real object

1.4. Hide everything else

1.4.1. Security, Rate Limiting, Routing

1.4.2. Use headers

1.5. Establish clear conventions for versioning

1.6. Examples

1.6.1. Insert new item into the cart POST http:// api.shopping.com/ cart/ cartName

1.6.2. Delete item from the cart DELETE http:// api.shopping.com/ cart/ cartName/ item/ itemName

1.6.3. List everything in the cart GET http:// api.shopping.com/ cart/ cartName

1.6.4. Get an item in the cart GET http:// api.shopping.com/ cart/ cartName/ item/ itemName

1.6.5. Replace an entire item PUT http:// api.shopping.com/ cart/ cartName/ item/ itemName

1.6.6. Delete the whole cart DELETE http:// api.shopping.com/ cart/ cartName

1.6.7. Look at items 20 through 29 in cart GET http:// api.shopping.com/ cart/ cartName? start = 20& count = 10.

2. Value Chain

2.1. Provider of API

2.1.1. Does the provider own business assets ?

2.2. Target Audience

2.2.1. What is the size of the audience ?

2.2.2. Are there different segments in the audience ?

2.2.3. How does the audience benefit ?

2.3. Business Assets provided

2.3.1. Who should have access to each asset

2.4. Types of applications supported

2.4.1. What benefits from the application

2.4.2. How will applications be discovered

2.5. Users of apps created

2.5.1. What benefits do they get

3. Business Models

3.1. Free

3.2. Developer Pays

3.2.1. Tiered

3.2.2. Usage Based (Pay as you Go)

3.2.3. Consumption of resource

3.2.3.1. Storage, Compute Units etc.

3.2.4. Freemium

3.3. Developer Gets Paid

3.3.1. Revenue Share

3.3.2. Affiliate

3.3.2.1. Cost per Click

3.3.2.2. Cost per Action

3.3.3. Referral

3.3.3.1. One Time Fee

3.3.3.2. Recurring share of revenue

3.4. Indirect

3.4.1. Increasing Awareness

3.4.2. Drive Sales of other products

4. Other

4.1. API Team

4.1.1. Developer Evangelist

4.1.1.1. Sells the idea to internal and external stakeholders

4.1.1.2. Engages with developers

4.1.1.3. Technical + Marketing skills

4.1.2. Product Manager

4.1.2.1. Drives the roadmap

4.1.2.2. Understands how the API is performing

4.1.2.3. Designs the API

4.1.3. Engineers

4.1.3.1. Design the API

4.1.3.2. Write the API

4.1.4. Quality Assurance

4.1.5. Marketing

4.1.5.1. Branding guidelines

4.1.6. Legal

4.1.6.1. Defines usage of corporate and customer data

4.1.6.2. Vets content licensed from third parties

4.2. Objections to APIs

4.2.1. Afraid content may be misused

4.2.1.1. Less risky than content on a web site

4.2.1.2. Can identify and shut down abusive users

4.2.2. Afraid of load on systems

4.2.2.1. Rate Limiting can be used

4.2.2.2. Increased load is good

4.2.3. Afraid of security threats

4.2.3.1. Measures used to protect websites must be used

4.2.4. Afraid of exposing business assets

4.2.4.1. Use rights management

5. Design Principles

5.1. Design for the audience

5.1.1. Direct - Developers

5.1.1.1. Technology

5.1.1.1.1. Structure - Pragmatic REST

5.1.1.1.2. Data Format - JSON

5.1.1.1.3. Security - OAuth

5.1.2. Indirect - End Users

5.1.2.1. Understand what end users want

5.2. Differentiate your API

5.2.1. Data is unique, complete, accurate

5.2.2. Better support or easier signup process

5.2.3. More reliable, faster

5.2.4. More developer friendly terms - e.g. relaxed rate limits

5.3. Make API easy to try and use

5.3.1. Some level of free access

5.3.2. Instant gratification

5.3.2.1. Console that provides immediate testing

5.3.2.2. Some APIs do not require signup or authentication

5.3.3. Easy Signup

5.3.3.1. Only few questions

5.4. Make API easy to understand

5.4.1. Don't publish function that are irrelevant

5.4.2. Bundle with code samples

5.4.3. REST lends itself to simpler APIs

5.5. Don't do anything weird

5.5.1. Stick to conventions

5.5.2. Avoid complex or custom security schemes

5.6. Versioning

5.6.1. Include "1" in the version path

5.6.2. Every time you change API try hard to avoid incrementing to "2"

5.6.2.1. Work hard to avoid breaking the contract of the API

5.6.3. Key questions

5.6.3.1. What happens to older versions

5.6.3.2. What happens to apps delivered on older versions

5.6.3.3. Do new versions support all functionality of old apps

5.6.3.4. How many "one-off" versions for special partners

5.6.4. Mediation to support versioning

5.6.4.1. Transformations of API

5.6.4.1.1. Protocol

5.6.4.1.2. Data

5.6.4.1.3. Versions

5.6.4.1.4. Credentials

5.7. Scaling

5.7.1. Memcache - Reduce traffic to database server

5.7.2. Mediation (Proxy) - cache entire API responses

5.7.3. CDN - for large files that don't change

6. Security and User Management

6.1. Identification

6.1.1. Who is making the API request ?

6.1.2. API Keys

6.1.2.1. Simple to hand out

6.1.2.1.1. Often not encrypted or signed

6.1.2.2. Mostly an audit tool

6.1.2.3. Can be used to filter and block rogue applications

6.1.2.3.1. DDOS

6.1.2.3.2. Breaching terms of use

6.2. Authentication

6.2.1. Are they really who they say are ?

6.2.2. HTTP Basic

6.2.2.1. Simple, Universal

6.2.2.2. Relies on SSL for security

6.2.3. OAuth

6.2.3.1. Avoids reliance on passwords

6.2.3.1.1. OAuth Token - grants access to one application to one API on behalf of one user

6.2.3.1.2. Password - grants every application access to everything the password can unlock

6.2.3.1.3. Users can change passwords without breaking the apps

6.2.3.2. Various options

6.2.3.2.1. Bearer Token

6.2.3.2.2. Signature Option

6.2.4. Session Based Authentication

6.2.4.1. Login with username / password

6.2.4.2. Returns a session key - used for subsequent calls

6.2.5. Cookie Based Authentication

6.2.5.1. Used if you have control over client implementations

6.2.5.2. Grab cookie at session start to authenticate

6.2.6. Other

6.2.6.1. SAML

6.2.7. Use SSL Encryption always

6.2.7.1. Proliferation of Wifi, Mobile etc

6.3. Authorization

6.3.1. Are they allowed to do what they are trying to do ?

6.3.2. Data Masking

6.3.2.1. Obfuscating data that client does not have access to

6.3.2.2. Common layer to perform such transformations

6.3.2.2.1. Allows having a single API that supports all client tpes

6.4. Threat Detection and Prevention

6.4.1. Data Attacks

6.4.1.1. Large inputs

6.4.1.2. Large documents, attachments

6.4.1.3. Header Bombs

6.4.1.4. Replay attacks

6.4.1.5. Message Tampering

6.4.2. SQL injection attacks

6.4.3. XML injection attacks

6.4.4. API Gateways can be used to filter traffic

7. Operations and Management

7.1. Operational Info on Demand

7.1.1. API Status Page

7.1.1.1. e.g. Twitter

7.2. Traffic Management

7.2.1. Quotas

7.2.1.1. Limit number of calls made during a certain period of time

7.2.1.1.1. Hour, Day, Week ..

7.2.1.1.2. Pick the right granularity to protect the system

7.2.1.2. Assignee

7.2.1.2.1. User

7.2.1.2.2. Application

7.2.1.3. Infrastructure

7.2.1.3.1. Ability to increase quota

7.2.1.3.2. Ability to reset quota

7.2.2. Throttling

7.2.2.1. APIs are not rejected but slowed down

7.2.2.2. Implemented by an API gateway

7.2.2.2.1. Store the API calls

7.2.3. Spike Arresting

7.2.3.1. Shutdown hyperactive clients

7.2.3.2. Prevent DDOS, inefficient clients etc.

7.3. API Documentation

7.3.1. Intuitive API

7.3.2. Type of Docs

7.3.2.1. Reference Documentation

7.3.2.1.1. Every - API, Parameter,Return Value

7.3.2.2. Quick Start Guide

7.3.2.2.1. Good examples

7.3.2.2.2. API Console

7.3.2.3. Troubleshooting

7.3.2.3.1. API Status

7.3.2.3.2. Diagnosing error codes

7.3.2.4. Operations Runbook

7.3.2.4.1. For internal consumption

7.3.2.4.2. Responses to common problems

8. API Gateways

8.1. Support Security Schemes

8.1.1. OAuth, HTTP Basic, ...

8.2. Implement Traffic Management Policies

8.3. Cache frequent API results

8.3.1. New node

8.4. Transform API Requests and Responses

8.4.1. REST <-> SOAP

8.5. Data transformations and URI Rewrites

8.5.1. Support older versions of APIs

9. API Tracking

9.1. Usage Metrics

9.2. Effectiveness Metrics

9.3. Performance Metrics