43 %macro mv_getgroupmembers(group
44 ,access_token_var=ACCESS_TOKEN
45 ,grant_type=sas_services
46 ,outds=work.viyagroupmembers
49 %
if &grant_type=detect %then %
do;
50 %
if %symexist(&access_token_var) %then %let grant_type=authorization_code;
51 %
else %let grant_type=sas_services;
53 %
if &grant_type=sas_services %then %
do;
54 %let oauth_bearer=oauth_bearer=sas_services;
55 %let &access_token_var=;
57 %put &sysmacroname: grant_type=&grant_type;
58 %mp_abort(iftrue=(&grant_type ne authorization_code and &grant_type ne password
59 and &grant_type ne sas_services
62 ,msg=%str(Invalid value
for grant_type: &grant_type)
65 options noquotelenmax;
68 %let base_uri=%mf_getplatform(VIYARESTAPI);
72 %let fname1=%mf_getuniquefileref();
73 proc http method=
'GET' out=&fname1 &oauth_bearer
74 url=
"&base_uri/identities/groups/&group/members?limit=10000";
76 %
if &grant_type=authorization_code %then %
do;
77 "Authorization"=
"Bearer &&&access_token_var"
79 "Accept"=
"application/json";
82 %
if &SYS_PROCHTTP_STATUS_CODE=404 %then %
do;
83 %put NOTE: Group &group not found!!;
86 call missing(of _all_);
90 %mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 200)
92 ,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
94 %let libref1=%mf_getuniquelibref();
95 libname &libref1 JSON fileref=&fname1;
100 libname &libref1 clear;
104 filename &fname1 clear;