0
1
00:00:00,000 --> 00:00:03,741
Okay so this is the API that
we're going to use to build our
1

2
00:00:03,741 --> 00:00:09,341
application so it's open trivia
database it's open source so
2

3
00:00:09,341 --> 00:00:15,421
basically there is I think an
API section here and it explain
3

4
00:00:15,421 --> 00:00:19,581
how it's working but I'm going
to make it short for you so
4

5
00:00:19,581 --> 00:00:25,741
basically we can send four
parameters to this API a number
5

6
00:00:25,741 --> 00:00:29,741
of question that can be for
example between one and 30, I
6

7
00:00:29,741 --> 00:00:33,261
don't know exactly what's the
maximum but we're going to stay
7

8
00:00:33,261 --> 00:00:37,901
between one and 30 for our
application then you can send a
8

9
00:00:37,901 --> 00:00:42,541
category or no category
actually so there are a list of
9

10
00:00:42,541 --> 00:00:45,821
categories that are available
and we'll have to make a
10

11
00:00:45,821 --> 00:00:49,421
request to these very specific
API to get all the possible
11

12
00:00:49,421 --> 00:00:53,581
categories that we can send
okay so there is two fetch
12

13
00:00:53,581 --> 00:00:57,981
request that we will have to do
first one is to get this list
13

14
00:00:57,981 --> 00:01:03,581
so we can send one category
okay for example science or we
14

15
00:01:03,581 --> 00:01:06,941
can send an empty string and
this means that in the for
15

16
00:01:06,941 --> 00:01:11,841
example 10 questions that we'll
have ... they can add Any kind
16

17
00:01:11,841 --> 00:01:15,041
of category, okay? We can have
one that has science, one that
17

18
00:01:15,041 --> 00:01:18,721
has sport, one that has art et
cetera. So if you send an empty
18

19
00:01:18,721 --> 00:01:22,481
string it basically means send
me a mix of question with
19

20
00:01:22,481 --> 00:01:27,461
different categories. So it's
going to be almost exactly the
20

21
00:01:27,461 --> 00:01:31,541
same thing with difficulty but
we won't have to fetch the data
21

22
00:01:31,541 --> 00:01:36,501
okay we are going to art code
easy medium and hard and we can
22

23
00:01:36,501 --> 00:01:39,781
also send an empty string and
if we do that well we're going
23

24
00:01:39,781 --> 00:01:43,901
to again have a mix of
difficulties into our questions
24

25
00:01:43,901 --> 00:01:48,021
and finally again it's going to
be the same thing for the type
25

26
00:01:48,021 --> 00:01:52,341
so we can use multiple boolean
or an empty string so we're
26

27
00:01:52,341 --> 00:01:55,381
going to always use multiple
because that's what we're
27

28
00:01:55,381 --> 00:02:00,941
building okay we're bridging a
quiz with four possible answers
28

29
00:02:00,941 --> 00:02:04,941
but you could also ask for true
false questions if you want,
29

30
00:02:04,941 --> 00:02:08,301
okay? So maybe that could be an
improvement for after this
30

31
00:02:08,301 --> 00:02:13,021
project. Uh and you can also
send an empty string here and
31

32
00:02:13,021 --> 00:02:16,381
you will have a mix of multiple
and boolean types in your
32

33
00:02:16,381 --> 00:02:20,941
questions. Okay? So that's all
the data that we will have to
33

34
00:02:20,941 --> 00:02:25,581
build before starting a game.
So we're going to ask the user
34

35
00:02:25,581 --> 00:02:30,181
for all this data and after
that we will create the HTTP
35

36
00:02:30,181 --> 00:02:32,581
request and as you can see here
I have asked for three
36

37
00:02:32,581 --> 00:02:36,821
questions that all have the
difficulty easy that are all of
37

38
00:02:36,821 --> 00:02:40,901
multiple type and I have not
specified a very specific
38

39
00:02:40,901 --> 00:02:45,141
categories so I will have a mix
of categories and this is going
39

40
00:02:45,141 --> 00:02:49,301
to give me something like this
okay I will have an object with
40

41
00:02:49,301 --> 00:02:52,901
a response code okay and then
inside a result array that
41

42
00:02:52,901 --> 00:02:56,341
contains all the information
for each my questions so we'll
42

43
00:02:56,341 --> 00:02:59,761
have all the information of the
question so the the type and
43

44
00:02:59,761 --> 00:03:02,721
the difficulty and we'll
finally have the actual
44

45
00:03:02,721 --> 00:03:06,801
question. And we'll have the
correct answer and we also have
45

46
00:03:06,801 --> 00:03:11,281
three wrong answers. Okay? And
we'll have that for each
46

47
00:03:11,281 --> 00:03:16,081
questions. So once we'll have
this array of question we'll be
47

48
00:03:16,081 --> 00:03:18,641
able to play the game. So
basically we're going to split
48

49
00:03:18,641 --> 00:03:22,001
the work, okay? The first part
of the work will be to really
49

50
00:03:22,001 --> 00:03:25,441
be able to generate this URL,
okay? So we'll have to create
50

51
00:03:25,441 --> 00:03:29,841
the HTTP request, create the
screens to ask the user to send
51

52
00:03:29,841 --> 00:03:32,481
the number of question, the
categories, the difficulty and
52

53
00:03:32,481 --> 00:03:36,401
the type and once all of this
will be good we will work on
53

54
00:03:36,401 --> 00:03:40,001
the the actual game okay using
the data that will have
54

55
00:03:40,001 --> 00:03:44,561
received from the API okay and
if you want you can try the API
55

56
00:03:44,561 --> 00:03:47,281
already for example here I
could ask for three question
56

57
00:03:47,281 --> 00:03:53,041
with a category that would be I
don't know general knowledge
57

58
00:03:53,041 --> 00:03:59,081
easy, multiple choice and I'm not
going to modify this encoding
58

59
00:03:59,081 --> 00:04:05,501
and okay this generate an API
URL and I can try it and I will
59

60
00:04:05,501 --> 00:04:11,441
have some data, okay? All
right. Um okay so I hope it's
60

61
00:04:11,441 --> 00:04:13,841
clear well in the next video we
are going to start really
61

62
00:04:13,841 --> 00:04:17,841
working. See you in the next
one.
