Qualification:
Cambridge Advanced Nationals in Computing (AAQ)
Certificate:
Computing: Application Development (H029 / H129)
Unit:
F161: Developing Application Software
Watch on YouTube:
API roles
API architecture
3.1 - Application Programming Interface (API)
You must know the role and uses of Application Programming Interfaces (APIs) as well as the uses, advantages and disadvantages of each API type (composite, internal, private, public, partner).
You must also understand the uses, advantages and disadvantages of API architecture (REST, SOAP, RPC).
What You Need to Know

Roles of an API

An Application Programming Interface (API) allows different applications or systems to communicate and exchange data using a defined set of rules.
Roles of an API include:
-
Setting communication rules by defining the methods that allow an application to communicate correctly with a server.
-
Transferring data by allowing an application to request data from a server and receive the requested information in response.
-
Increasing security by providing a controlled way of accessing a server's data or services, rather than giving an application direct access to the server and its data.
​
As an example, a weather app could use an API to request today's weather data from a weather service's server, which then returns the requested information for the app to display.
Types of API
Composite API
A composite API combines multiple API requests into a single request, allowing several pieces of data or tasks to be handled together. It is used when an application needs data from several sources or needs several related actions completed at once. Such as an online shop retrieving customer, order and delivery information simultaneously.
​
A composite API can reduce the number of separate requests, making complex operations simpler and potentially improving performance. But it can be more complex to develop and maintain, and a problem with one part of the combined request could affect the overall response.

Internal API

An internal API is designed for use within an organisation, allowing its own applications and systems to communicate. It is used when different systems inside the same organisation need to exchange data, such as a school's student-record system sharing data with its attendance system.
​
An internal API can improve communication and data sharing between internal systems while allowing the organisation to control how the API works. However, it usually cannot be accessed by external organisations, and the organisation is responsible for developing, securing and maintaining it.
Private API
A private API is where access is restricted to authorised developers or users, usually through authentication such as credentials. It is used during private development and testing, or when developers need controlled access to confidential back-end data and services.
​
A private API provides greater control and security, helping protect confidential data and intellectual property while allowing authorised developers (including remote developers) to access what they need. But restricted access limits outside involvement and integration, and the organisation is responsible for developing, testing, securing and maintaining the API.
Public API
A public API is made available to external developers or the general public to access certain data or services. It is used when an organisation wants other applications to use its data or services, such as allowing developers to retrieve weather, mapping or transport information.
​
Public APIs encourage third-party development and integration, potentially increasing the number of applications making use of a service. However, it creates greater security and management requirements, and heavy usage may place additional demand on servers, so access may need to be limited.


Partner API

A partner API is shared with selected external organisations or business partners, rather than being available to everyone. It is used when two organisations need their systems to securely share data or services, such as an online retailer communicating with a delivery company's system.
​
A partner API allows organisations to use specialist services provided by trusted partners rather than developing everything themselves, potentially reducing development time and costs. However, it creates dependency on the API provider. Also, downtime, security problems, rate limits or limited customisation could affect the application.
API Architecture
API architecture describes the rules and structure used by an API.
REST (Representational State Transfer)
REST is an API architecture that commonly uses standard web/HTTP methods to request, add, update or delete data, often exchanging data using JSON. it is commonly used for web and mobile applications that need to communicate with servers, such as an app requesting user account information.
​
REST is simple and easy to use, works across different platforms, uses standard web technologies, is stateless so requests can be handled independently and is scalable for applications with many users. But it provides less strict standardisation than SOAP and developers may need to implement additional security, validation and error handling themselves.

SOAP (Simple Object Access Protocol)

SOAP is a strict and standardised protocol for exchanging structured information between applications, usually using XML to format messages. It is often used where security, reliability and strict rules are particularly important, such as financial, payment or large business systems.
​
SOAP has strict standards and built-in support for features such as security and error handling, making communication reliable and consistent. However, it can be more complex to develop and use and its XML messages contain lots of tags, making them larger and potentially slower to process than REST.
RPC (Remote Procedure Call)
RPC is an API architecture that allows an application to request that a function/procedure is carried out on another computer or server, as though it were being carried out locally. It is useful when an application needs to perform specific actions on a remote system, such as requesting a server to calculate a value and return the result.
​
RPC can be simple and efficient for performing specific actions, as the developer can directly request the required procedure. But it can create a strong dependency between the client and server, meaning changes to procedures on the server may require changes to the application. Also, network problems can prevent the procedure from completing.
Questo's Questions
3.1 - Application Programming Interface (API):
​​​​​
1. What is the role of an API, and how can APIs help applications and servers communicate securely? ​[3]
​​​​​
2. Describe composite, internal, private, public and partner APIs, giving an example of when each could be used. ​[3 each]
​​​
3. Give advantages and disadvantages of composite, internal, private, public and partner APIs. ​[4 each]
​​​
4. Describe REST, SOAP and RPC API architectures and explain when each would be suitable. ​[4 each]
​
5. Compare the advantages and disadvantages of REST, SOAP and RPC. [6]
A single application can communicate with multiple APIs. For example, a travel app could use separate services for maps, weather, payments and transport information rather than developing every feature itself.
Did You Know?
