BookmarkSubscribeRSS Feed

On Demand Webinar: Using SAS APIs

Started ‎05-14-2020 by
Modified ‎05-14-2020 by
Views 9,487

In case you missed our live webinar "Using SAS APIs". Don't worry. You can watch the recording right now.  

 

Watch the webinar

 

In this article you'll find a summary of the session, attached copy of the slides presented, and an extended Q&A wrap up.

 

About this session

Unbeknownst to many people, the world is running on APIs. From web and mobile apps, to buttons, badges and widgets, and even physical devices like thermostats, smoke detectors, cars and glasses, they all depend on APIs to 'talk' to other systems. This is also the case for software for analytics, report building, and model management.

 

SAS has APIs to help integrate open source technologies and languages to perform analytics and create applications. In this webinar you will learn how to interact with SAS Viya and CAS REST APIs to create and access SAS resources using any client technology. We’ll also explore the roles that developer.sas.com and GitHub can play, as well as resources to find more information, like API documentation, SAS Communities and blog posts.

 

Q&A from the webinar

How do you get AUTH key to connect to SAS/VIYA for Postman?

To connect to SAS from Postman (or other clients) you need an access token. I wrote about authentication in my blog post Authentication to SAS Viya: a couple of approaches. You can also refer to the documentation on developer.sas.com.

 

In my specific examples in Postman, I use a Pre-request script in Postman to obtain the access token in the ‘createCASSession’ REST call. I store the token in an environment variable and reused the token on subsequent calls. To see the full code, access the entire Postman collection on GitHub.

 

I am a SAS programmer. I have a website for volunteer work. I would like to load the volunteer opportunities on the website via SAS. Can you give me direction?

There are multiple ways to integrate SAS into your web site. Using PROC HTTP is my suggestion on where to start. This is a popular, well documented procedure in SAS. You can learn more on PROC HTTP on the documentation page, on the SAS blogs page, or in SAS Support Community articles and threads. Finally, here is a SAS Global Forum paper outlining the basics of PROC HTTP.

 

We try to integrate Micro Analytics Services (MAS) to JAVA. Is there a way to generate some JAVA classes based on the information about the interfaces?

I’d start by researching the SAS and Java integration page on developer.sas.com and the MAS REST API reference doc. In addition, you may find this paper useful: Developing and Deploying Java Applications Around SAS: What they didn't tell you in class.

 

If you can’t find what you need, or have more specific questions, I’d recommend posting them in the SAS Support Developers Community.

 

What would be the difference between using SAS Mobile SDK and SAS Viya REST API for a Corporate Mobile App?

The mobile SDKs (available for both Android and iOS) are specialized tools for mobile app development. The SDK provides the ability to build custom apps to include content from SAS Visual Analytics. As an SDK, the tool aggregates functionality and makes specific API calls.

 

You can learn more about the SDK on the Mobile SDK for Andioid and iOS page on developer.sas.com.

 

Must I use APIs to apply SAS models? Are there other ways to apply it?

SAS offers multiple approaches for the entire model management lifecycle. First, is the SAS Model Manager application, or it’s standalone version Open Model Manager. You can also use the APIs as documented on developer.sas.com. For an introduction to models and SAS I’d recommend this video on the SASUsers YouTube channel: How to Deploy Models in SAS.

 

SAS does not limit you to only deploying models developed in SAS. You can deploy models from other languages such as Python or R. We offer tools such as python-sasctl, which is a Python library specifically geared to model management.

 

Are these calls just applicable to SAS Viya and CAS or other SAS products?

The APIs we explored today were specific to SAS Viya; however, SAS offers a multitude of APIs available for use with SAS9 and other SAS products. The most widely used SAS9 API is SAS Integration Technologies. You can find a wealth of information on the documentation page, on SAS Support Communities, particularly this article: Create your own client apps using SAS Integration Technologies.

 

Also, the use of PROC HTTP allows you limitless interaction with other systems. You can learn more on PROC HTTP on the documentation page, on the SAS blogs page, or in SAS Support Community articles and threads. Further, here is a SAS Global Forum paper outlining the basics of PROC HTTP.

 

If you are more open source inclined, we offer the SASPy library on GitHub. SASPy is built for Python developers and creates a bridge between Python and SAS9. Also on GitHub, you can find the SAS Programming for R Users repository.

 

Are there any good SAS script resources to learn step-by-step?

If you are brand new to SAS, you can start with the links and resources on the Learn SAS page. I’d also recommend the New Users board on SAS Support Communities. Further, browse through the scores of videos on the SASUsers YouTube channel.

 

If you’re interested in learning more on SAS Viya and CAS REST APIs, I’d suggest starting on the REST APIs page on developer.sas.com. You’ll find general info and multiple links available.

 

I want a web application to call a SAS program in the backend, then get the SAS data set back, could I achieve this using the SAS Viya API or CAS API?

Absolutely. This is a prime use case for using SAS APIs and open source technologies. As I demonstrated today, you can use the documentation and supporting resources from developer.sas.com to build API calls. I used Postman for the demo, but you could use any application development technology that can make REST calls.

 

Depending on your preferences in technology (Python, R, JavaScript, NodeJS, .NET, etc.), SAS offers multiple options. Here is a great article on SAS and open source integration points. You create the application code and insert the API calls as needed.

 

If you're using SAS 9.4, you can wrap your SAS programs in a Stored Process and deploy as a RESTful web service. See the Stored Processes developer guide for more details.

 

How easy is it for base 9.4 SAS users to build the API? 

The APIs we explored today were specific to SAS Viya; however, SAS offers a multitude of APIs available for use with SAS9 and other SAS products. The most widely used SAS9 API is SAS Integration Technologies. You can find a wealth of information on the documentation page, on SAS Support Communities, particularly this article: Create your own client apps using SAS Integration Technologies.

 

Also, the use of PROC HTTP allows you limitless interaction with other systems. You can learn more on PROC HTTP on the documentation page, on the SAS blogs page, or in SAS Support Community articles and threads. Further, here is a SAS Global Forum paper outlining the basics of PROC HTTP.

 

If you are more open source inclined, we offer the SASPy library on GitHub. SASPy is built for Python developers and creates a bridge between Python and SAS9. Also on GitHub, you can find the SAS Programming for R Users repository.

 

Can SAS APIs only be used with Viya or can it be used with Enterprise Guide or Enterprise Miner or SAS Studio?

The APIs I demonstrated during the webinar were APIs available in SAS Viya only. Any client that can connect to an instance of Viya on the backend should be able to leverage these APIs however.

 

Where can I get a list of all API published SAS Model Manager ? {Ex: Register a Model, Publish a Model)

The available support APIs for SAS Model Manager can be found under the Decision Management section in the API reference documentation.

 

Is Postman a SAS product or open-source?

Postman is a separate company but they provide freemium tools for working with APIs (if you want the basics, they are free but if you want some of the cooler features you can pay for them). Refer to the Postman web site for more details.

Version history
Last update:
‎05-14-2020 09:01 AM
Updated by:
Contributors

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Article Tags