1
00:00:00,000 --> 00:00:00,900
In this lesson,

2
00:00:00,900 --> 00:00:03,780
we're going to discuss integrations and APIs.

3
00:00:03,780 --> 00:00:06,150
Integrations and Application Programming Interfaces,

4
00:00:06,150 --> 00:00:09,570
or APIs, as they're commonly called, are the unsung heroes

5
00:00:09,570 --> 00:00:11,130
behind the seamless interconnectivity

6
00:00:11,130 --> 00:00:12,450
and enhanced capabilities

7
00:00:12,450 --> 00:00:15,570
of today's modern software applications and automations.

8
00:00:15,570 --> 00:00:17,700
When it comes to automation orchestration,

9
00:00:17,700 --> 00:00:20,550
integrations and APIs are really the fundamental elements

10
00:00:20,550 --> 00:00:22,410
that are going to drive efficiency, innovation,

11
00:00:22,410 --> 00:00:25,020
and scalability in our modern systems.

12
00:00:25,020 --> 00:00:27,090
Now, before we dive into the specifics of each of these,

13
00:00:27,090 --> 00:00:28,500
let's take a moment to define both

14
00:00:28,500 --> 00:00:30,660
an integration and an API.

15
00:00:30,660 --> 00:00:32,580
Now, an integration refers to the process

16
00:00:32,580 --> 00:00:34,080
of combining different subsystems

17
00:00:34,080 --> 00:00:36,750
or components into one comprehensive system

18
00:00:36,750 --> 00:00:39,330
to ensure that they can function properly together.

19
00:00:39,330 --> 00:00:42,060
An API or Application Programming Interface is

20
00:00:42,060 --> 00:00:44,070
a set of rules and protocols that are used

21
00:00:44,070 --> 00:00:46,620
for building and integrating application software.

22
00:00:46,620 --> 00:00:48,390
An API will allow your product

23
00:00:48,390 --> 00:00:49,890
or service to talk to another product

24
00:00:49,890 --> 00:00:51,720
or service in a controlled environment

25
00:00:51,720 --> 00:00:54,390
and using a specific data exchange format.

26
00:00:54,390 --> 00:00:56,190
Now, when we talk about an API,

27
00:00:56,190 --> 00:00:58,590
it's a library of programming utilities that are used

28
00:00:58,590 --> 00:01:00,840
to enable software developers to access functions

29
00:01:00,840 --> 00:01:03,900
or features of another application programmatically.

30
00:01:03,900 --> 00:01:05,850
APIs are probably the number one thing

31
00:01:05,850 --> 00:01:08,160
that we use in our integrations to be able to communicate

32
00:01:08,160 --> 00:01:10,260
between different portions of a microservice

33
00:01:10,260 --> 00:01:12,510
or a service oriented architecture.

34
00:01:12,510 --> 00:01:13,800
By using an API,

35
00:01:13,800 --> 00:01:16,020
we can automate the administration, management,

36
00:01:16,020 --> 00:01:17,640
and monitoring of various services

37
00:01:17,640 --> 00:01:19,230
and cloud-based infrastructures,

38
00:01:19,230 --> 00:01:21,840
as well as a lot of other applications out there.

39
00:01:21,840 --> 00:01:24,390
Commonly, our APIs are either going to use REST

40
00:01:24,390 --> 00:01:26,070
or SOAP to communicate.

41
00:01:26,070 --> 00:01:28,920
REST, or the Representational State Transfer is

42
00:01:28,920 --> 00:01:32,430
an architectural style that uses the standard HTTP methods

43
00:01:32,430 --> 00:01:35,130
and status codes, uniform resource identifiers,

44
00:01:35,130 --> 00:01:37,080
and MIME types to achieve a simple way

45
00:01:37,080 --> 00:01:40,440
to interact in a stateless manner with a given web service,

46
00:01:40,440 --> 00:01:43,620
REST usually relies on using a JSON formatted message

47
00:01:43,620 --> 00:01:45,840
or JavaScript object notation message

48
00:01:45,840 --> 00:01:47,310
when it transfers its data,

49
00:01:47,310 --> 00:01:49,290
and this makes it a very lightweight protocol

