Application Program Interface (API) and Libraries - AP Computer Science A
- What is the function of a 'callback' in APIs?
- A function passed as an argument to be executed later. Callbacks enable asynchronous programming and event handling.
- What is a 'webhook' in API terminology?
- An HTTP callback triggered by an event. Webhooks enable real-time notifications and automated responses.
- What is 'OAuth' in the context of APIs?
- An open standard for access delegation. OAuth provides secure authorization without sharing passwords.
- What is an API endpoint response?
- Data returned from an API upon request. Response contains the requested data or operation result.
- Identify the role of an API client.
- Requests services from an API. Clients consume API services and handle responses.
- Find and correct the error: 'https:/api.example.com/data'.
- Correct: 'https://api.example.com/data'. Missing second slash after 'https:' in the URL protocol.
- Identify a key benefit of using libraries in software development.
- Reduces code duplication and development time. Libraries provide reusable code, saving developers time and effort.
- Which HTTP method is typically used to retrieve data in an API?
- GET. GET requests fetch data without modifying server state.
- What is the primary benefit of microservices architecture with APIs?
- Scalability and independent deployment of services. Microservices enable modular, scalable application architecture.
- What is a common use of private APIs?
- Internal company use to integrate systems. Private APIs connect internal systems within organizations.
- Which API architecture style uses XML and SOAP?
- SOAP (Simple Object Access Protocol). SOAP uses XML messaging for structured web service communication.
- What is an endpoint in an API?
- A specific URL where API requests are addressed. Endpoints define specific access points for API functionality.
- Which HTTP method is used to submit data to be processed by an API?
- POST. POST sends data to create or process resources on the server.
- Identify a primary feature of RESTful APIs.
- Stateless communication. Each request contains all necessary information independently.
- Identify an advantage of using APIs in web development.
- Facilitates integration with third-party services. APIs enable seamless connection to external services and data.
- Define a library in the context of programming.
- A collection of precompiled routines a program can use. Pre-written code modules that developers can reuse in their programs.
- What is an API gateway?
- A server that acts as an entry point for APIs. Gateways manage API traffic, security, and routing centrally.
- What does CORS stand for in web APIs?
- Cross-Origin Resource Sharing. CORS allows web pages to access resources from different domains.
- Identify the HTTP status code for a successful API request.
- 200 OK. Standard HTTP response indicating successful request completion.
- What is the difference between PUT and PATCH methods?
- PUT replaces a resource; PATCH updates part of a resource. PUT replaces entirely while PATCH modifies specific fields only.
- What does CRUD stand for in API operations?
- Create, Read, Update, Delete. CRUD represents the four basic database operations.
- Identify one standard format for API data exchange.
- JSON (JavaScript Object Notation). JSON is lightweight and widely used for API data transmission.
- Identify one use of a public API.
- Enabling third-party developers to build on a platform. Public APIs enable external developers to create integrated applications.
- What is the primary purpose of an API?
- To allow different software applications to communicate. APIs enable software components to exchange data and functionality.
- What is a common protocol used with web APIs?
- HTTP/HTTPS. HTTPS ensures secure, encrypted communication for web APIs.
- What is meant by API throttling?
- Controlling the usage of an API by limiting requests. Throttling prevents server overload by controlling request rates.
- Which HTTP method is used to update a resource in an API?
- PUT. PUT completely replaces an existing resource with new data.
- What is the role of an API key?
- Authenticates requests to an API. API keys verify identity and control access to services.
- What is an SDK?
- Software Development Kit, a collection of tools for developers. SDKs provide libraries, documentation, and tools for development.
- What is a 'rate limit exceeded' error in an API?
- Occurs when requests exceed the allowed limit. Error returned when API usage exceeds defined rate limits.
- What is the purpose of API documentation?
- To provide details on how to effectively use the API. Documentation guides developers on proper API implementation.
- Define 'endpoint' in the context of APIs.
- A specific function or service exposed by an API. Endpoints are specific URLs that provide access to API functions.
- Define 'REST' in the context of APIs.
- Representational State Transfer, an architectural style for APIs. REST defines principles for stateless, scalable web services.
- What is the purpose of versioning in APIs?
- To manage changes and backward compatibility. Versioning maintains compatibility while allowing API evolution.
- In API documentation, what does 'rate limiting' refer to?
- Restricting the number of API requests in a time frame. Rate limiting prevents API abuse and ensures fair usage.
- Identify the HTTP status code for a 'Not Found' error.
- 404 Not Found. Indicates the requested resource could not be located.
- Identify a common response format in APIs.
- XML. XML provides structured data format alternative to JSON.
- What is a 'sandbox' in API development?
- A testing environment simulating production. Sandboxes provide safe environments for testing API integration.
- What does API stand for in computer science?
- Application Program Interface. Standard acronym for interface that enables software interaction.