JavaScript APIs Flashcards

(26 cards)

1
Q

What does API stand for?

A

API stands for Application Programming Interface, a system that enables two applications to communicate and exchange data or services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does an API function like a waiter?

A

An API acts as a messenger: it delivers your request to another system (like a database) and returns the system’s response, similar to how a waiter delivers orders between a customer and kitchen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does API documentation provide?

A

API documentation lists valid requests, expected responses, and data formats—similar to a restaurant menu defining available items.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a JavaScript API?

A

A JavaScript API is an interface that allows JavaScript code to dynamically access and modify web content or communicate with external services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does REST stand for?

A

REST stands for Representational State Transfer, an architectural style for designing networked APIs using standard HTTP methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the four CRUD operations?

A

CRUD stands for Create, Read, Update, and Delete—the four basic operations used to manage data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Match CRUD operations with their HTTP methods

A

Create → POST; Read → GET; Update → PUT; Delete → DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does a POST request do in a REST API?

A

A POST request creates a new resource on the server, such as adding a new customer record.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does a GET request do in a REST API?

A

A GET request retrieves data from the server, such as customer information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does a PUT request do in a REST API?

A

A PUT request updates an existing resource on the server with new data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does a DELETE request do in a REST API?

A

A DELETE request removes a specific resource from the server, such as deleting a customer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What data formats are commonly used in REST APIs?

A

JSON and XML are common data formats used for sending and receiving information between clients and servers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of an ‘id’ in REST URLs?

A

An ‘id’ uniquely identifies a resource, allowing requests like GET, PUT, or DELETE to target a specific item.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is an example of a POST request URL in a banking API?

A

POST api/customers — creates a new customer record in the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an example of a GET request URL in a banking API?

A

GET api/customers/{id} — retrieves information about a specific customer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is an example of a PUT request body for updating customer info?

A

{ "first_name": "Thomas", "last_name": "Watson" }

17
Q

What does the DOM API do?

A

The DOM (Document Object Model) API connects web pages to scripts by representing the page structure in memory, enabling dynamic modification.

18
Q

Why is the DOM API important?

A

It allows JavaScript to add, remove, or change elements, styles, and content dynamically on a web page.

19
Q

What is XMLHttpRequest (XHR)?

A

A JavaScript API that retrieves data from a server without reloading the entire page.

20
Q

How is XMLHttpRequest used in AJAX?

A

It enables asynchronous updates, letting parts of a webpage refresh dynamically while users continue interacting with the rest of the page.

21
Q

Why is XMLHttpRequest significant for user experience?

A

It supports seamless, real-time data updates without full page reloads, improving interactivity.

22
Q

Where can you find documentation for XMLHttpRequest?

A

On the Mozilla Developer Network (MDN): https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest

23
Q

What does AJAX stand for?

A

AJAX stands for Asynchronous JavaScript and XML, a technique for building dynamic web applications using asynchronous server requests.

24
Q

What are advanced JavaScript APIs?

A

They are specialized APIs—like those for graphics, storage, geolocation, and multimedia—that extend browser capabilities.

25
Where can you find reliable references for JavaScript APIs?
The official Mozilla Developer Network (MDN) website provides comprehensive documentation and examples.
26
What should you know after studying JavaScript APIs?
You should be able to define APIs, describe REST architecture, explain CRUD operations, and identify common JavaScript APIs like DOM and XMLHttpRequest.