50
00:01:49,290 --> 00:01:50,460
that can be easily integrated

51
00:01:50,460 --> 00:01:52,560
with existing websites without needing to perform

52
00:01:52,560 --> 00:01:54,870
any kind of extensive modifications.

53
00:01:54,870 --> 00:01:56,610
Now, SOAP on the other hand stands

54
00:01:56,610 --> 00:01:58,890
for Simple Object Access Protocol,

55
00:01:58,890 --> 00:02:01,050
and this is a protocol that defines a strict standard

56
00:02:01,050 --> 00:02:03,480
with a set structure for each of the messages.

57
00:02:03,480 --> 00:02:05,730
And they're usually going to be in XML format

58
00:02:05,730 --> 00:02:07,800
and includes a header and a body that's going to be used

59
00:02:07,800 --> 00:02:10,710
to transport data between two different services.

60
00:02:10,710 --> 00:02:13,350
Now, SOAP is known for being more robust than REST

61
00:02:13,350 --> 00:02:15,240
because it has additional security features,

62
00:02:15,240 --> 00:02:18,390
and it has the ability to provide transaction compliance.

63
00:02:18,390 --> 00:02:20,700
So to sum that up, really what it comes down to is

64
00:02:20,700 --> 00:02:22,590
that REST is generally going to be more straightforward

65
00:02:22,590 --> 00:02:24,390
and adaptable for you to utilize,

66
00:02:24,390 --> 00:02:26,790
but SOAP provides you with higher levels of security

67
00:02:26,790 --> 00:02:28,200
and transactional integrity

68
00:02:28,200 --> 00:02:29,910
that will cater to some different use cases

69
00:02:29,910 --> 00:02:33,030
and requirements in a larger enterprise environment.

70
00:02:33,030 --> 00:02:34,800
Now, when I talk about APIs,

71
00:02:34,800 --> 00:02:36,510
we need to think about these from the perspective

72
00:02:36,510 --> 00:02:37,890
of integration.

73
00:02:37,890 --> 00:02:39,480
APIs allow for the integration

74
00:02:39,480 --> 00:02:41,520
between lots of different services out there,

75
00:02:41,520 --> 00:02:44,850
especially cloud-based services like software as a service

76
00:02:44,850 --> 00:02:46,710
or platform as a service.

77
00:02:46,710 --> 00:02:48,900
Most cloud-based providers are also going to do

78
00:02:48,900 --> 00:02:51,060
the provisioning, configuration, deprovisioning,

79
00:02:51,060 --> 00:02:53,280
and lots of other things to their services

80
00:02:53,280 --> 00:02:55,380
by allowing us to use APIs to tell them

81
00:02:55,380 --> 00:02:56,970
what we want them to do.

82
00:02:56,970 --> 00:02:59,100
Now, APIs allow us to have a direct integration

83
00:02:59,100 --> 00:03:00,690
of different third-party applications

84
00:03:00,690 --> 00:03:03,090
into our own web-based applications.

85
00:03:03,090 --> 00:03:05,790
By using APIs, we can integrate services together

86
00:03:05,790 --> 00:03:07,620
and make function calls to those services

87
00:03:07,620 --> 00:03:10,260
instead of having to build the entire service ourself.

88
00:03:10,260 --> 00:03:12,720
With an API, we just call in somebody else's function

89
00:03:12,720 --> 00:03:14,400
and let them do all the work for us

90
00:03:14,400 --> 00:03:16,290
and then return the result back to us.

91
00:03:16,290 --> 00:03:17,550
This is the whole idea of using

92
00:03:17,550 --> 00:03:19,290
a service-oriented architecture,

93
00:03:19,290 --> 00:03:21,450
also known as microservice architecture,

94
00:03:21,450 --> 00:03:24,750
instead of building a single monolithic web application.

95
00:03:24,750 --> 00:03:27,240
Now, let me give you an example of how we use integrations

96
00:03:27,240 --> 00:03:30,000
and APIs in our business here at Dion Training.

97
00:03:30,000 --> 00:03:30,960
Now, for us to be able to conduct

98
00:03:30,960 --> 00:03:32,370
our student support functions,

