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

Error while expanding folders for the sharepoint library #645

Open
masics opened this issue Feb 5, 2023 · 2 comments
Open

Error while expanding folders for the sharepoint library #645

masics opened this issue Feb 5, 2023 · 2 comments
Labels

Comments

@masics
Copy link

masics commented Feb 5, 2023

I get following error while executing:

folder: Folder = ctx.web.folders.get_by_path('My_Library')
ctx.load(folder, ["Folders"]).execute_query()

office365.runtime.client_request_exception.ClientRequestException: ('-1, Microsoft.Data.OData.ODataException', "Invalid JSON. A comma character ',' was expected in scope 'Object'. Every two elements in an array and properties of an object must be separated by commas.", '400 Client Error: Bad Request for url: https://mysharepoint.sharepoint.com/sites/MySite/_api/Web/folders/GetByPath(@v)?@v=%7B%22DecodedUrl%22:%20%22My_Library%22%7D?$expand=Folders')

The My_Library is a library created via Teams.

I cannot see My_Library when running code examples/sharepoint/folders/list_folders.py

What I could do to get list of folders?

@vgrem vgrem added the question label Feb 13, 2023
@vgrem vgrem added bug and removed question labels Mar 5, 2023
@vgrem
Copy link
Owner

vgrem commented Jul 1, 2023

Hi,

thank you for reporting this bug, it has been resolved in 2.4.2 version

@vgrem vgrem closed this as completed Jul 1, 2023
@melihsunbul
Copy link

Hey, I tried 2.4.2 version, but problem still occurs.

folder = ctx.web.folders.get_by_path("Shared Documents/Reports") role_def = ctx.web.role_definitions.get_by_type(RoleType.Contributor) group = ctx.web.site_groups.get_by_name("Demo Group").execute_query() folder.list_item_all_fields.add_role_assignment(group, role_def).execute_query()

Error traceback:
office365.runtime.client_request_exception.ClientRequestException: ('-1, Microsoft.Data.OData.ODataException', "Invalid JSON. A comma character ',' was expected in scope 'Object'. Every two elements in an array and properties of an object must be separated by commas."

@vgrem vgrem reopened this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants