Application Program Interface (API) and Libraries - AP Computer Science A

  1. 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.
  2. What is a 'webhook' in API terminology?
    An HTTP callback triggered by an event. Webhooks enable real-time notifications and automated responses.
  3. What is 'OAuth' in the context of APIs?
    An open standard for access delegation. OAuth provides secure authorization without sharing passwords.
  4. What is an API endpoint response?
    Data returned from an API upon request. Response contains the requested data or operation result.
  5. Identify the role of an API client.
    Requests services from an API. Clients consume API services and handle responses.
  6. 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.
  7. 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.
  8. Which HTTP method is typically used to retrieve data in an API?
    GET. GET requests fetch data without modifying server state.
  9. What is the primary benefit of microservices architecture with APIs?
    Scalability and independent deployment of services. Microservices enable modular, scalable application architecture.
  10. What is a common use of private APIs?
    Internal company use to integrate systems. Private APIs connect internal systems within organizations.
  11. Which API architecture style uses XML and SOAP?
    SOAP (Simple Object Access Protocol). SOAP uses XML messaging for structured web service communication.
  12. What is an endpoint in an API?
    A specific URL where API requests are addressed. Endpoints define specific access points for API functionality.
  13. 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.
  14. Identify a primary feature of RESTful APIs.
    Stateless communication. Each request contains all necessary information independently.
  15. Identify an advantage of using APIs in web development.
    Facilitates integration with third-party services. APIs enable seamless connection to external services and data.
  16. 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.
  17. What is an API gateway?
    A server that acts as an entry point for APIs. Gateways manage API traffic, security, and routing centrally.
  18. What does CORS stand for in web APIs?
    Cross-Origin Resource Sharing. CORS allows web pages to access resources from different domains.
  19. Identify the HTTP status code for a successful API request.
    200 OK. Standard HTTP response indicating successful request completion.
  20. 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.
  21. What does CRUD stand for in API operations?
    Create, Read, Update, Delete. CRUD represents the four basic database operations.
  22. Identify one standard format for API data exchange.
    JSON (JavaScript Object Notation). JSON is lightweight and widely used for API data transmission.
  23. 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.
  24. What is the primary purpose of an API?
    To allow different software applications to communicate. APIs enable software components to exchange data and functionality.
  25. What is a common protocol used with web APIs?
    HTTP/HTTPS. HTTPS ensures secure, encrypted communication for web APIs.
  26. What is meant by API throttling?
    Controlling the usage of an API by limiting requests. Throttling prevents server overload by controlling request rates.
  27. Which HTTP method is used to update a resource in an API?
    PUT. PUT completely replaces an existing resource with new data.
  28. What is the role of an API key?
    Authenticates requests to an API. API keys verify identity and control access to services.
  29. What is an SDK?
    Software Development Kit, a collection of tools for developers. SDKs provide libraries, documentation, and tools for development.
  30. 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.
  31. What is the purpose of API documentation?
    To provide details on how to effectively use the API. Documentation guides developers on proper API implementation.
  32. 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.
  33. Define 'REST' in the context of APIs.
    Representational State Transfer, an architectural style for APIs. REST defines principles for stateless, scalable web services.
  34. What is the purpose of versioning in APIs?
    To manage changes and backward compatibility. Versioning maintains compatibility while allowing API evolution.
  35. 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.
  36. Identify the HTTP status code for a 'Not Found' error.
    404 Not Found. Indicates the requested resource could not be located.
  37. Identify a common response format in APIs.
    XML. XML provides structured data format alternative to JSON.
  38. What is a 'sandbox' in API development?
    A testing environment simulating production. Sandboxes provide safe environments for testing API integration.
  39. What does API stand for in computer science?
    Application Program Interface. Standard acronym for interface that enables software interaction.

Study these flashcards