This example uses POST: users to add a new user. Replace ADMIN_AUTH_TOKEN with the authtoken and PASSWORD with the new user's password:
curl -d @user.xml -H "Content-type: text/xml" --cookie authtoken=ADMIN_AUTH_TOKEN "http://hostname/@api/deki/users?accountpassword=PASSWORD"
In this case the body of the POST request comes from user.xml which contains
<user><username>Bob</username><fullname>Bob Smith</fullname><email>bob@somewhere.com</email><permissions.user><role>contributor</role></permissions.user></user>
Every call to the api must be authenticated using the authtoken cookie. You can use Firefox's web developer toolbar or other plugins to get your authtoken after you've logged into the wiki. Different api calls require different permissions. If an authtoken is not specified or is invalid, the api takes the permissions from the anonymous user. In the case of POST: Users, be sure the authtoken belongs to a user that has admin rights.
This example uses PUT: pages/{pageid}/files/{filename} to upload a file.
First, you will need to authenticate and store the authentication cookie. Replace USERNAME and PASSWORD with your login information:
curl -c cookies.txt http://USERNAME:PASSWORD@hostname/@api/deki/users/authenticate
Use the cookie in the subsequent file upload operation:
curl -b cookies.txt -X PUT --data-binary "@test.png" -H "Content-Type: image/png" "http://hostname/@api/deki/pages/=TestPage/files/test.png"