BookmarkSubscribeRSS Feed
Obsidian | Level 7

Hi guys! I've tried to use proc http to call sas decision. It works well, but right now I need to specify access token myself. That means whenever the token gets changed, I need to edit my code. So the question is how can I retrieve the token from sas?


I generated sas token from the following link :


My code right now:

proc http 
METHOD="POST" url="mysasdecisionurl" in='{"inputs":[]}' ct = "" out=resp oauth_bearer = sas_services; headers 'Authorization'= "My token"; run;

I found some solution from this link : 

But it seems every time the code is executed, a new token will be generated. I just want to retrieve an old token, not to generate a new token.

Obsidian | Level 7

I'm also having the same problem. I would like to know how to use the authentication token that the user made to access SASStudio itself.

In other words, being able to authenticate to the Viya APIs with the user's own credentials logged into SAS Studio.

Obsidian | Level 7

If you don't want users to put token every time they want to access sas product like me, in my case I use this code :

filename resp "your json file";
%let url = %nrstr("your publish sas product");
/*$one_json is your input*/
%let one_json = '{"inputs":[{"name": " ", "value": " "},{"name": " ", "value":" "}]}';
proc http
	url = &url.
	in = &one_json.
	out = resp
	method = post
	oauth_bearer = sas_services
	ct = "application/";
/* read json and create it as a library named logdata */
libname logdata json "your json file";

 Or you can see my other blog: ( ). There is solution from DavidHD that might help you.


Hope it helps 🙂



Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.


Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 


Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2 in conversation