In this lesson,
we're going to discuss integrations and APIs.
Integrations and Application Programming Interfaces,
or APIs, as they're commonly called, are the unsung heroes
behind the seamless interconnectivity
and enhanced capabilities
of today's modern software applications and automations.
When it comes to automation orchestration,
integrations and APIs are really the fundamental elements
that are going to drive efficiency, innovation,
and scalability in our modern systems.
Now, before we dive into the specifics of each of these,
let's take a moment to define both
an integration and an API.
Now, an integration refers to the process
of combining different subsystems
or components into one comprehensive system
to ensure that they can function properly together.
An API or Application Programming Interface is
a set of rules and protocols that are used
for building and integrating application software.
An API will allow your product
or service to talk to another product
or service in a controlled environment
and using a specific data exchange format.
Now, when we talk about an API,
it's a library of programming utilities that are used
to enable software developers to access functions
or features of another application programmatically.
APIs are probably the number one thing
that we use in our integrations to be able to communicate
between different portions of a microservice
or a service oriented architecture.
By using an API,
we can automate the administration, management,
and monitoring of various services
and cloud-based infrastructures,
as well as a lot of other applications out there.
Commonly, our APIs are either going to use REST
or SOAP to communicate.
REST, or the Representational State Transfer is
an architectural style that uses the standard HTTP methods
and status codes, uniform resource identifiers,
and MIME types to achieve a simple way
to interact in a stateless manner with a given web service,
REST usually relies on using a JSON formatted message
or JavaScript object notation message
when it transfers its data,
and this makes it a very lightweight protocol
that can be easily integrated
with existing websites without needing to perform
any kind of extensive modifications.
Now, SOAP on the other hand stands
for Simple Object Access Protocol,
and this is a protocol that defines a strict standard
with a set structure for each of the messages.
And they're usually going to be in XML format
and includes a header and a body that's going to be used
to transport data between two different services.
Now, SOAP is known for being more robust than REST
because it has additional security features,
and it has the ability to provide transaction compliance.
So to sum that up, really what it comes down to is
that REST is generally going to be more straightforward
and adaptable for you to utilize,
but SOAP provides you with higher levels of security
and transactional integrity
that will cater to some different use cases
and requirements in a larger enterprise environment.
Now, when I talk about APIs,
we need to think about these from the perspective
of integration.
APIs allow for the integration
between lots of different services out there,
especially cloud-based services like software as a service
or platform as a service.
Most cloud-based providers are also going to do
the provisioning, configuration, deprovisioning,
and lots of other things to their services
by allowing us to use APIs to tell them
what we want them to do.
Now, APIs allow us to have a direct integration
of different third-party applications
into our own web-based applications.
By using APIs, we can integrate services together
and make function calls to those services
instead of having to build the entire service ourself.
With an API, we just call in somebody else's function
and let them do all the work for us
and then return the result back to us.
This is the whole idea of using
a service-oriented architecture,
also known as microservice architecture,
instead of building a single monolithic web application.
Now, let me give you an example of how we use integrations
and APIs in our business here at Dion Training.
Now, for us to be able to conduct
our student support functions,
we use a centralized service management system
known as Freshdesk.
Now, Freshdesk is considered to be a commercial software
as a service product that anybody can use if they pay
a monthly fee, and that's exactly what we do.
We use Freshdesk to be able to get all
of our trouble tickets and questions submitted
by our students into one place,
and then we can track those questions
and make sure they're being answered appropriately.
Now, anytime you send an email to support@diontraining.com,
it goes into our Freshdesk system
so our team can look at those emails, which we call tickets,
and we can answer the questions you sent to us.
You could think about it like a shared inbox,
but it's actually a ticketing system,
and we don't lose track of any of the requests
that we receive from our students because they're all inside
of this ticketing system
and they're numbered and categorized
so we get it to the right person
and get you a prompt answer.
Now, we also provide some of our courses on other platforms.
For example, Udemy hosts a lot of our courses,
and we have people who want to ask those questions
on those courses too.
Well, the problem is Udemy doesn't allow students
to email us directly,
and instead, they could only post their questions
inside the question and answer section of the website.
Unfortunately for us, the Udemy question answer system was
never designed to support instructors like Dion training,
where we have over a million Udemy students.
So it's really easy for student questions to get missed
in that Q&A section if they're expecting us to be able
to look for them and answer each of those.
Now, in order to overcome this limitation,
we would have to be able to rewrite
the entire Udemy website
to support a ticketing system capability
to the instructor backend of their system.
But we at Dion Training don't own Udemy,
and we don't have the access to modify
their website's code anyway,
so we can't do that even if we wanted to.
So how am I going to get all those Q&A posts loaded
into my Freshdesk ticketing system
so I can track and answer all of my students
without missing any of those questions?
Well, if you guess we should use an API,
you are absolutely correct.
Udemy created an API that allows anybody
to programmatically read and respond to any Q&A posts.
So I had my development team at Dion Training spend
about a week or two creating a small integration
that queries the Udemy API,
and anytime there's a new question or answer posted,
we read it from that system using the API,
and then we create a new trouble ticket in Freshdesk
using the Freshdesk API.
And so we have this microservice program
that's talking to Udemy and talking to Freshdesk
to move tickets between the two systems.
This way, all of our Udemy Q&A's will show up
as trouble tickets inside of our system,
just as if those students emailed us directly
at support@diontraining.com.
Now, when our team answers the question,
instead of sending the response back by email,
because we don't know a Udemy student's email address,
'cause they don't share that with us,
our systems will then run another automation
that reads the response that our agents wrote
inside of Freshdesk, and then pulling that from Freshdesk
using the Freshdesk API, modifying it,
and then posting it to Udemy's API
so it shows up in the Udemy Q&A for that course.
This is the type of integration you can do using an API.
And in our case, the entire integration program is
about 250 lines of Python code running in a serverless,
AWS Lambda environment.
This entire thing took us about one to two weeks to create,
test, and deploy, and only cost us about $3
to run this code every four hours
to get those new questions and answers,
create those trouble tickets,
and post the responses back to the Q&A section
once the team answers them.
Now, this integration allows our team
to work more efficiently since they can answer
all the student questions in one place inside of Freshdesk,
and then the answers are sent back to the student
to their preferred support channel,
either by email or the Q&A section,
depending on where they submitted their question initially.
Now, from the perspective of my students,
they never know that any of this is happening
in the background using this integration.
Instead, it looks like I just logged directly into Udemy
and found their question and posted an answer to it
inside of the Q&A directly.
But for our team, it's easier for us to manage
and allows us to help more students more quickly.
Another example of using an API integration is
the one that we built that allows our students
to access our hands-on cloud-based labs
inside any of our courses that you may have purchased
at diontraining.com.
So if you take a course at diontraining.com,
you'll see video lessons and quizzes
and downloadable study guides and practice exams,
all of which we created ourself.
But when you reach a lab-based lesson,
you'll click on a link that says "Launch the lab"
and the lab environment will be returned to you inside
of our learning management system,
using a backend integration.
Now, when it comes to the labs,
we actually didn't build those ourself,
but instead we rely on a third party partner
that we work with.
And then my team integrated their labs
into your course experience,
and we want it to be integrated this way
so you don't realize you're using
a third party provider tool.
In fact, in the old days, we didn't have this integration,
and so our students had to log into
the lab provider's website
with a different username and password
and then select the lab they needed
to take at a specific time.
But by using the API integration,
we removed the need for you to have another username
and password, the need to go to another website,
and the need for you to figure out which lab out of the 30
or so labs that was included with the course are
the ones you should be taking at any given time.
Now, with the integration we created,
this whole experience has been optimized.
So if you're taking this course at diontraining.com,
you've already gotten to some labs at this point.
And as you got to that, you're going through the course,
you're watching a video, and eventually you get to something
that says, "Hey, it's time for a lab.
You're going to do X, Y, and Z in this lab.
Click here to start the lab."
And if you look at that link, it says something like this.
Notice it says,"Diontraining.com, question mark,
action equals run instance and ID equals, and the count
and the access key" and all those other things.
These are the parameters that we're passing to the API
of our lab provider.
This allows the lab provider to know which student is taking
that lab based on their student ID,
which lesson they are at in the course,
and which lab needs to be run.
And it gives them an authorization token
to say they're authorized to do it
because we pay every time somebody accesses
one of those labs.
Now, we sent all those details
to the lab provider using the API,
and in return, they provide us with a link
that says, "Lab Launch link,"
and we display that on your screen.
This is actually a magic link that when you click it will
open up the lab within the next three to five minutes.
If you happen to wait 10 minutes or 10 hours,
that link will expire and you'll have to get a new one.
Now, once you click on that link, it's going to load
inside of our learning management system,
and it only loads from our learning management system
because of the security controls we have in place.
So remember, integrations and APIs are used
to create seamless experiences
and interconnections between different services
to enhance their default capabilities.
Integrations refer to the process
of combining different subsystems
or components into one comprehensive system
to ensure that they function properly together.
An API or Application Programming Interface is
a set of rules and protocols that are used
for building an integrating application software.
An API is going to allow your product or service to talk
to another product or service in a controlled environment
and using a specific data exchange format.
When we're using automation or orchestration,
we're going to rely heavily on APIs to create interconnections
between our different microservices or services
that are being provided by our third party partners.