99
00:03:32,370 --> 00:03:34,560
we use a centralized service management system

100
00:03:34,560 --> 00:03:36,000
known as Freshdesk.

101
00:03:36,000 --> 00:03:38,430
Now, Freshdesk is considered to be a commercial software

102
00:03:38,430 --> 00:03:40,740
as a service product that anybody can use if they pay

103
00:03:40,740 --> 00:03:43,110
a monthly fee, and that's exactly what we do.

104
00:03:43,110 --> 00:03:44,610
We use Freshdesk to be able to get all

105
00:03:44,610 --> 00:03:46,200
of our trouble tickets and questions submitted

106
00:03:46,200 --> 00:03:48,090
by our students into one place,

107
00:03:48,090 --> 00:03:49,830
and then we can track those questions

108
00:03:49,830 --> 00:03:52,170
and make sure they're being answered appropriately.

109
00:03:52,170 --> 00:03:55,290
Now, anytime you send an email to support@diontraining.com,

110
00:03:55,290 --> 00:03:57,030
it goes into our Freshdesk system

111
00:03:57,030 --> 00:03:59,490
so our team can look at those emails, which we call tickets,

112
00:03:59,490 --> 00:04:01,680
and we can answer the questions you sent to us.

113
00:04:01,680 --> 00:04:03,480
You could think about it like a shared inbox,

114
00:04:03,480 --> 00:04:05,100
but it's actually a ticketing system,

115
00:04:05,100 --> 00:04:06,630
and we don't lose track of any of the requests

116
00:04:06,630 --> 00:04:08,910
that we receive from our students because they're all inside

117
00:04:08,910 --> 00:04:09,840
of this ticketing system

118
00:04:09,840 --> 00:04:11,640
and they're numbered and categorized

119
00:04:11,640 --> 00:04:12,870
so we get it to the right person

120
00:04:12,870 --> 00:04:14,760
and get you a prompt answer.

121
00:04:14,760 --> 00:04:17,310
Now, we also provide some of our courses on other platforms.

122
00:04:17,310 --> 00:04:19,980
For example, Udemy hosts a lot of our courses,

123
00:04:19,980 --> 00:04:21,480
and we have people who want to ask those questions

124
00:04:21,480 --> 00:04:23,010
on those courses too.

125
00:04:23,010 --> 00:04:25,380
Well, the problem is Udemy doesn't allow students

126
00:04:25,380 --> 00:04:26,670
to email us directly,

127
00:04:26,670 --> 00:04:28,680
and instead, they could only post their questions

128
00:04:28,680 --> 00:04:31,290
inside the question and answer section of the website.

129
00:04:31,290 --> 00:04:34,050
Unfortunately for us, the Udemy question answer system was

130
00:04:34,050 --> 00:04:36,600
never designed to support instructors like Dion training,

131
00:04:36,600 --> 00:04:38,850
where we have over a million Udemy students.

132
00:04:38,850 --> 00:04:41,070
So it's really easy for student questions to get missed

133
00:04:41,070 --> 00:04:43,500
in that Q&A section if they're expecting us to be able

134
00:04:43,500 --> 00:04:45,510
to look for them and answer each of those.

135
00:04:45,510 --> 00:04:47,190
Now, in order to overcome this limitation,

136
00:04:47,190 --> 00:04:48,270
we would have to be able to rewrite

137
00:04:48,270 --> 00:04:49,560
the entire Udemy website

138
00:04:49,560 --> 00:04:51,570
to support a ticketing system capability

139
00:04:51,570 --> 00:04:53,640
to the instructor backend of their system.

140
00:04:53,640 --> 00:04:56,220
But we at Dion Training don't own Udemy,

141
00:04:56,220 --> 00:04:57,570
and we don't have the access to modify

142
00:04:57,570 --> 00:04:58,890
their website's code anyway,

143
00:04:58,890 --> 00:05:01,380
so we can't do that even if we wanted to.

144
00:05:01,380 --> 00:05:04,260
So how am I going to get all those Q&A posts loaded

145
00:05:04,260 --> 00:05:06,060
into my Freshdesk ticketing system

