I followed this tutorial [https://blog.vgrem.com/2015/01/27/consuming-the-sharepoint-online-rest-api-from-powershell-part-2/][1]
The above link showed how to get the token and how to call the rest API in SharePoint online using powershell, but the problem is. I am getting a
403 Forbidden error when the endpoint is
$WebUri = "https://mycustomname.sharepoint.com"
$endpointUri = "$WebUri/sites/VirtualName/_api/web/lists/getbytitle('$ListTitle')"
When I changed the endpoint to the below I get 401 Unauthorized
$endpointUri = "$WebUri/sites/VirtualName/lists/getbytitle('$ListTitle')"
The permission XML I tried a few different links int he scope but nothing helped. Appdomain - localhost Redirect URl - https://mycustomname.sharepoint.com/sites/VirtualName
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="https://mycustomname.sharepoint.com/sites/VirtualName/Lists/mylistname"
Right="Manage" />
</AppPermissionRequests>
Any help will be greatly appreciated.
