Cloud concept · Updated

APIs - APIs are defined interfaces that let software request data or actions from another system without depending on its internal implementation.

In short

An application programming interface defines available operations, accepted inputs, responses, and error behavior. In the cloud, APIs enable applications and automation tools to provision resources, configure services, and process data, making them the foundation of programmatic access.

Cloud Concepts Hub →

6 key aspects of APIs

APIs provide consistent programmatic contracts, while access tools, authorization, deployment workflows, and failure handling determine how safely and effectively engineers use them.

01
Defined operation contracts

An API specifies supported actions, inputs, outputs, and errors. Use the documented contract rather than assuming that similarly named operations behave identically across services.

02
Multiple access methods

A console supports interactive work, a CLI supports commands and scripts, and an SDK integrates service calls into application code. Direct API calls offer lower-level control but require more implementation effort.

03
Infrastructure automation

IaC tools invoke APIs to create and update infrastructure from reusable definitions. They add deployment and lifecycle workflows beyond simply issuing individual API requests.

04
Identity and authorization

API access is governed by the caller's identity and applicable permissions, not simply by the tool used. Prefer temporary credentials and grant only the operations and resource access required.

05
Resilient request handling

Clients must handle throttling, transient failures, paginated results, and operations that complete asynchronously. Retry only when appropriate, and use supported idempotency controls to reduce duplicate side effects.

06
Management and data operations

APIs can manage infrastructure or operate on application data. Evaluate permissions, quotas, logging, and pricing for the specific operations rather than treating all calls to a service alike.

Cloud services for APIs

CloudFormation uses service APIs to provision resources such as S3 buckets, while IAM governs the deployment identity's permissions. Applications can then use SDKs to access S3 objects, and engineers can inspect or troubleshoot resources through the console or CLI. CloudTrail provides records of supported API activity, with additional configuration needed for relevant data events. For a team's own application interface, API Gateway can route client requests to backend integrations. Together, these services illustrate API provisioning, access control, application integration, and auditing without making any single access tool mandatory.

Amazon API GatewayAmazon API Gateway

Amazon API Gateway lets teams expose application functionality through managed REST, HTTP, and WebSocket APIs. It provides capabilities such as request routing, authorization integration, and throttling; it is not required to call other AWS services' existing APIs.

AWS CloudFormationAWS CloudFormation

AWS CloudFormation provisions and updates supported infrastructure from templates, invoking underlying service APIs. It illustrates how IaC adds resource dependencies and stack lifecycle management around API-driven deployment.

AWS CloudTrailAWS CloudTrail

CloudTrail records supported AWS API activity to help establish who performed an operation and when. Management events and data events have different logging coverage and configuration requirements, so do not assume every data request is recorded by default.

Amazon S3Amazon S3

Amazon S3 exposes APIs for bucket management and object operations such as uploading and retrieving files. Engineers can perform these operations through the console, CLI, SDKs, or direct requests, subject to applicable permissions.

APIs exam questions

Real practice exam questions on APIs, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIF-C01

A research organization uses an approved image-classification model to analyze collections of wildlife photographs after field expeditions. When a collection is ready, an application submits a managed inference job to Amazon SageMaker AI. The submission API quickly returns a job identifier, and the job writes prediction files to Amazon S3 as processing progresses. Researchers can wait several hours, but their reporting application must not publish results from an incomplete collection. How should the application determine when to publish the predictions?

Show answerCORRECT ANSWER

Track the job until it reaches a successful completion state, then read its prediction files from Amazon S3 and publish the results.

This workload processes a collected dataset for later use, which fits batch inference. Waiting for successful job completion before consuming its output prevents the reporting application from publishing an incomplete collection.

DEA-C01

A company exposes a report-refresh operation through an HTTPS API backed by AWS Lambda. The function uses the Amazon Redshift Data API to refresh a reporting table by running two SQL statements: a DELETE that removes the previous reporting period and an INSERT ... SELECT that writes newly transformed results.

The DELETE must run before the INSERT. If either statement fails, neither statement's changes can remain committed. The company wants to avoid implementing explicit transaction and session management in the Lambda function.

Which implementation meets these requirements?

Show answerCORRECT ANSWER

Call BatchExecuteStatement with the DELETE and INSERT as separate entries in the Sqls array, in that order. Check the returned statement's status to determine whether the refresh succeeded.

