Using APIs Flashcards

1
Q

Use cases for APIs: (3)

A
  • Automation tasks
  • Data integration
  • Functionality
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why are APIs so popular? (4)

A
  • Apps were locked down
  • The demand for integration has grown and more apps are exposing APIs.
  • Modern APIs are designed as part of the product and even used as part of the product.
  • The demand for APIs has made simple languages use these APIs and means non-software engineers can build apps and get results they need.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name two types of APIs and the difference?

A

Synchronous API - Response and data is provided directly

Asynchronous API - Provides an initial response, but client needs to “call back” to obtain the data

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

Name 3 architectural styles of API calls

A

RPC
REST
SOAP

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

RPC implementation types

A

○ XML-RPC
○ JSON-RPC
○ NFS
○ Simple Object Access Protocol (SOAP)

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

What data format does SOAP support?

A

XML

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

Name the elements of SOAP message ? (4)

A

Envelope
Header
Body
Fault

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

Name 6 REST Constraints to be RESTful

A
Client-Server
Stateless
Cache
Uniform Interface
Layered System
Code-on-demand
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Name 4 components of REST API

A

URI
HTTP Method
HEADER
BODY

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

Name the 5 types of status codes and their meaning (high level)

A
1xx Informational
2xx Success
3xx Redirection
4xx Client Error
5xx Server error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

HTTP Status CODE - OK

A

200

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

HTTP Status CODE - Created

A

201

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

HTTP Status CODE - Bad Request

A

400

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

HTTP Status CODE - Forbidden

A

403

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

HTTP Status CODE - Unauthorized

A

401

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

HTTP Status CODE - Not Found

A

404

17
Q

HTTP Status CODE - Internal Error

A

500

18
Q

HTTP Status CODE - Service Unavailable

A

503

19
Q

HTTP Status CODE - Not implemented

A

501

20
Q

REST Authentication Methods

A

Basic Authentication
Bearer Authentication (token)
API Key

21
Q

What method of authentication does OAuth use

A

Token like bearer Authentication

22
Q

Why use API rate limits? (3)

A
  • Avoiding server overload
  • Provide better response times
  • Protect against Dos attacks
23
Q

List 4 API rate limit algorithms

A

Leaky bucket
Token bucket
Fixed window counter
Sliding Window Counter

24
Q

API Rate limit - explain X-RateLimit-Limit header

A

the max number of request per unit of time

25
Q

API Rate limit - explain X-RateLimit-Remaining header

A

the number of requests remaining in that unit of time

26
Q

API Rate limit - explain X-RateLimit-Reset header

A

the time the limit will reset

27
Q

What is a webhook?

A

Also called reverse API

Its an HTTP callback or HTTP Post

28
Q

HTTP Status CODE - Method not allowed

A

405

29
Q

HTTP Status CODE - Bad Gateway

A

502

30
Q

HTTP Status CODE - Gateway timeout

A

504

31
Q

HTTP Status CODE - No content

A

204