in previous video you learned how to create a data source or ODBC data source
using zappysys json driver and how to get json data from a file and a URL in
this part you will learn how to make how to use OAuth authentication when making
REST API calls but before going into that let me quickly overview and why so
that you can better understand it and use it so the first thing I guess one of
the most important is the data source name where you can enter data source
name and it will appear here under data sources then you have this tab
properties in preview in properties you can configure all the options for the
data source and in preview you can view you can execute the data source and get
the data then you have these two options simple view and advanced you basically
what it does is switches between user friendly UI the simple view where you
have all the text boxes list boxes tabs where you can conveniently set the
options and then you have this advanced view and advanced view is basically
if you wear you have all the options because in simple view not all options
are present of the datasource while in advance view all of them are present so
let's say for example log settings and log level in log file location is
present only in advance view and what also an advanced view what you can do is
search for an option and another nice thing is that you can view the
description of each property okay so let's go back to simple view and we are
ready to move with auth authentication so for this I prepared a simple scenario
where I have an online CRM tool named HubSpot I have an account and I have
many contacts which I want to import into an excel so one contact Perl is my
goal so to do that the first thing you need to do is open your API providers
documentation and look how you should authenticate that API so I found under
no authentication menu this link and I see that the HubSpot supports OAuth and
API keys sorry yeah earth as an authentication option and
API keys so API Keys is basically where you submit your API key together with
the URL or in HTTP headers but is it is some it is simple but is it is less
secure so we are going to use OAuth so for that
yeah you will need to find the first thing is authorization URL let me find
it here authorization yep so you will need to
use it in we have here connection types HTTP and off so we will be using OAuth
but before that let me quickly tell you that if you had basic authentication
basic HTTP authentication let's say username with password and or domain
with user and password so you could use HTTP connection manager but we're using
OAuth let us configure it here a window opens and then you have this or auth
provider and you should you and you should use it if you see so let's say
HubSpot is configured for us so basically it it nicely and very
conveniently hides us all the authorization and token urls we have to
configure so I suggest using this provider but for the sake of example I
will show you how to use a custom provider in case there is no provider
configured okay so let's paste in our authorization
URL here and then you have to to paste access
token URL so I find it under this menu
and they even have this sample request I can make so I just copy this URL here
okay now what we also need to configure is client ID and client secret so for
that we will need to go to our account and create an OAuth application so auth
application is basically identified by this client ID and so and client secret
is acts like a password for that of app so I created one already this demo app
so let me edit it so I will copy this client ID and client secret so basically
you should view or auth app application acting like a bridge between your data
and the application that will be using it so let's say I have my data these
contacts and the application which will be accessing this data will be this
zappysys json driver and it will access it through this or author application
that we are configuring now and this bridge basically lets you I mean you can
make that auth app that bridge wider or narrower and by configuring the scopes
and the scopes basically lets you configure what data you will allow to be
retrieved by that external application so in this case I want only in contacts
to be retrieved another thing useful thing should be is
that in some providers you will see a scope named offline access or refresh
token so you should use it because it will retrieve refresh token and the
Refresh token is a master key you can call it so a master token which will let
you issue access token so always check that scope to okay so okay so contacts
and I will need to enter the same scope here contacts if I used a predefined
provider there would be here select scopes button and I could select from
this list getting back to our custom and we are ready to generate token I am
selecting my account I want to access data from
and here the confirmation box tells me asks me if I want to save refresh token
and access token into some external file and I can do that if I am going to use
the same refresh token and access token in some other application rather than
zappysys json driver so I will press No this time clicking okay now I will need
so to get contacts I will need go back to my API documentation again and find
the URL to get those contacts I am again copying the link without the PII key
because I am using OAuth pasting in here testing the connection that connection
is okay I will do a little preview and the
contacts were retrieved not in a way we like currently but that's the first step
so basically this ends our authentication part and in the next part
we will cover the topic of how to get the results and paginate through them