SlideShare ist ein Scribd-Unternehmen logo
1 von 11
API BestPractices
System API
System API are granular, self contained APIs build around standard function/operation
of system/application, database table/ procedures/views, CRUD operations,
represents single unit of work (UOW) with simple one-one datamapping. Any error
thrown from the API are send to the caller., error messages can be
technical. Transition errors like network connectivity can be retried for 3
times. System APIs are consumed by Process, Experience APIs, other Systems ,
Applications.
Process API
Process API are APIs that involves orchestration of one or more System APIs, complex
data transformation, integration of one or more systems etc. Process API represent
combination of multiple functions, operations. Error/Exception thrown from process
API should be self healing, meaningful error messages thrown to caller. Process APIs
can be consumed by Systems, Users, Applications. Process APIs are System API if its
reusable across enterprise
Experience API
Experience API are APIs that are build specific to
application/systems/end users , can have orchestration of one or more
System APIs, Processs APIs, has complex data
transformation, integration of one or more systems
etc. Error/Exception thrown from experience API should be self
healing, meaningful business error messages thrown to caller. System
APIs can be experience APIs as well.
Best practices to start New API development
• Design API
• Driven Development
• Naming convention for Resources
• CRUD and HTTP verb
• HTTP Status codes
• Common HTTP Error codes
Design API
The first and most basic step, is understanding what it is that you’re
actually building. Understand what your customers want (this means
involving them), understand what different types of APIs there are out
there, and why you are building the kind you are (REST, REST-like, SOAP,
RPC). Lastly, it’s important to map out the functionality that your users
need – and to not get stuck in a resources/CRUD mindset when doing
so.
Driven Development
Using a spec like RAML to model your API, lets you get an immediate
visual representation of what it is that you’re actually building while
taking advantage of code reuse and design patterns for consistency.
Keep your users involved and prototype (mock) your API for them to test
out using tools like the API Notebook. Keep making revisions to your
design until you have a solid foundation and have fixed 99% of the
design flaws. Then start building!
Naming for Resources
Keep your resources versatile and flexible. By using nouns you can stay
true to REST principles and avoid tightly coupling your resources to
methods or actions. Remember that you generally want your resources
in the plural form (users) and they should map to the objects or areas
that your clients are trying to manipulate (ie: /users to modify users).
CRUD and HTTP Verb
By thinking of actions in a Create, Read, Update, and Delete format you
can take advantage of the HTTP Action Verbs or methods and make it
easier for developers to utilize your API. Be sure to understand the
difference between POST, PUT, and PATCH – and when to use which.
HTTP Status codes
Tell your clients what’s happening, when things are successful (200, 201)
or when they’re not (304, 400, 500).
Common HTTP Error codes
Tell your clients what’s happening, or when they’re not (304,
400,404,405,401 500).

Weitere ähnliche Inhalte

Was ist angesagt? (9)

Anypoint platform for API's glossary
Anypoint platform for API's glossaryAnypoint platform for API's glossary
Anypoint platform for API's glossary
 
Oracleapex 150914085107-lva1-app6892
Oracleapex 150914085107-lva1-app6892Oracleapex 150914085107-lva1-app6892
Oracleapex 150914085107-lva1-app6892
 
RESUME
RESUMERESUME
RESUME
 
Muleesb
MuleesbMuleesb
Muleesb
 
Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)
 
Web Programming - 2 Web Framework
Web Programming - 2 Web FrameworkWeb Programming - 2 Web Framework
Web Programming - 2 Web Framework
 
The anypoint platform for API's
The anypoint platform for API'sThe anypoint platform for API's
The anypoint platform for API's
 
Api areas
Api areasApi areas
Api areas
 
Link of microsoft
Link of microsoftLink of microsoft
Link of microsoft
 

Ähnlich wie Api best practices

Applicaton Development using RESTful APIs
Applicaton Development using RESTful APIsApplicaton Development using RESTful APIs
Applicaton Development using RESTful APIs
Sourav Maji
 

Ähnlich wie Api best practices (20)

Microservices&ap imanagement
Microservices&ap imanagementMicroservices&ap imanagement
Microservices&ap imanagement
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
 
xcfgdfbn
xcfgdfbnxcfgdfbn
xcfgdfbn
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best Practices
 
