0:00
hey everyone my name is Janis and in
0:02
today's video I want to show you how you
0:04
can make all 2 API request using mag.com
0:09
since many apis are moving away from API
0:14
keys and using all to instead I think
0:18
it's kind of useful for you to know how
0:20
to make such request to your API and um
0:25
recently I did a project for my client
0:28
and the API that was in the project
0:31
required all to authorization so I had
0:35
to learn how to make this connection and
0:37
I want to share with you what I learned
0:39
so this won't be a long video just
0:41
making a simple API uh connection uh
0:45
using all out2 credentials okay so here
0:48
we are on the blank scenario and we're
0:52
going to choose uh a module HTTP module
0:56
and we're going to scroll down and make
0:58
an all out to request so what this
1:01
module does instead of you making an API
1:05
call with an API key you will be making
1:08
an API call using your
1:11
credentials so how do we set this up so
1:15
uh this I'm going to delete this one
1:18
so um we need to add a connection you
1:22
can see I have some connections here um
1:26
we need to click on ADD and here we need
1:31
these uh data that's required for the
1:35
sake of this video I'm going to show you
1:36
how to connect to uh Google Cloud
1:41
console and I'm going to create a new
1:45
this and it's going to be my Js
1:51
project and in this video I'm going to
1:54
just show you how to make the
1:57
authorization so you can use a Google
1:59
Google apis using this authorization
2:03
method because many of the uh Google
2:06
apis require you to authorize with
2:09
allout 2 instead of API key so basically
2:14
what we're going to do
2:16
now uh here is the JS timates project
2:19
and we're going to head to
2:22
dashboard and we're going to enable
2:32
we wait for the enable wait while it
2:35
enables and we're going to open the
2:44
documentation okay so we're going to
2:47
credentials and here we have our allout
2:51
to client IDs we don't have any but
2:54
we're going to create one so we click on
2:56
create credentials create all out client
3:01
ID uh before we do that we need to
3:03
configure our consent
3:08
screen so this will be external we're
3:12
going to click on Create and app name is
3:19
AdSense and I'm going to use my email
3:21
for support nothing here nothing here
3:24
and for the authorized domains we're
3:28
make.com and and also integr
3:35
mod.com it's the old make.com domain but
3:38
they still use it so we need to add that
3:41
and the developer contact information
3:44
this is mandatory it's going to be JS
3:47
automates gmail.com it's my email so if
3:50
you want to contact me use this email
3:54
continue um okay so now we need to add
3:58
Scopes uh um here we click on ADD Scopes
4:02
and we're going to search for
4:10
Scopes so we're going to enable both of
4:18
Scopes and we're going to click on Save
4:21
continue uh we need to add a test User
4:38
continue and that's it about this part
4:42
we're going to head back to dashboard
4:44
and we're going to create now our
4:46
credentials so click on create
4:48
credentials click on allout client ID
4:51
application will be web application and
4:54
the name will be JS automates
4:58
again we are doing this everything this
5:01
so we can get the data for all that we
5:08
so we need to add authorized redirect
5:12
URLs so here we need to add the
5:17
URLs I have them in my notepad I will
5:23
post them in the video description as
5:25
well so I'm going to copy one by one
5:35
create okay so these are my client IDs
5:38
and client secret I will delete these
5:40
anyway so I just don't want to bother
5:45
um closing them for this
5:49
video as you can see I don't create any
5:51
API keys because I will be using all to
5:55
authorization method so next we're going
6:00
now uh we need authorization authorize
6:04
URL and token URL and then we can add a
6:08
scope client ID client secret and Etc so
6:12
we're going to start with client ID this
6:17
one and client secret is this
6:21
one okay so we now need to add
6:25
authorized URL I have this also copied
6:28
out so this is this one
6:34
Etc and the token URL
6:40
one okay so here we're going to add a
6:42
scope and this one will be for
6:46
AdSense okay and the scope separator is
6:50
space and we click save uh we just going
6:54
to name this JS automates AdSense
7:00
now it's going to open
7:03
this uh signin uh window and I'm going
7:10
email and it asks me to verify this from
7:14
my phone so I will do that
7:21
now okay and now I'm going to click on
7:29
okay so we have established our
7:31
connection and now we can make a uh a
7:35
regular API call we you have the same
7:37
methods as like for example if we make
7:40
an API call with an API key we make we
7:44
use uh make a request
7:51
um here we set the target URL of the API
7:56
uh we choose the method and we add our
7:59
API key in the header and in the body we
8:03
usually use Json and make the request so
8:07
this module uses our Google allout to
8:12
connection so we don't use any API Keys
8:15
we use um password protected connection
8:21
with the API I hope you find this
8:24
helpful as soon I will be uploading uh a
8:28
detailed video about is uh to show you
8:30
how it works in a real life
8:34
automation just this is just a simple
8:37
overview of how you can establish the
8:40
all2 connection if you find the video
8:42
useful please like it uh subscribe to
8:45
the channel for more videos like this
8:48
and I hope you have a great day and see
8:49
you in the next video thank you for