Hi anonymous user ,
First we should confirm the permission to the list in the following link
https://YourSharePointOnlineSiteUrl/_layouts/15/appinv.aspx
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
</AppPermissionRequests>
Then create and click trust it
Please check the steps in following link in register app
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
We can get Tenant ID in following url
https://YourSPOSiteURL/_vti_bin/client.svc/
The id marked with blue is Tenant ID in the picture.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.