Resources · Documentation · Examples
Use Case 10: External API Integration via WebDAV
Programmatically upload files to WebPal from external applications using XML API or WebDAV.
Scenario
An external application needs to programmatically upload daily report files to WebPal.
Using the XML API
import requests
# Step 1: Login
login_xml = '''<?xml version="1.0"?>
<request command="login" login="api-user" password="secure-password"/>'''
response = requests.post(
'https://server.webpal.net/webservice/xml-service.php',
data=login_xml,
headers={'Content-Type': 'text/xml'}
)
# Parse session ID from response
session_id = parse_session_id(response.text)
# Step 2: Upload a file
upload_xml = f'''<?xml version="1.0"?>
<request command="upload" sessionID="{session_id}" pretty="true">
<dir>/Reports/Daily</dir>
<name>report-2026-04-25.pdf</name>
<title>Daily Report - April 25, 2026</title>
</request>'''
# Include file content in multipart body
with open('daily_report.pdf', 'rb') as f:
response = requests.post(
'https://server.webpal.net/webservice/xml-service.php',
data={'xmlRequest': upload_xml},
files={'file': f}
)
Using WebDAV
For simpler integrations, WebDAV is available at https://server.webpal.net/webdav:
Upload via curl
# Upload via curl
curl -T daily_report.pdf \
-u api-user:secure-password \
https://server.webpal.net/webdav/Reports/Daily/report-2026-04-25.pdf
Upload via Python
# Upload via Python
import requests
from requests.auth import HTTPBasicAuth
with open('daily_report.pdf', 'rb') as f:
requests.put(
'https://server.webpal.net/webdav/Reports/Daily/report-2026-04-25.pdf',
data=f,
auth=HTTPBasicAuth('api-user', 'secure-password')
)
Result
External systems can programmatically store reports in WebPal with full version tracking and activity logging.