Last Updated on August 2, 2021 by Admin 2
An application receives the following output after querying an API by using an HTTPS GET method:
{
“id”: 12345.
“fname”: “John”,
“lname”: “Doe”,
“group”: “Accounting” {
“role”: “Receivables”
}
}
Which of the following is the architecture upon which the API is most likely constructed?
- the Java API
- GraphQL
- a REST API
- a SOAP API
Most likely, representational state transfer (REST) is the architecture upon which the Application Programming Interface (API) in this scenario is most likely constructed. Open APIs, such as REST APIs, can be used to enable services such as billing automation and centralized management of cloud infrastructure.
REST is an API architecture that uses Hypertext Transfer Protocol (HTTP) or HTTP Secure (HTTPS) to enable external resources to access and make use of programmatic methods that are exposed by the API. For example, a web application that retrieves user product reviews from an online marketplace for display on third-party websites might obtain those reviews by using methods provided in an API that is developed and maintained by that marketplace. REST APIs can return data in Extensible Markup Language (XML) format or in JavaScript Object Notation (JSON) format. The output in this scenario is in JSON format.
It is not likely that the API in this scenario was constructed in Simple Object Access Protocol (SOAP) API. SOAP is an older API messaging protocol that uses HTTP and XML to enable communication between devices. SOAP APIs are typically more resource-intensive than REST APIs and, therefore, slower. Unlike REST APIs, SOAP APIs do not return JSON-formatted output.
It is not likely that the API in this scenario was constructed in Graph Query Language (GraphQL). GraphQL is an API query language and a runtime that is intended to lower the burden of making multiple API calls to obtain a single set of data. For example, data that requires three or four HTTP GET requests when constructed from a standard REST API might take only one request when using GraphQL. Similar to REST API, GraphQL output is in JSON format. Although GraphQL can use HTTP or HTTPS, it is not limited to those protocols.
It is not likely that the API in this scenario was constructed by using the Java API. Unlike SOAP, REST, and GraphQL, the Java API is typically accessed by Java applications that are running in the Java virtual machine (VM), which is the Java component that executes compiled Java programs. The Java API is a collection of Java classes that developers can use for data collection or to build interfaces.