Sap – A Birds Eye View Mahbub
Sap – A Birds Eye View MahbubSap – A Birds Eye View Mahbub
Sap – A Birds Eye View Mahbub
 
Api design part 1
Api design part 1Api design part 1
Api design part 1
 
Open api in enterprise
Open api in enterpriseOpen api in enterprise
Open api in enterprise
 
Practical guide to building public APIs
Practical guide to building public APIsPractical guide to building public APIs
Practical guide to building public APIs
 
Top 11 API testing tools for 2022
Top 11 API testing tools for 2022Top 11 API testing tools for 2022
Top 11 API testing tools for 2022
 
Day03 api
Day03   apiDay03   api
Day03 api
 
Api tools overview
Api tools overviewApi tools overview
Api tools overview
 
RefCard API Architecture Strategy
RefCard API Architecture StrategyRefCard API Architecture Strategy
RefCard API Architecture Strategy
 
SlideShare Test-1
SlideShare Test-1SlideShare Test-1
SlideShare Test-1
 
Creating a mule project with raml and api
Creating a mule project with raml and apiCreating a mule project with raml and api
Creating a mule project with raml and api
 
Applicaton Development using RESTful APIs
Applicaton Development using RESTful APIsApplicaton Development using RESTful APIs
Applicaton Development using RESTful APIs
 
API presentation
API presentationAPI presentation
API presentation
 
Api desgin
Api desginApi desgin
Api desgin
 
Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
 
Project Report on SAP
Project Report on SAPProject Report on SAP
Project Report on SAP
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Api best practices

  • 2. System API System API are granular, self contained APIs build around standard function/operation of system/application, database table/ procedures/views, CRUD operations, represents single unit of work (UOW) with simple one-one datamapping. Any error thrown from the API are send to the caller., error messages can be technical. Transition errors like network connectivity can be retried for 3 times. System APIs are consumed by Process, Experience APIs, other Systems , Applications.
  • 3. Process API Process API are APIs that involves orchestration of one or more System APIs, complex data transformation, integration of one or more systems etc. Process API represent combination of multiple functions, operations. Error/Exception thrown from process API should be self healing, meaningful error messages thrown to caller. Process APIs can be consumed by Systems, Users, Applications. Process APIs are System API if its reusable across enterprise
  • 4. Experience API Experience API are APIs that are build specific to application/systems/end users , can have orchestration of one or more System APIs, Processs APIs, has complex data transformation, integration of one or more systems etc. Error/Exception thrown from experience API should be self healing, meaningful business error messages thrown to caller. System APIs can be experience APIs as well.
  • 5. Best practices to start New API development • Design API • Driven Development • Naming convention for Resources • CRUD and HTTP verb • HTTP Status codes • Common HTTP Error codes
  • 6. Design API The first and most basic step, is understanding what it is that you’re actually building. Understand what your customers want (this means involving them), understand what different types of APIs there are out there, and why you are building the kind you are (REST, REST-like, SOAP, RPC). Lastly, it’s important to map out the functionality that your users need – and to not get stuck in a resources/CRUD mindset when doing so.
  • 7. Driven Development Using a spec like RAML to model your API, lets you get an immediate visual representation of what it is that you’re actually building while taking advantage of code reuse and design patterns for consistency. Keep your users involved and prototype (mock) your API for them to test out using tools like the API Notebook. Keep making revisions to your design until you have a solid foundation and have fixed 99% of the design flaws. Then start building!
  • 8. Naming for Resources Keep your resources versatile and flexible. By using nouns you can stay true to REST principles and avoid tightly coupling your resources to methods or actions. Remember that you generally want your resources in the plural form (users) and they should map to the objects or areas that your clients are trying to manipulate (ie: /users to modify users).
  • 9. CRUD and HTTP Verb By thinking of actions in a Create, Read, Update, and Delete format you can take advantage of the HTTP Action Verbs or methods and make it easier for developers to utilize your API. Be sure to understand the difference between POST, PUT, and PATCH – and when to use which.
  • 10. HTTP Status codes Tell your clients what’s happening, when things are successful (200, 201) or when they’re not (304, 400, 500).
  • 11. Common HTTP Error codes Tell your clients what’s happening, or when they’re not (304, 400,404,405,401 500).