146
00:05:06,060 --> 00:05:07,800
so I can track and answer all of my students

147
00:05:07,800 --> 00:05:09,540
without missing any of those questions?

148
00:05:09,540 --> 00:05:11,610
Well, if you guess we should use an API,

149
00:05:11,610 --> 00:05:13,800
you are absolutely correct.

150
00:05:13,800 --> 00:05:15,720
Udemy created an API that allows anybody

151
00:05:15,720 --> 00:05:19,170
to programmatically read and respond to any Q&A posts.

152
00:05:19,170 --> 00:05:21,960
So I had my development team at Dion Training spend

153
00:05:21,960 --> 00:05:24,270
about a week or two creating a small integration

154
00:05:24,270 --> 00:05:26,040
that queries the Udemy API,

155
00:05:26,040 --> 00:05:28,470
and anytime there's a new question or answer posted,

156
00:05:28,470 --> 00:05:30,930
we read it from that system using the API,

157
00:05:30,930 --> 00:05:33,330
and then we create a new trouble ticket in Freshdesk

158
00:05:33,330 --> 00:05:34,707
using the Freshdesk API.

159
00:05:34,707 --> 00:05:36,870
And so we have this microservice program

160
00:05:36,870 --> 00:05:39,090
that's talking to Udemy and talking to Freshdesk

161
00:05:39,090 --> 00:05:41,220
to move tickets between the two systems.

162
00:05:41,220 --> 00:05:43,800
This way, all of our Udemy Q&A's will show up

163
00:05:43,800 --> 00:05:45,780
as trouble tickets inside of our system,

164
00:05:45,780 --> 00:05:48,082
just as if those students emailed us directly

165
00:05:48,082 --> 00:05:50,220
at support@diontraining.com.

166
00:05:50,220 --> 00:05:52,230
Now, when our team answers the question,

167
00:05:52,230 --> 00:05:54,060
instead of sending the response back by email,

168
00:05:54,060 --> 00:05:56,250
because we don't know a Udemy student's email address,

169
00:05:56,250 --> 00:05:57,810
'cause they don't share that with us,

170
00:05:57,810 --> 00:05:59,790
our systems will then run another automation

171
00:05:59,790 --> 00:06:02,010
that reads the response that our agents wrote

172
00:06:02,010 --> 00:06:04,560
inside of Freshdesk, and then pulling that from Freshdesk

173
00:06:04,560 --> 00:06:06,960
using the Freshdesk API, modifying it,

174
00:06:06,960 --> 00:06:09,090
and then posting it to Udemy's API

175
00:06:09,090 --> 00:06:12,150
so it shows up in the Udemy Q&A for that course.

176
00:06:12,150 --> 00:06:14,910
This is the type of integration you can do using an API.

177
00:06:14,910 --> 00:06:17,140
And in our case, the entire integration program is

178
00:06:17,140 --> 00:06:20,968
about 250 lines of Python code running in a serverless,

179
00:06:20,968 --> 00:06:22,740
AWS Lambda environment.

180
00:06:22,740 --> 00:06:25,530
This entire thing took us about one to two weeks to create,

181
00:06:25,530 --> 00:06:28,290
test, and deploy, and only cost us about $3

182
00:06:28,290 --> 00:06:30,060
to run this code every four hours

183
00:06:30,060 --> 00:06:31,890
to get those new questions and answers,

184
00:06:31,890 --> 00:06:33,060
create those trouble tickets,

185
00:06:33,060 --> 00:06:35,670
and post the responses back to the Q&A section

186
00:06:35,670 --> 00:06:37,560
once the team answers them.

187
00:06:37,560 --> 00:06:39,210
Now, this integration allows our team

188
00:06:39,210 --> 00:06:41,070
to work more efficiently since they can answer

189
00:06:41,070 --> 00:06:43,980
all the student questions in one place inside of Freshdesk,

190
00:06:43,980 --> 00:06:46,290
and then the answers are sent back to the student

191
00:06:46,290 --> 00:06:47,940
to their preferred support channel,

192
00:06:47,940 --> 00:06:50,160
either by email or the Q&A section,

