Hi Experts,
I'm trying to use a GET method to access the variables collection of the Decision Services Admin for RTDM. The RTDM Administrator's Guide 6.5 (page 472) just mentions that authentication is required as seen below excerpt:
"The /variables collection represents all of the variables in the system.
The /variables collection has a GET method. The GET method requires authentication and has a request URL of GET "
I tried researching and couldn't find any direct results on how to go about this problem.
I tried searching online about the SAS Web Server Authentication but I don't know if this is the right reference guide for my problem or not since this one points to "/SASLogon/login" instead of "SASDecisionServicesAdministration/rest/variables"
Here's a sample screenshot of the Error I encounter below:
Any help to point to the right direction would be good.
Regards,
JC
P.S. I tried performing registration of client ID and secret for SAS Viya: Intelligent Decisioning. I got that to work mainly because of the available resources online to demonstrate how to do it.
Hi All,
I figured out the solution to this problem in this SAS Communities Post:
Once authentication is established the rest of the REST APIs to the SAS Decision Services Administration should be straightforward.
Here's another reference for those who wants to use SAS code instead of Postman:
https://support.sas.com/resources/papers/proceedings16/SAS6363-2016.pdf
Regards,
JC
Hi All,
I figured out the solution to this problem in this SAS Communities Post:
Once authentication is established the rest of the REST APIs to the SAS Decision Services Administration should be straightforward.
Here's another reference for those who wants to use SAS code instead of Postman:
https://support.sas.com/resources/papers/proceedings16/SAS6363-2016.pdf
Regards,
JC
Hi @jcawesome,
You need to authenticate against the SAS Logon service - the same one that you enter a username and password into when accessing SAS Web App UIs, like CI Studio.
There are some good articles out there on how to do this:
This one focuses on using SAS PROC HTTP as the client rather than Postman, but the concepts are the same - and some good follow up conversation.
In summary the sequence is:
1. Get a "Ticket Granting Ticket" (TGT) from /SASLogon using a SAS metadata username and password.
2. Get a "Service Ticket" (ST) for a location within SAS Decision Services using the TGT from Step 1
3. Submit your SAS DS API request using the ST from Step 2.
Here are some screenshots from postman:
First is my collection with a set of requests to do Steps 1 - 3.
Setup an Environment in postman to set some variables to parameterise (but strictly speaking this is optional)
Then use the "Get TGT" to authenticate with /SASLogon:
This will return you a ticket.
Then we need to set the location of the API we want to use and request the Service Ticket (ST) for it:
and we get back a ST in the response
Now we can hit the Decision Services API using the ST. If you want to request different RTDM objects (decision flows, activities etc) you can use the different location in the request above based upon the correct endpoint from the documentation.
remember to include a referrer:
And then in the response body you will see a list of RTDM Decision Variables:
From here you can then use different requests to update variable values.
Attached is the Postman collection and environment I used for this (rename then to json to import into Postman).
Hope that helps.
Cheers
James
Thanks @JamesAnderson . It's working now.
The screenshots and the step by step approach helped me find what I was looking for.
Regards,
JC
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!