Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCS API calls to standard endpoint /ocs/v1.php/cloud/apps/groupfolders do not work #1019

Closed
zmoras opened this issue Aug 24, 2020 · 7 comments
Labels
0. Needs triage Issues that need to be triaged bug feature: api Items related to the (OCS) API technical debt

Comments

@zmoras
Copy link

zmoras commented Aug 24, 2020

Hi,
I'm trying to call API endpoint:
curl -u users:pass -X GET URL/ocs/v1.php/cloud/apps/groupfolders/folders -H "OCS-APIRequest: true"
Response is:

<ocs>
  <meta>
    <status>failure</status>
    <statuscode>998</statuscode>
    <message>Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services.
</message>
  </meta>
  <data/>
</ocs>

Groupfolders are enabled:
curl -u users:pass -X GET URL/ocs/v1.php/cloud/apps/groupfolders -H "OCS-APIRequest: true"

<ocs>
  <meta>
    <status>ok</status>
    <statuscode>100</statuscode>
    <message>OK</message>
    <totalitems></totalitems>
    <itemsperpage></itemsperpage>
  </meta>
  <data>
    <id>groupfolders</id>
    <name>Group folders</name>
    <summary>Admin configured folders shared with everyone in a group</summary>
    <description>Admin configured folders shared with everyone in a group.

Folders can be configured from *Group folders* in the admin settings.

After a folder is created, the admin can give access to the folder to one or more groups, control their write/sharing permissions and assign a quota for the folder.

Note: encrypting the contents of group folders is currently not supported.</description>
    <version>7.0.0</version>
    <licence>agpl</licence>
    <author>Robin Appelman</author>
    <namespace>GroupFolders</namespace>
    <types>
      <element>filesystem</element>
      <element>dav</element>
    </types>
    <category>files</category>
    <website>https://github.com/nextcloud/groupfolders</website>
    <bugs>https://github.com/nextcloud/groupfolders/issues</bugs>
    <repository value="https://github.com/nextcloud/groupfolders.git"/>
    <screenshot>
      <element>https://raw.githubusercontent.com/nextcloud/groupfolders/master/screenshots/folders.png</element>
      <element>https://raw.githubusercontent.com/nextcloud/groupfolders/master/screenshots/edit.png</element>
      <element>https://raw.githubusercontent.com/nextcloud/groupfolders/master/screenshots/permissions.png</element>
    </screenshot>
    <dependencies>
      <nextcloud/>
    </dependencies>
    <background-jobs>
      <job>OCA\GroupFolders\BackgroundJob\ExpireGroupVersions</job>
    </background-jobs>
    <commands>
      <element>OCA\GroupFolders\Command\ExpireGroupVersions</element>
      <element>OCA\GroupFolders\Command\ListCommand</element>
      <element>OCA\GroupFolders\Command\ACL</element>
      <element>OCA\GroupFolders\Command\Quota</element>
      <element>OCA\GroupFolders\Command\Group</element>
      <element>OCA\GroupFolders\Command\Create</element>
      <element>OCA\GroupFolders\Command\Rename</element>
      <element>OCA\GroupFolders\Command\Delete</element>
      <element>OCA\GroupFolders\Command\Scan</element>
    </commands>
    <settings>
      <admin>
        <element>OCA\GroupFolders\Settings\Admin</element>
      </admin>
      <admin-section>
        <element>OCA\GroupFolders\Settings\Section</element>
      </admin-section>
      <personal/>
      <personal-section/>
    </settings>
    <sabre>
      <plugins>
        <plugin>OCA\GroupFolders\DAV\ACLPlugin</plugin>
      </plugins>
    </sabre>
    <trash>
      <backend value="OCA\GroupFolders\Trash\TrashBackend"/>
    </trash>
    <versions>
      <backend value="OCA\GroupFolders\Versions\VersionsBackend"/>
    </versions>
    <info/>
    <remote/>
    <public/>
    <repair-steps>
      <install/>
      <pre-migration/>
      <post-migration/>
      <live-migration/>
      <uninstall/>
    </repair-steps>
    <two-factor-providers/>
    <activity>
      <filters/>
      <settings/>
      <providers/>
    </activity>
  </data>
</ocs>

Any clues?

@jurgenhaas
Copy link

Same issue here. I've also tried /ocs/v2.php/apps/groupfolders/api/v1/folders and /ocs/v2.php/apps/groupfolders/folders, but none of them work.

@reimh
Copy link

reimh commented Oct 14, 2020

Hello,
not use "ocs/v1.php/cloud/". Try: https://nextcloud.mydomain.com/index.php/apps/groupfolders/folders

@jurgenhaas
Copy link

That doesn't work, it returns access denied with message CSRF check failed.

@aqos156
Copy link

aqos156 commented Feb 2, 2021

Try adding OCS-APIReqeust: true

curl -X GET -u user:passwrod https://cloud.exmaple.com/apps/groupfolders/folders -H "OCS-APIRequest: true"

FIxed the issue for me.

@pierreozoux pierreozoux added 0. Needs triage Issues that need to be triaged bug labels Mar 14, 2021
@pierreozoux pierreozoux added the feature: api Items related to the (OCS) API label Mar 28, 2021
@fschrempf
Copy link
Contributor

This PR #997 tries to solve this and once merged the OCS API calls to /ocs/v1.php/cloud/ should work as expected. Until then please use the URLs as pointed out above: #1019 (comment).

@fschrempf fschrempf changed the title API does not work OCS API calls to standard endpoint /ocs/v1.php/cloud/apps/groupfolders do not work Mar 31, 2021
@fschrempf fschrempf changed the title OCS API calls to standard endpoint /ocs/v1.php/cloud/apps/groupfolders do not work OCS API calls to standard endpoint /ocs/v1.php/cloud/apps/groupfolders do not work Mar 31, 2021
@bigcat88
Copy link
Member

Can we just duplicate current routes to the OCS routes?

Only the changes to routes.php required in this case I guess and it will be backward compatible?

@provokateurin
Copy link
Member

OCS API is available when #3182 is released. Proper OpenAPI documentation will follow with #3208.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Issues that need to be triaged bug feature: api Items related to the (OCS) API technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants