BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jcawesome
Obsidian | Level 7

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"

https://documentation.sas.com/?docsetId=bimtag&docsetVersion=9.4&docsetTarget=n0k64m6cvfcvy1n181b3cw...

 

Here's a sample screenshot of the Error I encounter below:

ERROR_authentication.png

 

 

 

 

 

 

 

 

 

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jcawesome
Obsidian | Level 7

Hi All,

 

I figured out the solution to this problem in this SAS Communities Post:

https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-...

 

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

View solution in original post

3 REPLIES 3
jcawesome
Obsidian | Level 7

Hi All,

 

I figured out the solution to this problem in this SAS Communities Post:

https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-...

 

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

JamesAnderson
SAS Employee

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.

DS API Requests.PNG

Setup an Environment in postman to set some variables to parameterise (but strictly speaking this is optional)

Environment_2.png

Then use the "Get TGT" to authenticate with /SASLogon:

Get TGT.PNG

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:

Set Location_1.PNG

 

Set Location_2.PNG

and we get back a ST in the response

Set Location_3.PNG

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.

List_1.PNG

remember to include a referrer:

 

List_2.PNG

 

And then in the response body you will see a list of RTDM Decision Variables:

response.PNG

 

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

jcawesome
Obsidian | Level 7

Thanks @JamesAnderson . It's working now.

 

The screenshots and the step by step approach helped me find what I was looking for.

 

Regards,

JC