When I execute: curl -X GET -H "OCS-APIRequest:true" -v http://admin:admin@localhost/nextcloud/index.php/apps/groupfolders/folders to returns a list of call configured folders and their settings, I get “CSRF check failed”
I believe you need to use your FQDN instead of “localhost” for your request.
curl -X GET -H “OCS-APIRequest:true” -v http://admin:admin@sub.domain.tld/nextcloud/index.php/apps/groupfolders/folders
But, for example, curl -X POST -H "OCS-APIRequest:true" -v http://admin:admin@localhost/nextcloud/ocs/v1.php/cloud/groups -d groupid="groupname" works for me.