Get Started. It's Free
or sign up with your email address
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 /customers

1.1.3. Single objects consist of a plural noun followed by id /customers/Bob /accounts/123456

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

1.1.5. After the identifying path, only collections and objects /1/accounts/123456

1.1.6. Standard set of query parameters count - to determine how many objects to return start - to determine where to count from q -for generic freeform search over collections

1.1.7. Methods Singular objects GET to read PUT for update DELETE for delete Collections GET to read whole or part of collection 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 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:// cart/ cartName

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

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

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

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

1.6.6. Delete the whole cart DELETE http:// cart/ cartName

1.6.7. Look at items 20 through 29 in cart GET http:// 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 Storage, Compute Units etc.

3.2.4. Freemium

3.3. Developer Gets Paid

3.3.1. Revenue Share

3.3.2. Affiliate Cost per Click Cost per Action

3.3.3. Referral One Time Fee 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 Sells the idea to internal and external stakeholders Engages with developers Technical + Marketing skills

4.1.2. Product Manager Drives the roadmap Understands how the API is performing Designs the API

4.1.3. Engineers Design the API Write the API

4.1.4. Quality Assurance

4.1.5. Marketing Branding guidelines

4.1.6. Legal Defines usage of corporate and customer data Vets content licensed from third parties

4.2. Objections to APIs

4.2.1. Afraid content may be misused Less risky than content on a web site Can identify and shut down abusive users

4.2.2. Afraid of load on systems Rate Limiting can be used Increased load is good

4.2.3. Afraid of security threats Measures used to protect websites must be used

4.2.4. Afraid of exposing business assets Use rights management

5. Design Principles

5.1. Design for the audience

5.1.1. Direct - Developers Technology Structure - Pragmatic REST Data Format - JSON Security - OAuth

5.1.2. Indirect - End Users 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 Console that provides immediate testing Some APIs do not require signup or authentication

5.3.3. Easy Signup 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" Work hard to avoid breaking the contract of the API

5.6.3. Key questions What happens to older versions What happens to apps delivered on older versions Do new versions support all functionality of old apps How many "one-off" versions for special partners

5.6.4. Mediation to support versioning Transformations of API Protocol Data Versions 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 Simple to hand out Often not encrypted or signed Mostly an audit tool Can be used to filter and block rogue applications DDOS Breaching terms of use

6.2. Authentication

6.2.1. Are they really who they say are ?

6.2.2. HTTP Basic Simple, Universal Relies on SSL for security

6.2.3. OAuth Avoids reliance on passwords OAuth Token - grants access to one application to one API on behalf of one user Password - grants every application access to everything the password can unlock Users can change passwords without breaking the apps Various options Bearer Token Signature Option

6.2.4. Session Based Authentication Login with username / password Returns a session key - used for subsequent calls

6.2.5. Cookie Based Authentication Used if you have control over client implementations Grab cookie at session start to authenticate

6.2.6. Other SAML

6.2.7. Use SSL Encryption always 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 Obfuscating data that client does not have access to Common layer to perform such transformations Allows having a single API that supports all client tpes

6.4. Threat Detection and Prevention

6.4.1. Data Attacks Large inputs Large documents, attachments Header Bombs Replay attacks 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 e.g. Twitter

7.2. Traffic Management

7.2.1. Quotas Limit number of calls made during a certain period of time Hour, Day, Week .. Pick the right granularity to protect the system Assignee User Application Infrastructure Ability to increase quota Ability to reset quota

7.2.2. Throttling APIs are not rejected but slowed down Implemented by an API gateway Store the API calls

7.2.3. Spike Arresting Shutdown hyperactive clients Prevent DDOS, inefficient clients etc.

7.3. API Documentation

7.3.1. Intuitive API

7.3.2. Type of Docs Reference Documentation Every - API, Parameter,Return Value Quick Start Guide Good examples API Console Troubleshooting API Status Diagnosing error codes Operations Runbook For internal consumption 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