Jump to content

User:DKinzler (WMF)/API Guidelines

From mediawiki.org

Resources

[edit]

REST best practice

Existing Wikimedia Resources


Other Org's API Guidelines

For Clients

Bits & Pieces

[edit]

Note to self: looked at: Adidas, Maturity, Atlassian, Whitehouse, Google, Microsoft, Heroku, Zalando, Atlassian, Stripe.

Typical Structure & Aspects


Clients

  • How to discover APIs
  • Where to find documentation and specs
    • common data types
    • error formats
    • paging
  • Relevant HTTP standards
    • resilience
    • handling 5xx
  • Retry and back-off
  • Relevant REST best practices
  • What is stable / unstable
    • use the latest version
    • don't rely on undocumented behavior
    • Do not start using deprecated APIs
    • don't use restricted APIs
  • Follow the ToS
  • Surface Deprecation and Sunsetting
    • Follow 308
  • Be nice
    • Consider the cost
    • Follow 429 / Retry-After
    • Be careful with concurrency
    • React to blocks (403?)
  • Set User-Agent
  • When and how to use auth
    • use OAuth when acting on behalf of others
    • csrf

Guidance needed

[edit]
  • REST vs Action, rpc endpoints in the REST framework
  • component names and versions
  • entity names, singlular vs plural, trailign slashes
  • common wrappers for listings
  • shared vocab of properties
  • shared object schemas
  • helper objects