193
00:06:50,160 --> 00:06:52,920
depending on where they submitted their question initially.

194
00:06:52,920 --> 00:06:54,780
Now, from the perspective of my students,

195
00:06:54,780 --> 00:06:56,580
they never know that any of this is happening

196
00:06:56,580 --> 00:06:58,470
in the background using this integration.

197
00:06:58,470 --> 00:07:01,140
Instead, it looks like I just logged directly into Udemy

198
00:07:01,140 --> 00:07:03,420
and found their question and posted an answer to it

199
00:07:03,420 --> 00:07:05,040
inside of the Q&A directly.

200
00:07:05,040 --> 00:07:07,350
But for our team, it's easier for us to manage

201
00:07:07,350 --> 00:07:10,320
and allows us to help more students more quickly.

202
00:07:10,320 --> 00:07:12,840
Another example of using an API integration is

203
00:07:12,840 --> 00:07:14,310
the one that we built that allows our students

204
00:07:14,310 --> 00:07:16,560
to access our hands-on cloud-based labs

205
00:07:16,560 --> 00:07:18,900
inside any of our courses that you may have purchased

206
00:07:18,900 --> 00:07:20,610
at diontraining.com.

207
00:07:20,610 --> 00:07:23,370
So if you take a course at diontraining.com,

208
00:07:23,370 --> 00:07:25,290
you'll see video lessons and quizzes

209
00:07:25,290 --> 00:07:27,810
and downloadable study guides and practice exams,

210
00:07:27,810 --> 00:07:29,700
all of which we created ourself.

211
00:07:29,700 --> 00:07:31,740
But when you reach a lab-based lesson,

212
00:07:31,740 --> 00:07:34,020
you'll click on a link that says "Launch the lab"

213
00:07:34,020 --> 00:07:36,270
and the lab environment will be returned to you inside

214
00:07:36,270 --> 00:07:37,590
of our learning management system,

215
00:07:37,590 --> 00:07:39,540
using a backend integration.

216
00:07:39,540 --> 00:07:40,710
Now, when it comes to the labs,

217
00:07:40,710 --> 00:07:42,420
we actually didn't build those ourself,

218
00:07:42,420 --> 00:07:44,970
but instead we rely on a third party partner

219
00:07:44,970 --> 00:07:45,840
that we work with.

220
00:07:45,840 --> 00:07:47,700
And then my team integrated their labs

221
00:07:47,700 --> 00:07:49,230
into your course experience,

222
00:07:49,230 --> 00:07:50,550
and we want it to be integrated this way

223
00:07:50,550 --> 00:07:51,690
so you don't realize you're using

224
00:07:51,690 --> 00:07:53,490
a third party provider tool.

225
00:07:53,490 --> 00:07:56,310
In fact, in the old days, we didn't have this integration,

226
00:07:56,310 --> 00:07:57,690
and so our students had to log into

227
00:07:57,690 --> 00:07:58,950
the lab provider's website

228
00:07:58,950 --> 00:08:00,810
with a different username and password

229
00:08:00,810 --> 00:08:02,040
and then select the lab they needed

230
00:08:02,040 --> 00:08:03,930
to take at a specific time.

231
00:08:03,930 --> 00:08:05,940
But by using the API integration,

232
00:08:05,940 --> 00:08:07,890
we removed the need for you to have another username

233
00:08:07,890 --> 00:08:10,140
and password, the need to go to another website,

234
00:08:10,140 --> 00:08:12,420
and the need for you to figure out which lab out of the 30

235
00:08:12,420 --> 00:08:14,580
or so labs that was included with the course are

236
00:08:14,580 --> 00:08:17,250
the ones you should be taking at any given time.

237
00:08:17,250 --> 00:08:18,540
Now, with the integration we created,

238
00:08:18,540 --> 00:08:20,580
this whole experience has been optimized.

239
00:08:20,580 --> 00:08:23,460
So if you're taking this course at diontraining.com,

240
00:08:23,460 --> 00:08:25,590
you've already gotten to some labs at this point.

241
00:08:25,590 --> 00:08:27,570
And as you got to that, you're going through the course,

242
00:08:27,570 --> 00:08:29,400
you're watching a video, and eventually you get to something

