Hi @Rachid B
Please use the following troubleshooting steps and diagnostics to check your access to the SharePoint site:
"Access Denied" or "You need permission to access this site" errors in SharePoint Online and OneDrive for Business
The user account that you are trying to make a REST API call with must have read permission to the entire site.
------------------------------------------
If this is helpful please accept answer.