Introduction to API
Application Programming Interface
Application Programming Interface(API)
‱ Application Programming Interface
‱ serves as a set of rules and protocols that allows different software applications to
communicate and exchange data.
‱ It acts as an intermediary, enabling one application to request services or data from
another without needing to understand the internal workings of that application.
‱ enables integration between systems, facilitating data exchange, and promoting
modular development.
‱ It defines how software components should interact, specifying the types of
requests that can be made, how to make them, the data formats that should be used,
and the conventions to follow.
Key Concepts of APIs
‱ Communication Bridge: APIs act as a bridge, enabling applications to exchange data and functionality
without needing to understand each other's internal workings.
‱ Requests and Responses:APIs operate on a request-response model. A client application sends a request
to an API, and the API processes the request and sends back a response, often containing data or a status.
‱ Endpoints:An endpoint is a specific URL or URI (Uniform Resource Identifier) through which an API is
accessed, representing a unique function or resource.
‱ Methods:API requests typically use HTTP methods like GET (retrieve data), POST (submit data), PUT
(update data), DELETE (remove data), and PATCH (partially update data)
Common HTTP methods
‱ HTTP methods define the kind of operation a client wants to perform on a
server's resources:
‱ GET: Retrieves data from a server. It does not alter any data
‱ POST: Sends new data to a server to create a new resource
‱ PUT: Sends data to update an existing resource on the server
‱ DELETE: Removes a specified resource from the server
Key Concepts of APIs
‱ Data Formats: APIs commonly use data formats like JSON (JavaScript Object
Notation) or XML (Extensible Markup Language) for exchanging information. JSON is
widely preferred due to its lightweight nature and ease of parsing.
‱ Authentication and Authorization: APIs often incorporate security measures like API
keys, OAuth, or other authentication methods to control access and ensure data security.
‱ Documentation:Comprehensive API documentation is crucial for developers to
understand how to use the API, including available endpoints, methods, parameters, and
expected responses.
Types of APIs( Based on scope/audience)
‱ Open APIs (Public APIs):Public APIs are open source and disseminated for general use.
This is why they are also referred to as open APIs. Available for public use, often with
registration or API keys. This type of API is a key component of smartphone applications.
It is also used to integrate popular services with websites easilyExample: Google Maps
API, allowing developers to integrate mapping functionalities into their applications
‱ Internal APIs (Private APIs):Unlike open APIs that are accessible by the public at large,
private APIs exist within a software vendor’s system framework. They are also known as
closed or internal APIs and are often proprietary. These interfaces aim to bolster
communication and boost productivity. Used within an organization for internal system
integration. Example: An API connecting a company's CRM system with its inventory
management system
Types of APIs( Based on scope/audience)
‱ Partner APIs: As the name suggests, partner APIs allow two different companies to
enter into an exclusive data-sharing agreement. Using this type of application programming
interface, vendors gain access to the data streams of partner companies. In return, the
company granting access to its data receives added services or system features.Shared with
specific business partners for data exchange and collaboration. Example: An e-commerce
platform's API shared with its shipping partners to streamline order fulfillment
‱ Composite APIs: Composite interfaces compile multiple calls sequentially and create a
single API request. This request is transmitted to the server, which, in turn, sends back one
response. Combine multiple API calls into a single request, simplifying complex
interactions. Example: A single API call that retrieves customer details, recent orders, and
shipping status by combining multiple internal APIs
Types of API ( Based on Architecture/Protocol)
‱ 1:REST (Representational State Transfer) APIs:
‱ These are the most common type of web API, using standard HTTP methods (GET,
POST, PUT, DELETE) for communication and typically returning data in JSON or
XML format.Example: The Twitter API, allowing developers to retrieve tweets, post
updates, and manage user data.
‱ 2: SOAP (Simple Object Access Protocol) APIs:
‱ A more structured and rigid protocol, often used in enterprise environments requiring
strict security and transaction management. They rely on XML for message
formatting.Example: APIs for financial transactions or legacy systems where data
integrity and security are paramount.
How APIs work
‱ The interaction between applications through an API follows a standard request-and-response cycle:
‱ Step 1- Request: An API call (also known as a request) is placed by a client application. This call
consists of headers, a request verb, and occasionally a request body. A client sends a request to a
specific URL, known as an endpoint, to perform an action. This request uses standard HTTP
methods to specify the type of action.
‱ Step 2- Server processing: The API’s uniform resource identifier (URI) is used to process this
request for data retrieval from an application to the web server. The server receives the request,
processes the necessary information, and gathers the data.
‱ Step 3- Response: The server sends a response back to the client via API. This typically includes the
requested data in a standard format like JSON (JavaScript Object Notation) or XML.
‱ Step 4- Delivery: The API returns the server's response to the client.
Benefits of Using APIs
‱ Increased Efficiency and Automation: APIs enable automated data exchange and
process execution between different systems, reducing manual effort and improving
operational efficiency.
‱ Faster Development and Innovation: Developers can leverage pre-built
functionalities and services exposed through APIs, accelerating development cycles
and fostering innovation by integrating existing solutions rather than building
everything from scratch.
‱ Enhanced Interoperability and Integration: APIs facilitate seamless
communication and data flow between disparate applications, systems, and
platforms, creating a more interconnected ecosystem.
Benefits of Using APIs
‱ Scalability and Flexibility: APIs can be designed to handle varying loads and enable
modular architectures, allowing applications to scale effectively and adapt to changing
requirements.
‱ New Revenue Streams and Business Models: APIs can enable the creation of new
services, products, and partnerships, opening up opportunities for monetization and
market expansion.
‱ Improved User Experience: By integrating various services and data sources, APIs
can create more comprehensive and user-friendly applications.
Challenges of Using APIs
‱ Security Concerns: APIs, especially public ones, can be vulnerable to
security threats if not properly secured with authentication, authorization,
and data encryption measures.
‱ Complexity and Management: Managing a large number of APIs,
including versioning, documentation, and lifecycle management, can
become complex.
‱ Dependency on Third-Party APIs: Relying on external APIs introduces a
dependency on the provider's stability, availability, and potential changes
to the API.
Challenges of Using APIs
‱ Compatibility Issues: Ensuring compatibility between different API versions and
across various platforms can be a challenge.
‱ Data Protection and Privacy: Handling sensitive data through APIs requires strict
adherence to data protection regulations and privacy policies.
‱ Performance and Latency: Poorly designed or managed APIs can lead to
performance bottlenecks and increased latency, impacting user experience.
‱ Maintenance and Support: Ongoing maintenance, updates, and support for
integrated APIs are necessary to ensure continued functionality and address issues

