'MS Graph API - Access Sharepoint folder that contains spaces or special characters in path

I am trying to access a Sharepoint Online documents library through the Microsoft Graph API. It works fine until the folder path contains spaces or special characters.

Endpoint prefix is : https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}

I tried to replace the space character with %20, -, _, _x0020_ and + with no success. Also tried to put together the path between quotes just the same way you do in command prompt for space containing paths.

I also noticed that it won't work when the path contains non US-ASCII characters such as é à è and so on.

That will work :

GET /root:/parentfolder/childfolder:/children

That won't:

GET /root:/parentfolder/folder with spaces:/children

GET /root:/parentfolder/caractères-spéciaux:/children

I've been searching over the web with no luck.

Any idea?

Thanks



Solution 1:[1]

you can try auto-discovery using label based approach.

config:
filebeat.autodiscover:
 providers:
  - type: kubernetes
    hints.default_config.enabled: "false"
    templates:
      - condition.contains:
        kubernetes.labels.app: "apache"
    config:
    - module: apache
      access:
        enabled: true
        var.paths: ["/path/to/log/apache/access.log*"]
      error:
        enabled: true
        var.paths: ["/path/to/log/apache/error.log*"]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 r5a5m