-
Notifications
You must be signed in to change notification settings - Fork 23
Description
First, this would be what's considered a valid request body to hit the PUT /beta/entitlements/:id/entitlement-request-config endpoint
{
"accessRequestConfig": {
"requestCommentRequired": false,
"denialCommentRequired": false,
"reauthorizationRequired": false,
"approvalSchemes": [
{
"approverId": "7a1eedb9-8882-4789-918f-aae88c4a4eb2",
"approverType": "GOVERNANCE_GROUP"
}
]
},
"revocationRequestConfig": {
"approvalSchemes": []
}
}Per the reference docs, it says as much
$EntitlementRequestConfig = @"{
"accessRequestConfig" : {
"denialCommentRequired" : false,
"approvalSchemes" : [ {
"approverId" : "e3eab852-8315-467f-9de7-70eda97f63c8",
"approverType" : "GOVERNANCE_GROUP"
}, {
"approverId" : "e3eab852-8315-467f-9de7-70eda97f63c8",
"approverType" : "GOVERNANCE_GROUP"
} ],
"reauthorizationRequired" : false,
"requestCommentRequired" : true
},
"revocationRequestConfig" : {
"approvalSchemes" : [ {
"approverId" : "e3eab852-8315-467f-9de7-70eda97f63c8",
"approverType" : "GOVERNANCE_GROUP"
}, {
"approverId" : "e3eab852-8315-467f-9de7-70eda97f63c8",
"approverType" : "GOVERNANCE_GROUP"
} ]
}
}"@The reference doc also says you need to call ConvertFrom-JsonToEntitlementRequestConfig, however, that is building a request body for the PUT /access-request-config endpoint
What the documentation should actually be asking for is to call ConvertFrom-BetaJsonToEntitlementAccessRequestConfig . This is problematic as well because it expects you to give it the value of the property accessRequestConfig like this
{
"requestCommentRequired": false,
"denialCommentRequired": false,
"reauthorizationRequired": false,
"approvalSchemes": [
{
"approverId": "7a1eedb9-8882-4789-918f-aae88c4a4eb2",
"approverType": "GOVERNANCE_GROUP"
}
]
}When it actually sends the request via Send-BetaEntitlementRequestConfig, it's only sending that accessRequestConfig instead of the whole thing (like the JSON at the top) and you get a 400 as a result
{
"messages": [
{
"localeOrigin": "DEFAULT",
"locale": "en-US",
"text": "Required field \"accessRequestConfig\" was missing or empty."
},
{
"localeOrigin": "REQUEST",
"locale": "en-US",
"text": "Required field \"accessRequestConfig\" was missing or empty."
}
],
"trackingId": "7d6e77b4767a47c1939a9398ed10401e",
"detailCode": "400.1.0 Required data missing or empty"
}