Skip to content

Sharing folder fails with shareType must be an integer error response #15839

Description

@dkocher

Relates to #15838. When connected to oCIS, sharing a folder with the request {"path":"/remote.php/webdav/d","shareType":3,"permissions":4} fails with response

HTTP/1.1 400 Bad Request
Content-Length: 160
Content-Type: text/xml; charset=utf-8
Date: Tue, 16 Apr 2024 08:59:11 GMT
Ocs-Api-Version: 2
Vary: Origin
X-Request-Id: bf1ed42bf42f/8qs05uaikb-002006

<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>400</statuscode><message>shareType must be an integer</message></meta></ocs>

Activity

  1. self-assigned this
    on Apr 16, 2024
  2. linked a pull request that will close this issueReview OCS extensions #15840on Apr 16, 2024
  3. micbar commented on Apr 18, 2024

    @micbar

    Can you post the request also?

  4. dkocher commented on Apr 19, 2024

    @dkocher
    ContributorAuthor

    @micbar Please find below a full request/response log

    POST /ocs/v1.php/apps/files_sharing/api/v1/shares HTTP/1.1
    OCS-APIRequest: true
    Accept: application/xml
    Content-Length: 42
    Content-Type: application/json; charset=UTF-8
    Host: ocis.ocis-keycloak.latest.owncloud.works
    Connection: Keep-Alive
    User-Agent: Cyberduck/8.8.3.41368 (Mac OS X/14.4.1) (aarch64)
    Accept-Encoding: gzip,deflate
    Authorization: Bearer ***
    
    {"path":"d","shareType":3,"permissions":4}
    
    
    HTTP/1.1 200 OK
    Content-Length: 160
    Content-Type: text/xml; charset=utf-8
    Date: Fri, 19 Apr 2024 11:12:50 GMT
    Ocs-Api-Version: 1
    Vary: Origin
    X-Request-Id: 3c9a7676557b/HgcReilixE-000556
    
    <?xml version="1.0" encoding="UTF-8"?>
    <ocs><meta><status>error</status><statuscode>400</statuscode><message>shareType must be an integer</message></meta></ocs>
    
  5. micbar commented on Apr 19, 2024

    @micbar

    You are sending a json body. That is not working on ocs. With our new libregraph sharing api, everything will be better 😄

    Valid OCS Request

    curl 'https://ocis.ocis-wopi.released.owncloud.works/ocs/v1.php/apps/files_sharing/api/v1/shares' \
      -H 'accept: */*' \
      -H 'accept-language: en' \
      -H 'authorization: Bearer <access-token>' \
      -H 'cache-control: no-cache' \
      -H 'content-type: application/x-www-form-urlencoded' \
      -H 'ocs-apirequest: true' \
      --data-raw $'shareType=0&shareWith=moss&path=%2FNew+folder&permissions=17&role=viewer'
  6. added a commit that references this issue on Apr 19, 2024
    96db7ef
  7. dkocher commented on Apr 19, 2024

    @dkocher
    ContributorAuthor

    With our new libregraph sharing api, everything will be better 😄

    Hopefully rather sooner than later as part of #14166.

  8. dkocher commented on Apr 19, 2024

    @dkocher
    ContributorAuthor

    Will have to make sure there is no regression for #13478.

  9. added 2 commits that reference this issue on Apr 19, 2024
    04b28bf
    39a2172
  10. dkocher commented on Apr 19, 2024

    @dkocher
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions