Forum Discussion
Rest API Error:"The parameter Members does not exist in method AddTenantTheme"
Using the following code.
$colorPairs = @{
"themePrimary" = "#003538";
"themeLighterAlt" = "#cbe6e7";
"themeLighter" = "#a1cfd1";
"themeLight" = "#7cb8bb";
"themeTertiary" = "#5ba2a5";
"themeSecondary" = "#3f8c90";
"themeDarkAlt" = "#28767a";
"themeDark" = "#166064";
"themeDarker" = "#094b4e";
"neutralLighterAlt" = "#f8f8f8";
"neutralLighter" = "#f4f4f4";
"neutralLight" = "#eaeaea";
"neutralQuaternaryAlt" = "#dadada";
"neutralQuaternary" = "#d0d0d0";
"neutralTertiaryAlt" = "#c8c8c8";
"neutralTertiary" = "#98a9da";
"neutralSecondary" = "#4863b4";
"neutralPrimaryAlt" = "#113191";
"neutralPrimary" = "#002081";
"neutralDark" = "#001963";
"black" = "#001249";
"white" = "#ffffff";
}
$content = @{
"name" = "MyCustomTheme"
"themeJson" = $jsonBody
} | ConvertTo-Json
$apiUrl = "https://<<domain>>-admin.sharepoint.com/_api/thememanager/AddTenantTheme"
Invoke-PnPSPRestMethod -Url $apiUrl -Method "Post" -Content $content
Tried many different combinations but kept getting
Invoke-PnPSPRestMethod: {"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The parameter Members does not exist in method AddTenantTheme."}}}
Wondering if somebody can run this code successfully and let me know what I am missing.