Hi,
I am encountering an issue when trying to fetch data from my Definitionl and Definitionc collections using the Directus API.
I have an API token with read access to these collections, but when I make requests to the following endpoints: http://0.0.0.0:8055/items/Definitionl and http://0.0.0.0:8055/items/Definitionc, I receive a 403 Forbidden error with the message "You don't have permission to access this." Here is the code I am using for making requests:
“ async function fetcher(url) { const response = await fetch(url, { headers: { 'Authorization': process.env.NEXT_PUBLIC_API_TOKEN, }, }); const data = await response.json(); return data.data; }“
I have double-checked the API URL and token, and they appear to be correct. I can successfully fetch data from other collections such as Categorie and Concept using the same method. I have also tried accessing the endpoints using Postman with the same API token, but I still get the 403 Forbidden error.
I have reviewed the Directus logs, but I have not found any additional information that could help me understand the cause of the issue. My API token has the necessary read permissions for the Definitionl and Definitionc collections, so I am not sure why I am still encountering this error.
Could anyone please help me understand what might be causing this issue and how to resolve it? Any assistance would be greatly appreciated.
Thank you in advance!