Introduction to API and Fin.Modelli.pptx

  • 1.
    Introduction to API ApplicationProgramming Interface
  • 2.
    Application Programming Interface(API) ‱Application Programming Interface ‱ serves as a set of rules and protocols that allows different software applications to communicate and exchange data. ‱ It acts as an intermediary, enabling one application to request services or data from another without needing to understand the internal workings of that application. ‱ enables integration between systems, facilitating data exchange, and promoting modular development. ‱ It defines how software components should interact, specifying the types of requests that can be made, how to make them, the data formats that should be used, and the conventions to follow.
  • 3.
    Key Concepts ofAPIs ‱ Communication Bridge: APIs act as a bridge, enabling applications to exchange data and functionality without needing to understand each other's internal workings. ‱ Requests and Responses:APIs operate on a request-response model. A client application sends a request to an API, and the API processes the request and sends back a response, often containing data or a status. ‱ Endpoints:An endpoint is a specific URL or URI (Uniform Resource Identifier) through which an API is accessed, representing a unique function or resource. ‱ Methods:API requests typically use HTTP methods like GET (retrieve data), POST (submit data), PUT (update data), DELETE (remove data), and PATCH (partially update data)
  • 4.
    Common HTTP methods ‱HTTP methods define the kind of operation a client wants to perform on a server's resources: ‱ GET: Retrieves data from a server. It does not alter any data ‱ POST: Sends new data to a server to create a new resource ‱ PUT: Sends data to update an existing resource on the server ‱ DELETE: Removes a specified resource from the server
  • 5.
    Key Concepts ofAPIs ‱ Data Formats: APIs commonly use data formats like JSON (JavaScript Object Notation) or XML (Extensible Markup Language) for exchanging information. JSON is widely preferred due to its lightweight nature and ease of parsing. ‱ Authentication and Authorization: APIs often incorporate security measures like API keys, OAuth, or other authentication methods to control access and ensure data security. ‱ Documentation:Comprehensive API documentation is crucial for developers to understand how to use the API, including available endpoints, methods, parameters, and expected responses.
  • 6.
    Types of APIs(Based on scope/audience) ‱ Open APIs (Public APIs):Public APIs are open source and disseminated for general use. This is why they are also referred to as open APIs. Available for public use, often with registration or API keys. This type of API is a key component of smartphone applications. It is also used to integrate popular services with websites easilyExample: Google Maps API, allowing developers to integrate mapping functionalities into their applications ‱ Internal APIs (Private APIs):Unlike open APIs that are accessible by the public at large, private APIs exist within a software vendor’s system framework. They are also known as closed or internal APIs and are often proprietary. These interfaces aim to bolster communication and boost productivity. Used within an organization for internal system integration. Example: An API connecting a company's CRM system with its inventory management system
  • 7.
    Types of APIs(Based on scope/audience) ‱ Partner APIs: As the name suggests, partner APIs allow two different companies to enter into an exclusive data-sharing agreement. Using this type of application programming interface, vendors gain access to the data streams of partner companies. In return, the company granting access to its data receives added services or system features.Shared with specific business partners for data exchange and collaboration. Example: An e-commerce platform's API shared with its shipping partners to streamline order fulfillment ‱ Composite APIs: Composite interfaces compile multiple calls sequentially and create a single API request. This request is transmitted to the server, which, in turn, sends back one response. Combine multiple API calls into a single request, simplifying complex interactions. Example: A single API call that retrieves customer details, recent orders, and shipping status by combining multiple internal APIs
  • 8.
    Types of API( Based on Architecture/Protocol) ‱ 1:REST (Representational State Transfer) APIs: ‱ These are the most common type of web API, using standard HTTP methods (GET, POST, PUT, DELETE) for communication and typically returning data in JSON or XML format.Example: The Twitter API, allowing developers to retrieve tweets, post updates, and manage user data. ‱ 2: SOAP (Simple Object Access Protocol) APIs: ‱ A more structured and rigid protocol, often used in enterprise environments requiring strict security and transaction management. They rely on XML for message formatting.Example: APIs for financial transactions or legacy systems where data integrity and security are paramount.
  • 9.
    How APIs work ‱The interaction between applications through an API follows a standard request-and-response cycle: ‱ Step 1- Request: An API call (also known as a request) is placed by a client application. This call consists of headers, a request verb, and occasionally a request body. A client sends a request to a specific URL, known as an endpoint, to perform an action. This request uses standard HTTP methods to specify the type of action. ‱ Step 2- Server processing: The API’s uniform resource identifier (URI) is used to process this request for data retrieval from an application to the web server. The server receives the request, processes the necessary information, and gathers the data. ‱ Step 3- Response: The server sends a response back to the client via API. This typically includes the requested data in a standard format like JSON (JavaScript Object Notation) or XML. ‱ Step 4- Delivery: The API returns the server's response to the client.
  • 11.
    Benefits of UsingAPIs ‱ Increased Efficiency and Automation: APIs enable automated data exchange and process execution between different systems, reducing manual effort and improving operational efficiency. ‱ Faster Development and Innovation: Developers can leverage pre-built functionalities and services exposed through APIs, accelerating development cycles and fostering innovation by integrating existing solutions rather than building everything from scratch. ‱ Enhanced Interoperability and Integration: APIs facilitate seamless communication and data flow between disparate applications, systems, and platforms, creating a more interconnected ecosystem.
  • 12.
    Benefits of UsingAPIs ‱ Scalability and Flexibility: APIs can be designed to handle varying loads and enable modular architectures, allowing applications to scale effectively and adapt to changing requirements. ‱ New Revenue Streams and Business Models: APIs can enable the creation of new services, products, and partnerships, opening up opportunities for monetization and market expansion. ‱ Improved User Experience: By integrating various services and data sources, APIs can create more comprehensive and user-friendly applications.
  • 13.
    Challenges of UsingAPIs ‱ Security Concerns: APIs, especially public ones, can be vulnerable to security threats if not properly secured with authentication, authorization, and data encryption measures. ‱ Complexity and Management: Managing a large number of APIs, including versioning, documentation, and lifecycle management, can become complex. ‱ Dependency on Third-Party APIs: Relying on external APIs introduces a dependency on the provider's stability, availability, and potential changes to the API.
  • 14.
    Challenges of UsingAPIs ‱ Compatibility Issues: Ensuring compatibility between different API versions and across various platforms can be a challenge. ‱ Data Protection and Privacy: Handling sensitive data through APIs requires strict adherence to data protection regulations and privacy policies. ‱ Performance and Latency: Poorly designed or managed APIs can lead to performance bottlenecks and increased latency, impacting user experience. ‱ Maintenance and Support: Ongoing maintenance, updates, and support for integrated APIs are necessary to ensure continued functionality and address issues