BatchExecuteStatement runs the SQL statements serially in the specified order as a single transaction. If any statement fails, the batch is rolled back, providing the required atomic refresh without explicit transaction or session management.

AIP-C01

A company exposes an asynchronous report-generation API through Amazon API Gateway. POST /reports creates a durable job and returns HTTP 202 with a job URL. A worker invokes Amazon Bedrock and stores the generated report. The existing worker guarantees at most one model invocation for each created job, and automatic model-invocation retries are disabled.

Mobile clients sometimes lose the POST response and resubmit the request. Concurrent submissions currently create separate jobs and incur duplicate inference charges. Clients can supply a stable request key for retries. For 24 hours, submissions from the same authenticated tenant with the same key and equivalent generation parameters must return the same job URL. Reusing that key with different generation parameters must return a conflict. Different tenants must be able to use identical keys independently.

Which API implementation meets these requirements?

Show answerCORRECT ANSWER

Atomically create a durable job record keyed by the trusted tenant ID and client request key. Store a fingerprint of the canonical generation parameters with the job. If the record already exists, compare fingerprints and return either its job URL or HTTP 409. Have the existing worker discover newly created job records for processing, and retain the records for at least 24 hours.

Atomic creation ensures that concurrent submissions create only one job. Tenant-scoped keys prevent collisions between tenants, and canonical parameter fingerprints distinguish equivalent retries from conflicting requests. Reusing the stored job URL handles lost responses without another inference invocation. Durable job discovery avoids a gap between recording the request and scheduling its processing.

Practice APIs in a full exam

Questions on APIs in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is APIs

3 min read

An application programming interface, or API, is a contract through which one software component interacts with another. It describes operations a caller can request, the parameters those operations accept, and the responses or errors they return. Cloud APIs commonly expose network endpoints accessed over HTTPS. The caller does not need to understand the provider's internal implementation, but it must follow the interface's authentication, authorization, and request-format requirements.

Cloud APIs support both infrastructure management and application workloads. A management operation might create a virtual machine, change a firewall rule, or describe a database. A data operation might upload an object, retrieve a record, or publish a message. These are often called control-plane and data-plane operations. Their permissions, availability characteristics, request limits, and charges can differ, even within the same service.

Engineers can access cloud capabilities through several interfaces. The AWS Management Console provides a browser-based graphical interface suited to learning, exploration, and occasional administrative tasks. The AWS Command Line Interface, or AWS CLI, exposes operations as terminal commands and is useful for scripts and repeatable operational tasks. AWS SDKs provide language-specific libraries for applications, handling much of the work of constructing requests, signing them, and processing responses. Direct API requests are also possible, but require more responsibility for protocol details and error handling.

These access methods are related rather than separate implementations of cloud functionality: console actions, CLI commands, and SDK methods ultimately interact with service interfaces. A graphical interface does not inherently grant more permissions than a script. The identity making a request and the applicable authorization policies determine what is allowed. Not every service feature necessarily appears in every interface at the same time.

Infrastructure as code, or IaC, adds a different operational model. Instead of issuing isolated commands, engineers describe infrastructure in version-controlled definitions and use a deployment tool to apply changes through service APIs. AWS CloudFormation is one example. Choose IaC for repeatable environments and reviewed infrastructure changes, a CLI for targeted operational automation, and an SDK when application code needs cloud functionality. A shell script containing create commands is automation, but does not automatically provide dependency management, change planning, or infrastructure lifecycle tracking.

For example, an engineer might inspect a storage bucket in the console, use the CLI to copy a test file, and use an SDK to upload files from an application. The bucket and its access policies could be provisioned through IaC. Each method serves a different workflow while operating on the same underlying resources. Automation should use appropriately scoped identities and preferably temporary credentials, rather than embedding long-lived secrets in source code. Many AWS API requests use Signature Version 4 signing; an API key is not a universal substitute for AWS identity credentials.

API-based automation must account for network failures, throttling, pagination, and asynchronous operations. A successful response might mean that a resource creation request was accepted, not that the resource is ready. Use bounded retries with exponential backoff and jitter for retryable failures, and use idempotency mechanisms where supported to avoid duplicate actions. APIs are not necessarily REST interfaces, do not always return JSON, and are not automatically public or unauthenticated. Secure access, observable operations, and careful failure handling remain necessary regardless of the chosen access method.

Learn APIs in lessons

9 short lessons on APIs in 6 certification courses.

and 3 more lessons

Open the lessons