SAS is the leader in analytics. Through innovative analytics, BI and data management software and services, SAS helps turn your data into better decisions. A lot of organizations now use REST API to expose and consume data – and there are scenarios where we often see from time to time where they want to store this data coming from REST APIs to provide real time intelligence or analytics. The problem is each of these REST APIs are built differently – their authentication schemes differ, the response structures differ and when you want to bring in this data to SAS - which can be a lot of effort, that can be placed elsewhere.
With Progress DataDirect Autonomous REST Connector, you can connect to any REST API without you having to write a single line of code and be able to run SQL queries to access the data via SAS/ACCESS Interface to JDBC. In this tutorial we will show how you can use Autonomous REST Connector with SAS so that you can read any REST API. We will be using Yelp API as a part of this tutorial and use SSAS/ACCESS Interface to JDBC to read data from Yelp API using Autonomous REST Connector.
C:\Program Files\Progress\DataDirect\JDBC_60\lib\autorest.jar
jdbc:datadirect:autorest:sample=http://api.yelp.com/v3/businesses/search?location=27617;AuthenticationMethod=HttpHeader;AuthHeader=Authorization;SecurityToken='Bearer <
Your
API Key>'
4. When you connect to any REST API using Autonomous REST Connector, it will automatically sample the API and create a configuration, which you can access by querying the _CONFIGURATION table. You can get this configuration by using the Autonomous REST JDBC driver in any SQL querying tools like Dbeaver, Squirrel SQL etc.,
5.For the tutorial, I am providing this configuration here, download this config file from GitHub and save it as yelp.rest.
6. If you notice the configuration, you can notice that Autonomous REST Connector has detected all the objects, and their data types.
7. To learn more about Autonomous REST Connector and how you can configure it to your needs and to connect to multiple endpoints, we recommend you go through these tutorials after you have finished this one.
libname x jdbc driverclass=
"com.ddtek.jdbc.autorest.AutoRESTDriver"
URL=
"jdbc:datadirect:autorest:config=C:\Users\sbobba\Desktop\ARCConfigFiles\yelp.rest;databasename=yelp2w1q;authenticationMethod=HttpHeader;authheader=Authorization;SecurityToken='Bearer <Access Token>'"
classpath=
"C:\Users\sbobba\Downloads\Debug Drivers"
;
proc print data=x.businesses;
run;
With SAS/ACCESS Interface to JDBC, you can now connect to any of your internal/external REST API as easily as that. If you prefer using SAS/ACCESS for ODBC, we also have an ODBC offering of Progress Autonomous REST Connector, which you can download and try it for free. Not only you can connect to REST API’s using Progress DataDirect drivers, you can connect to sources such as MongoDB, DB2, Redshift, Oracle, SQL Server, Eloqua etc., Feel free to try any our JDBC drivers and if you have any questions, please contact us.