Hello SAS community, I am trying to create folder authorization rules with PROC HTTP by requesting the SAS Viya REST API. But I keep getting a '400 Bad Request'. My reference source is a Python script - link. I can create folders and usergroups with the REST API. How can I get this patch request working without Pyhton or CLI? %let base_url = https://%scan(&_baseurl.,2,"/");
%put &base_url.;
filename input temp;
filename output temp ;
filename header temp;
proc stream outfile=input; begin &streamdelim;
[
{
"op":"add",
"value": {
"description": "test",
"objectUri":"/folders/folders/c7496325-eabf-474b-a499-e9de0ae5a6a1",
"permissions":["read", "update","secure","add","remove"],
"principalType":"group",
"principal":"test",
"type":"grant"
}
},
{
"op":"add",
"value": {
"description": "test",
"containerUri":"/folders/folders/c7496325-eabf-474b-a499-e9de0ae5a6a1",
"permissions":["read", "update","delete","add","remove"],
"principalType":"group",
"principal":"test",
"type":"grant"
}
}
]
;;;;
proc http url="&base_url/authorization/rules"
oauth_bearer=sas_services
out=output
in=input
headerout=header
method=patch;
debug level = 2;
headers
"Accept"="application/vnd.sas.collection+json"
"Content-Type"="application/json-patch+json";
run; response: {
"errorCode": 0,
"message": "Unable to parse valid patch operations from provided patch.",
"details": [
"traceId: 0c972600186e4596",
"path: /authorization/rules"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
... View more