Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.
/ api-standards Public archive
forked from jharmn/api-standards

The API standards and guidelines forked from Paypal

Notifications You must be signed in to change notification settings

freight-hub/api-standards

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

api-standards

This is Freighthub API guidelines, forked from PayPal

You can find the actual guidelines here

You can find examples and patterns here

You can find the list of references here

You can find the JSON schema spec here

TL;DR

Paths: kebab case and plurals ✅ purchase-orders 🚫purchaseOrder, purchaseOrders, purchase_orders

Query Params: camelCase ✅ customerID 🚫customer-id, customer_id, customerId

Path Params: camelCase ✅ customerID 🚫customer-id, customerId

Headers: Pascal-Case, no X- for custom headers ✅ API-Key 🚫api-key, apiKey, X-API-Key

Responses: must be an object with camelCase properties ✅ customerID, id 🚫customer-id,customerId, _id

Pagination: must take page and pageSize parameters and response must contains a property items and should contain totalItems for the respones (also accepted is totalPages)

Sorting: should take a sort parameter following the pattern {field_name}|{asc|desc} where {field_name} is a property of the resource ✅ createdAt|asc,activatedAt|desc

Enums: must be camcelCase ✅ green, blue, blueGreen 🚫 BLUE, blue_green

Acronyms: must be all lower or all upper case ✅ HTTP, API, HTTPHeader, { "httpHeader": "" }, { "id": 1 } 🚫 Http, Api

About

The API standards and guidelines forked from Paypal

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published