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

Hello,

I am using PROC HTTP to extract the groups from Viya. This appears to work well however I cannot find any documentation to determine the correct content-type header information (I believe this may be undocumented). I have determined that the endpoint is '../identities/groups' and when I examine the text being returned I can see all the groups. What I cannot determine is the custom content-type being returned - this is an excerpt from the results - 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><collection accept="application/vnd.sas.identity.group.summary" count="574" l
imit="50" name="groups" start="0" version="2"><items><groupSummary version="1"><links><link href="/identities/groups/SASAdministrato
rs" method="GET" rel="self" type="application/vnd.sas.identity.group" uri="/identities/groups/SASAdministrators"/><link href="/ident
ities/groups/SASAdministrators" method="GET" rel="alternate" type="application/vnd.sas.identity.group.summary" uri="/identities/grou
ps/SASAdministrators"/><link href="/identities/groups/SASAdministrators" method="DELETE" rel="delete" uri="/identities/groups/SASAdm
inistrators"/><link href="/identities/groups/SASAdministrators" method="PUT" rel="update" type="application/vnd.sas.identity.group"
uri="/identities/groups/SASAdministrators"/>
 
Can anyone help me specify the correct content type (e.g. Accept:"="application/vnd.sas.identity.group")? 
 
I realize that there are CLI commands for this, I may resort to using those, however this is puzzling me. Any help appreciated!
 
regards, 
 
Richard
 
 
 
 
 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
AllanBowe
Barite | Level 11

Hi Richard,

We formulated a macro for this in the @sasjs/core library you can find the documentation here:  https://core.sasjs.io/mv__getgroups_8sas.html

 

/Allan

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

View solution in original post

3 REPLIES 3
joeFurbee
Community Manager

Hi @RichardP,

Nice detective work. You are correct that the identities API is not documented publicly on developer.sas.com. That could change at some point, but not sure if/when.

 

You've also discovered that you can deconstruct certain CLI calls and work backwards to build API endpoints. This is not supported by SAS Tech Support, but since you've gotten this far, I've confirmed what you see in the XML response. Here is a little more detail on the endpoint:

groups GET Link to return a collection of groups.
    URI: /identities/groups
    Response type: application/vnd.sas.collection
    Response item type: application/vnd.sas.identity.group.summary
    Response item type: application/vnd.sas.identity.basic

 

I hope this helps clear things up.


Join us for SAS Community Trivia
SAS Bowl XLVI, Causal Analysis
Wednesday, December 18, 2024, at 10 a.m. ET | #SASBowl

AllanBowe
Barite | Level 11

Hi Richard,

We formulated a macro for this in the @sasjs/core library you can find the documentation here:  https://core.sasjs.io/mv__getgroups_8sas.html

 

/Allan

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
RichardP
Quartz | Level 8

The answer in this case was to specify the correct header code -

headers "Accept"="application/json";

Thanks to the ever dependable gentlemen - @joeFurbee and @AllanBowe 

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!

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
  • 3 replies
  • 2544 views
  • 5 likes
  • 3 in conversation