BookmarkSubscribeRSS Feed
SAS_Question
Quartz | Level 8

Hi all,

 

I want to test a REST-API via SAS EG (version 9.4m2, not 3 yet unfortunately!!!)

So what I did is the folowing: 

(and sorry for censoring the link and tokens, as I can not share those!) 

 

filename resp "p:\temp\TestAPI.txt";
filename hdrs "p:\temp\HeadAPI.txt";

data _null_;
	file hdrs;
        put "Authorization: Bearer [MyTOKEN key here]";
        put "Accept: application/json";
        put "Accept-Language: nl";
run;

proc http 
	url='https://[censored]/api/2.0/'
	method="GET"
	headerin=hdrs
	out=resp;
run;

But all I get is the homepage in html code in the resp file...? 

What I'm doing wrong here? Can someone help please? 

 

Thanks in advance! 

 

2 REPLIES 2
SAS_Question
Quartz | Level 8

Hi Jos,

 

Thanks for your reply, and sorry for my late reaction. Was ill for a long time. 

Anyway. We filed for a new version of SAS where the calling of an API is much more simpler then with this old version of us. 

So will keep you informed when we get this to work with the new version. 

 

Thanks for now! 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 950 views
  • 1 like
  • 2 in conversation