I am getting errors using the new POST /api.ashx/v3/permissions endpoint.
Documentation: https://community.telligent.com/community/11/w/api-documentation/67092/set-permission-v3-rest-endpoint
Here is an example call...
curl https://mysite.net/api.ashx/v3/permissions.json \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Rest-User-Token: ENCODED_TOKEN' \ -d 'IsAllowed=True&RoleId=1889&PermissionId=fd61ae45-30c5-4b04-92c4-9c6ec2fe1c90&GroupId=301'
The RoleID and GroupId have been triple checked, and I do get results when calling the GET /api.ashx/v3/permissions endpoint with these values.
The PermissionId "fd61ae45-30c5-4b04-92c4-9c6ec2fe1c90" is for "Read Group".
The result is the following message...
{
"Permission": null,
"Errors": [
"An unexpected error prevented your requested action from completing. The error has been logged for the administrator to review."
]
}
And the exception log provides this message...
System.InvalidOperationException: Nullable object must have a value.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at Telligent.Evolution.Rest.Implementation.Resources.PermissionsRestRoutePlugin.SetPermission(IRestRequest request)
The error indicates a missing value, but the only other documented parameter is ApplicationId, and the API still throws the same error even when a value is provided for that (along with an Application specific permissionID).
Any ideas? Is this a bug, or a documentation error, or am I missing something?
Also... I noticed that there doesn't seem to be a Widget API equivalent to this API. Is that something that is planned?
Thanks.