I am currently encountering an issue with the Senaite JSON API where I am unable to retrieve the portal object. Specifically, when I attempt to interact with the API, I receive the following error message:
json
{
"_runtime": 0.000879043069458007,
"message": "Unable to get the portal object. More info on http://docs.plone.org/develop/plone.api/docs/api/exceptions.html#plone.api.exc.CannotGetPortalError",
"success": false
}
I have followed the documentation and attempted to debug the instance using ./bin/instance -O Plone debug, but I have been unable to resolve the issue. Here are a few more details about my environment:
Senaite Version: 2.6.0 (running in Docker)
Plone: Installed within the Senaite instance
Accessing API URL: http://------/@@API/senaite/v1/client
I have confirmed that the API is active, and other basic routes like the version check are working correctly. However, whenever I try to access specific portal data like /client or /analysisrequest, I encounter this “CannotGetPortalError.”
I’ve made sure to check for user permissions, and I also tried using the debug shell in Zope but was unable to get the correct portal object using the methods I found online.
Could someone kindly guide me on what steps I should take to resolve this issue? Any assistance or advice would be greatly appreciated.
Yes that works thank you very much. One last thing if you could help me out, im trying to create a client with this : curl -u francois:12345 \ -X POST http://localhost:8080/senaite/@@API/senaite/v1/clientfolder/200fc376d6ed4069a0715847c411b3a5 \ -H "Content-Type: application/json" \ -d '{ "portal_type": "Client", "id": "client-002", "title": "Farm Fresh Foods", "ClientID": "FARM002", "EmailAddress": "contact@farmfresh.com", "Phone": "+123456789", "ClientContact": "Anna Green" }'
Blockquote
{“_runtime”: 0.0018270015716552734, “message”: “API has no member named ‘None_items’”, “success”: false}zope@SenaiteVM:~$