{
  "schemaVersion": "1.0",
  "item": {
    "slug": "one-drive",
    "name": "Microsoft OneDrive",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/byungkyu/one-drive",
    "canonicalUrl": "https://clawhub.ai/byungkyu/one-drive",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/one-drive",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=one-drive",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/one-drive"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/one-drive",
    "agentPageUrl": "https://openagent3.xyz/skills/one-drive/agent",
    "manifestUrl": "https://openagent3.xyz/skills/one-drive/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/one-drive/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "OneDrive",
        "body": "Access the OneDrive API with managed OAuth authentication via Microsoft Graph. Manage files, folders, drives, and sharing with full CRUD operations."
      },
      {
        "title": "Quick Start",
        "body": "# List files in OneDrive root\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/one-drive/v1.0/me/drive/root/children')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Base URL",
        "body": "https://gateway.maton.ai/one-drive/v1.0/{resource}\n\nThe gateway proxies requests to graph.microsoft.com and automatically injects your OAuth token."
      },
      {
        "title": "Authentication",
        "body": "All requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key"
      },
      {
        "title": "Connection Management",
        "body": "Manage your OneDrive OAuth connections at https://ctrl.maton.ai."
      },
      {
        "title": "List Connections",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=one-drive&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Create Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'one-drive'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Get Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"3f17fb58-4515-4840-8ef6-2bbf0fa67e2c\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-07T08:23:30.317909Z\",\n    \"last_updated_time\": \"2026-02-07T08:24:04.925298Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"one-drive\",\n    \"metadata\": {}\n  }\n}\n\nOpen the returned url in a browser to complete OAuth authorization."
      },
      {
        "title": "Delete Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Specifying Connection",
        "body": "If you have multiple OneDrive connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/one-drive/v1.0/me/drive')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '3f17fb58-4515-4840-8ef6-2bbf0fa67e2c')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nIf omitted, the gateway uses the default (oldest) active connection."
      },
      {
        "title": "Drives",
        "body": "Get Current User's Drive\n\nGET /one-drive/v1.0/me/drive\n\nResponse:\n\n{\n  \"id\": \"b!F3Y7M0VT80OO9iu_D6Z-LA...\",\n  \"driveType\": \"personal\",\n  \"name\": \"OneDrive\",\n  \"owner\": {\n    \"user\": {\n      \"displayName\": \"John Doe\",\n      \"id\": \"d4648f06c91d9d3d\"\n    }\n  },\n  \"quota\": {\n    \"total\": 5368709120,\n    \"used\": 1234567,\n    \"remaining\": 5367474553\n  }\n}\n\nList User's Drives\n\nGET /one-drive/v1.0/me/drives\n\nGet Drive by ID\n\nGET /one-drive/v1.0/drives/{drive-id}"
      },
      {
        "title": "Files and Folders",
        "body": "Get Drive Root\n\nGET /one-drive/v1.0/me/drive/root\n\nList Root Children\n\nGET /one-drive/v1.0/me/drive/root/children\n\nResponse:\n\n{\n  \"value\": [\n    {\n      \"id\": \"F33B7653325337C3!s88...\",\n      \"name\": \"Documents\",\n      \"folder\": {\n        \"childCount\": 5\n      },\n      \"createdDateTime\": \"2024-01-15T10:30:00Z\",\n      \"lastModifiedDateTime\": \"2024-02-01T14:20:00Z\"\n    },\n    {\n      \"id\": \"F33B7653325337C3!s3f...\",\n      \"name\": \"report.pdf\",\n      \"file\": {\n        \"mimeType\": \"application/pdf\",\n        \"hashes\": {\n          \"sha1Hash\": \"cf23df2207d99a74fbe169e3eba035e633b65d94\"\n        }\n      },\n      \"size\": 35212\n    }\n  ]\n}\n\nGet Item by ID\n\nGET /one-drive/v1.0/me/drive/items/{item-id}\n\nGet Item by Path\n\nUse colon (:) syntax to access items by path:\n\nGET /one-drive/v1.0/me/drive/root:/Documents/report.pdf\n\nList Folder Children by Path\n\nGET /one-drive/v1.0/me/drive/root:/Documents:/children\n\nGet Item Children\n\nGET /one-drive/v1.0/me/drive/items/{item-id}/children"
      },
      {
        "title": "Special Folders",
        "body": "Access known folders by name:\n\nGET /one-drive/v1.0/me/drive/special/documents\nGET /one-drive/v1.0/me/drive/special/photos\nGET /one-drive/v1.0/me/drive/special/music\nGET /one-drive/v1.0/me/drive/special/approot"
      },
      {
        "title": "Recent and Shared",
        "body": "Get Recent Files\n\nGET /one-drive/v1.0/me/drive/recent\n\nGet Files Shared With Me\n\nGET /one-drive/v1.0/me/drive/sharedWithMe"
      },
      {
        "title": "Search",
        "body": "GET /one-drive/v1.0/me/drive/root/search(q='{query}')\n\nExample:\n\nGET /one-drive/v1.0/me/drive/root/search(q='budget')"
      },
      {
        "title": "Create Folder",
        "body": "POST /one-drive/v1.0/me/drive/root/children\nContent-Type: application/json\n\n{\n  \"name\": \"New Folder\",\n  \"folder\": {},\n  \"@microsoft.graph.conflictBehavior\": \"rename\"\n}\n\nCreate folder inside another folder:\n\nPOST /one-drive/v1.0/me/drive/items/{parent-id}/children\nContent-Type: application/json\n\n{\n  \"name\": \"Subfolder\",\n  \"folder\": {}\n}"
      },
      {
        "title": "Upload File (Simple - up to 4MB)",
        "body": "PUT /one-drive/v1.0/me/drive/items/{parent-id}:/{filename}:/content\nContent-Type: application/octet-stream\n\n{file binary content}\n\nExample - upload to root:\n\nPUT /one-drive/v1.0/me/drive/root:/document.txt:/content\nContent-Type: text/plain\n\nHello, OneDrive!"
      },
      {
        "title": "Upload File (Large - resumable)",
        "body": "For files over 4MB, use resumable upload:\n\nStep 1: Create upload session\n\nPOST /one-drive/v1.0/me/drive/root:/{filename}:/createUploadSession\nContent-Type: application/json\n\n{\n  \"item\": {\n    \"@microsoft.graph.conflictBehavior\": \"rename\"\n  }\n}\n\nResponse:\n\n{\n  \"uploadUrl\": \"https://sn3302.up.1drv.com/up/...\",\n  \"expirationDateTime\": \"2024-02-08T10:00:00Z\"\n}\n\nStep 2: Upload bytes to the uploadUrl"
      },
      {
        "title": "Download File",
        "body": "Get the file metadata to retrieve the download URL:\n\nGET /one-drive/v1.0/me/drive/items/{item-id}\n\nThe response includes @microsoft.graph.downloadUrl - a pre-authenticated URL valid for a short time:\n\n{\n  \"id\": \"...\",\n  \"name\": \"document.pdf\",\n  \"@microsoft.graph.downloadUrl\": \"https://public-sn3302.files.1drv.com/...\"\n}\n\nUse this URL directly to download the file content (no auth header needed)."
      },
      {
        "title": "Update Item (Rename/Move)",
        "body": "PATCH /one-drive/v1.0/me/drive/items/{item-id}\nContent-Type: application/json\n\n{\n  \"name\": \"new-name.txt\"\n}\n\nMove to different folder:\n\nPATCH /one-drive/v1.0/me/drive/items/{item-id}\nContent-Type: application/json\n\n{\n  \"parentReference\": {\n    \"id\": \"{new-parent-id}\"\n  }\n}"
      },
      {
        "title": "Copy Item",
        "body": "POST /one-drive/v1.0/me/drive/items/{item-id}/copy\nContent-Type: application/json\n\n{\n  \"parentReference\": {\n    \"id\": \"{destination-folder-id}\"\n  },\n  \"name\": \"copied-file.txt\"\n}\n\nReturns 202 Accepted with a Location header to monitor the copy operation."
      },
      {
        "title": "Delete Item",
        "body": "DELETE /one-drive/v1.0/me/drive/items/{item-id}\n\nReturns 204 No Content on success."
      },
      {
        "title": "Sharing",
        "body": "Create Sharing Link\n\nPOST /one-drive/v1.0/me/drive/items/{item-id}/createLink\nContent-Type: application/json\n\n{\n  \"type\": \"view\",\n  \"scope\": \"anonymous\"\n}\n\nLink types:\n\nview - Read-only access\nedit - Read-write access\nembed - Embeddable link\n\nScopes:\n\nanonymous - Anyone with the link\norganization - Anyone in your organization\n\nResponse:\n\n{\n  \"id\": \"...\",\n  \"link\": {\n    \"type\": \"view\",\n    \"scope\": \"anonymous\",\n    \"webUrl\": \"https://1drv.ms/b/...\"\n  }\n}\n\nInvite Users (Share with specific people)\n\nPOST /one-drive/v1.0/me/drive/items/{item-id}/invite\nContent-Type: application/json\n\n{\n  \"recipients\": [\n    {\"email\": \"user@example.com\"}\n  ],\n  \"roles\": [\"read\"],\n  \"sendInvitation\": true,\n  \"message\": \"Check out this file!\"\n}"
      },
      {
        "title": "Query Parameters",
        "body": "Customize responses with OData query parameters:\n\n$select - Choose specific properties: ?$select=id,name,size\n$expand - Include related resources: ?$expand=children\n$filter - Filter results: ?$filter=file ne null (files only)\n$orderby - Sort results: ?$orderby=name\n$top - Limit results: ?$top=10\n\nExample:\n\nGET /one-drive/v1.0/me/drive/root/children?$select=id,name,size&$top=20&$orderby=name"
      },
      {
        "title": "Pagination",
        "body": "Results are paginated. The response includes @odata.nextLink for additional pages:\n\n{\n  \"value\": [...],\n  \"@odata.nextLink\": \"https://graph.microsoft.com/v1.0/me/drive/root/children?$skiptoken=...\"\n}\n\nUse the full URL from @odata.nextLink (without the gateway prefix) to fetch the next page."
      },
      {
        "title": "JavaScript",
        "body": "// List files in root\nconst response = await fetch(\n  'https://gateway.maton.ai/one-drive/v1.0/me/drive/root/children',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\nconst data = await response.json();\n\n// Upload a file\nconst uploadResponse = await fetch(\n  'https://gateway.maton.ai/one-drive/v1.0/me/drive/root:/myfile.txt:/content',\n  {\n    method: 'PUT',\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`,\n      'Content-Type': 'text/plain'\n    },\n    body: 'Hello, OneDrive!'\n  }\n);"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\n# List files in root\nresponse = requests.get(\n    'https://gateway.maton.ai/one-drive/v1.0/me/drive/root/children',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\nfiles = response.json()\n\n# Upload a file\nupload_response = requests.put(\n    'https://gateway.maton.ai/one-drive/v1.0/me/drive/root:/myfile.txt:/content',\n    headers={\n        'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}',\n        'Content-Type': 'text/plain'\n    },\n    data='Hello, OneDrive!'\n)"
      },
      {
        "title": "Notes",
        "body": "OneDrive uses Microsoft Graph API (graph.microsoft.com)\nItem IDs are unique within a drive\nUse colon (:) syntax for path-based addressing: /root:/path/to/file\nSimple uploads are limited to 4MB; use resumable upload for larger files\nDownload URLs from @microsoft.graph.downloadUrl are pre-authenticated and temporary\nConflict behavior options: fail, replace, rename\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments"
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning400Missing OneDrive connection or invalid request401Invalid or missing Maton API key403Insufficient permissions404Item not found409Conflict (e.g., item already exists)429Rate limited (check Retry-After header)4xx/5xxPassthrough error from Microsoft Graph API"
      },
      {
        "title": "Error Response Format",
        "body": "{\n  \"error\": {\n    \"code\": \"itemNotFound\",\n    \"message\": \"The resource could not be found.\"\n  }\n}"
      },
      {
        "title": "Troubleshooting: API Key Issues",
        "body": "Check that the MATON_API_KEY environment variable is set:\n\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Troubleshooting: Invalid App Name",
        "body": "Ensure your URL path starts with one-drive. For example:\n\nCorrect: https://gateway.maton.ai/one-drive/v1.0/me/drive/root/children\nIncorrect: https://gateway.maton.ai/v1.0/me/drive/root/children"
      },
      {
        "title": "Resources",
        "body": "OneDrive Developer Documentation\nMicrosoft Graph API Reference\nDriveItem Resource\nDrive Resource\nSharing and Permissions\nLarge File Upload\nMaton Community\nMaton Support"
      }
    ],
    "body": "OneDrive\n\nAccess the OneDrive API with managed OAuth authentication via Microsoft Graph. Manage files, folders, drives, and sharing with full CRUD operations.\n\nQuick Start\n# List files in OneDrive root\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/one-drive/v1.0/me/drive/root/children')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nBase URL\nhttps://gateway.maton.ai/one-drive/v1.0/{resource}\n\n\nThe gateway proxies requests to graph.microsoft.com and automatically injects your OAuth token.\n\nAuthentication\n\nAll requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key\nConnection Management\n\nManage your OneDrive OAuth connections at https://ctrl.maton.ai.\n\nList Connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=one-drive&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nCreate Connection\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'one-drive'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nGet Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"3f17fb58-4515-4840-8ef6-2bbf0fa67e2c\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-07T08:23:30.317909Z\",\n    \"last_updated_time\": \"2026-02-07T08:24:04.925298Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"one-drive\",\n    \"metadata\": {}\n  }\n}\n\n\nOpen the returned url in a browser to complete OAuth authorization.\n\nDelete Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nSpecifying Connection\n\nIf you have multiple OneDrive connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/one-drive/v1.0/me/drive')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '3f17fb58-4515-4840-8ef6-2bbf0fa67e2c')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\nAPI Reference\nDrives\nGet Current User's Drive\nGET /one-drive/v1.0/me/drive\n\n\nResponse:\n\n{\n  \"id\": \"b!F3Y7M0VT80OO9iu_D6Z-LA...\",\n  \"driveType\": \"personal\",\n  \"name\": \"OneDrive\",\n  \"owner\": {\n    \"user\": {\n      \"displayName\": \"John Doe\",\n      \"id\": \"d4648f06c91d9d3d\"\n    }\n  },\n  \"quota\": {\n    \"total\": 5368709120,\n    \"used\": 1234567,\n    \"remaining\": 5367474553\n  }\n}\n\nList User's Drives\nGET /one-drive/v1.0/me/drives\n\nGet Drive by ID\nGET /one-drive/v1.0/drives/{drive-id}\n\nFiles and Folders\nGet Drive Root\nGET /one-drive/v1.0/me/drive/root\n\nList Root Children\nGET /one-drive/v1.0/me/drive/root/children\n\n\nResponse:\n\n{\n  \"value\": [\n    {\n      \"id\": \"F33B7653325337C3!s88...\",\n      \"name\": \"Documents\",\n      \"folder\": {\n        \"childCount\": 5\n      },\n      \"createdDateTime\": \"2024-01-15T10:30:00Z\",\n      \"lastModifiedDateTime\": \"2024-02-01T14:20:00Z\"\n    },\n    {\n      \"id\": \"F33B7653325337C3!s3f...\",\n      \"name\": \"report.pdf\",\n      \"file\": {\n        \"mimeType\": \"application/pdf\",\n        \"hashes\": {\n          \"sha1Hash\": \"cf23df2207d99a74fbe169e3eba035e633b65d94\"\n        }\n      },\n      \"size\": 35212\n    }\n  ]\n}\n\nGet Item by ID\nGET /one-drive/v1.0/me/drive/items/{item-id}\n\nGet Item by Path\n\nUse colon (:) syntax to access items by path:\n\nGET /one-drive/v1.0/me/drive/root:/Documents/report.pdf\n\nList Folder Children by Path\nGET /one-drive/v1.0/me/drive/root:/Documents:/children\n\nGet Item Children\nGET /one-drive/v1.0/me/drive/items/{item-id}/children\n\nSpecial Folders\n\nAccess known folders by name:\n\nGET /one-drive/v1.0/me/drive/special/documents\nGET /one-drive/v1.0/me/drive/special/photos\nGET /one-drive/v1.0/me/drive/special/music\nGET /one-drive/v1.0/me/drive/special/approot\n\nRecent and Shared\nGet Recent Files\nGET /one-drive/v1.0/me/drive/recent\n\nGet Files Shared With Me\nGET /one-drive/v1.0/me/drive/sharedWithMe\n\nSearch\nGET /one-drive/v1.0/me/drive/root/search(q='{query}')\n\n\nExample:\n\nGET /one-drive/v1.0/me/drive/root/search(q='budget')\n\nCreate Folder\nPOST /one-drive/v1.0/me/drive/root/children\nContent-Type: application/json\n\n{\n  \"name\": \"New Folder\",\n  \"folder\": {},\n  \"@microsoft.graph.conflictBehavior\": \"rename\"\n}\n\n\nCreate folder inside another folder:\n\nPOST /one-drive/v1.0/me/drive/items/{parent-id}/children\nContent-Type: application/json\n\n{\n  \"name\": \"Subfolder\",\n  \"folder\": {}\n}\n\nUpload File (Simple - up to 4MB)\nPUT /one-drive/v1.0/me/drive/items/{parent-id}:/{filename}:/content\nContent-Type: application/octet-stream\n\n{file binary content}\n\n\nExample - upload to root:\n\nPUT /one-drive/v1.0/me/drive/root:/document.txt:/content\nContent-Type: text/plain\n\nHello, OneDrive!\n\nUpload File (Large - resumable)\n\nFor files over 4MB, use resumable upload:\n\nStep 1: Create upload session\n\nPOST /one-drive/v1.0/me/drive/root:/{filename}:/createUploadSession\nContent-Type: application/json\n\n{\n  \"item\": {\n    \"@microsoft.graph.conflictBehavior\": \"rename\"\n  }\n}\n\n\nResponse:\n\n{\n  \"uploadUrl\": \"https://sn3302.up.1drv.com/up/...\",\n  \"expirationDateTime\": \"2024-02-08T10:00:00Z\"\n}\n\n\nStep 2: Upload bytes to the uploadUrl\n\nDownload File\n\nGet the file metadata to retrieve the download URL:\n\nGET /one-drive/v1.0/me/drive/items/{item-id}\n\n\nThe response includes @microsoft.graph.downloadUrl - a pre-authenticated URL valid for a short time:\n\n{\n  \"id\": \"...\",\n  \"name\": \"document.pdf\",\n  \"@microsoft.graph.downloadUrl\": \"https://public-sn3302.files.1drv.com/...\"\n}\n\n\nUse this URL directly to download the file content (no auth header needed).\n\nUpdate Item (Rename/Move)\nPATCH /one-drive/v1.0/me/drive/items/{item-id}\nContent-Type: application/json\n\n{\n  \"name\": \"new-name.txt\"\n}\n\n\nMove to different folder:\n\nPATCH /one-drive/v1.0/me/drive/items/{item-id}\nContent-Type: application/json\n\n{\n  \"parentReference\": {\n    \"id\": \"{new-parent-id}\"\n  }\n}\n\nCopy Item\nPOST /one-drive/v1.0/me/drive/items/{item-id}/copy\nContent-Type: application/json\n\n{\n  \"parentReference\": {\n    \"id\": \"{destination-folder-id}\"\n  },\n  \"name\": \"copied-file.txt\"\n}\n\n\nReturns 202 Accepted with a Location header to monitor the copy operation.\n\nDelete Item\nDELETE /one-drive/v1.0/me/drive/items/{item-id}\n\n\nReturns 204 No Content on success.\n\nSharing\nCreate Sharing Link\nPOST /one-drive/v1.0/me/drive/items/{item-id}/createLink\nContent-Type: application/json\n\n{\n  \"type\": \"view\",\n  \"scope\": \"anonymous\"\n}\n\n\nLink types:\n\nview - Read-only access\nedit - Read-write access\nembed - Embeddable link\n\nScopes:\n\nanonymous - Anyone with the link\norganization - Anyone in your organization\n\nResponse:\n\n{\n  \"id\": \"...\",\n  \"link\": {\n    \"type\": \"view\",\n    \"scope\": \"anonymous\",\n    \"webUrl\": \"https://1drv.ms/b/...\"\n  }\n}\n\nInvite Users (Share with specific people)\nPOST /one-drive/v1.0/me/drive/items/{item-id}/invite\nContent-Type: application/json\n\n{\n  \"recipients\": [\n    {\"email\": \"user@example.com\"}\n  ],\n  \"roles\": [\"read\"],\n  \"sendInvitation\": true,\n  \"message\": \"Check out this file!\"\n}\n\nQuery Parameters\n\nCustomize responses with OData query parameters:\n\n$select - Choose specific properties: ?$select=id,name,size\n$expand - Include related resources: ?$expand=children\n$filter - Filter results: ?$filter=file ne null (files only)\n$orderby - Sort results: ?$orderby=name\n$top - Limit results: ?$top=10\n\nExample:\n\nGET /one-drive/v1.0/me/drive/root/children?$select=id,name,size&$top=20&$orderby=name\n\nPagination\n\nResults are paginated. The response includes @odata.nextLink for additional pages:\n\n{\n  \"value\": [...],\n  \"@odata.nextLink\": \"https://graph.microsoft.com/v1.0/me/drive/root/children?$skiptoken=...\"\n}\n\n\nUse the full URL from @odata.nextLink (without the gateway prefix) to fetch the next page.\n\nCode Examples\nJavaScript\n// List files in root\nconst response = await fetch(\n  'https://gateway.maton.ai/one-drive/v1.0/me/drive/root/children',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\nconst data = await response.json();\n\n// Upload a file\nconst uploadResponse = await fetch(\n  'https://gateway.maton.ai/one-drive/v1.0/me/drive/root:/myfile.txt:/content',\n  {\n    method: 'PUT',\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`,\n      'Content-Type': 'text/plain'\n    },\n    body: 'Hello, OneDrive!'\n  }\n);\n\nPython\nimport os\nimport requests\n\n# List files in root\nresponse = requests.get(\n    'https://gateway.maton.ai/one-drive/v1.0/me/drive/root/children',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\nfiles = response.json()\n\n# Upload a file\nupload_response = requests.put(\n    'https://gateway.maton.ai/one-drive/v1.0/me/drive/root:/myfile.txt:/content',\n    headers={\n        'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}',\n        'Content-Type': 'text/plain'\n    },\n    data='Hello, OneDrive!'\n)\n\nNotes\nOneDrive uses Microsoft Graph API (graph.microsoft.com)\nItem IDs are unique within a drive\nUse colon (:) syntax for path-based addressing: /root:/path/to/file\nSimple uploads are limited to 4MB; use resumable upload for larger files\nDownload URLs from @microsoft.graph.downloadUrl are pre-authenticated and temporary\nConflict behavior options: fail, replace, rename\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments\nError Handling\nStatus\tMeaning\n400\tMissing OneDrive connection or invalid request\n401\tInvalid or missing Maton API key\n403\tInsufficient permissions\n404\tItem not found\n409\tConflict (e.g., item already exists)\n429\tRate limited (check Retry-After header)\n4xx/5xx\tPassthrough error from Microsoft Graph API\nError Response Format\n{\n  \"error\": {\n    \"code\": \"itemNotFound\",\n    \"message\": \"The resource could not be found.\"\n  }\n}\n\nTroubleshooting: API Key Issues\nCheck that the MATON_API_KEY environment variable is set:\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nTroubleshooting: Invalid App Name\nEnsure your URL path starts with one-drive. For example:\nCorrect: https://gateway.maton.ai/one-drive/v1.0/me/drive/root/children\nIncorrect: https://gateway.maton.ai/v1.0/me/drive/root/children\nResources\nOneDrive Developer Documentation\nMicrosoft Graph API Reference\nDriveItem Resource\nDrive Resource\nSharing and Permissions\nLarge File Upload\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/one-drive",
    "publisherUrl": "https://clawhub.ai/byungkyu/one-drive",
    "owner": "byungkyu",
    "version": "1.0.3",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/one-drive",
    "downloadUrl": "https://openagent3.xyz/downloads/one-drive",
    "agentUrl": "https://openagent3.xyz/skills/one-drive/agent",
    "manifestUrl": "https://openagent3.xyz/skills/one-drive/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/one-drive/agent.md"
  }
}