243
00:08:29,400 --> 00:08:31,530
that says, "Hey, it's time for a lab.

244
00:08:31,530 --> 00:08:33,659
You're going to do X, Y, and Z in this lab.

245
00:08:33,659 --> 00:08:35,070
Click here to start the lab."

246
00:08:35,070 --> 00:08:37,890
And if you look at that link, it says something like this.

247
00:08:37,890 --> 00:08:40,830
Notice it says,"Diontraining.com, question mark,

248
00:08:40,830 --> 00:08:45,240
action equals run instance and ID equals, and the count

249
00:08:45,240 --> 00:08:47,610
and the access key" and all those other things.

250
00:08:47,610 --> 00:08:50,010
These are the parameters that we're passing to the API

251
00:08:50,010 --> 00:08:51,450
of our lab provider.

252
00:08:51,450 --> 00:08:53,850
This allows the lab provider to know which student is taking

253
00:08:53,850 --> 00:08:55,680
that lab based on their student ID,

254
00:08:55,680 --> 00:08:57,330
which lesson they are at in the course,

255
00:08:57,330 --> 00:08:58,710
and which lab needs to be run.

256
00:08:58,710 --> 00:09:00,330
And it gives them an authorization token

257
00:09:00,330 --> 00:09:01,890
to say they're authorized to do it

258
00:09:01,890 --> 00:09:04,260
because we pay every time somebody accesses

259
00:09:04,260 --> 00:09:05,580
one of those labs.

260
00:09:05,580 --> 00:09:06,840
Now, we sent all those details

261
00:09:06,840 --> 00:09:08,370
to the lab provider using the API,

262
00:09:08,370 --> 00:09:10,710
and in return, they provide us with a link

263
00:09:10,710 --> 00:09:12,270
that says, "Lab Launch link,"

264
00:09:12,270 --> 00:09:14,070
and we display that on your screen.

265
00:09:14,070 --> 00:09:16,260
This is actually a magic link that when you click it will

266
00:09:16,260 --> 00:09:19,140
open up the lab within the next three to five minutes.

267
00:09:19,140 --> 00:09:21,510
If you happen to wait 10 minutes or 10 hours,

268
00:09:21,510 --> 00:09:24,090
that link will expire and you'll have to get a new one.

269
00:09:24,090 --> 00:09:25,890
Now, once you click on that link, it's going to load

270
00:09:25,890 --> 00:09:27,540
inside of our learning management system,

271
00:09:27,540 --> 00:09:29,670
and it only loads from our learning management system

272
00:09:29,670 --> 00:09:32,160
because of the security controls we have in place.

273
00:09:32,160 --> 00:09:34,500
So remember, integrations and APIs are used

274
00:09:34,500 --> 00:09:35,940
to create seamless experiences

275
00:09:35,940 --> 00:09:38,070
and interconnections between different services

276
00:09:38,070 --> 00:09:40,260
to enhance their default capabilities.

277
00:09:40,260 --> 00:09:41,730
Integrations refer to the process

278
00:09:41,730 --> 00:09:43,080
of combining different subsystems

279
00:09:43,080 --> 00:09:45,600
or components into one comprehensive system

280
00:09:45,600 --> 00:09:47,850
to ensure that they function properly together.

281
00:09:47,850 --> 00:09:50,490
An API or Application Programming Interface is

282
00:09:50,490 --> 00:09:52,350
a set of rules and protocols that are used

283
00:09:52,350 --> 00:09:54,930
for building an integrating application software.

284
00:09:54,930 --> 00:09:57,690
An API is going to allow your product or service to talk

285
00:09:57,690 --> 00:10:00,060
to another product or service in a controlled environment

286
00:10:00,060 --> 00:10:02,610
and using a specific data exchange format.

287
00:10:02,610 --> 00:10:04,830
When we're using automation or orchestration,

288
00:10:04,830 --> 00:10:07,830
we're going to rely heavily on APIs to create interconnections

289
00:10:07,830 --> 00:10:10,200
between our different microservices or services

290
00:10:10,200 --> 00:10:12,800
that are being provided by our third party partners.

