[pve-devel] Accessing the api

Dietmar Maurer dietmar at proxmox.com
Mon Oct 24 09:01:21 CEST 2011


Please can you post with the same email address you subscribed to this list?

This post is from <coffe at alatest.se>, but you subscribed with <c0ff3e at gmail.com>

I will reject such posts in future.

> Trying to find , how i connect to the api, been testing my servers address and
> paths showed in the API documentation.
> so https://myserver:8006/access .
> So if someone can point me in the right way, i will give it a try to make a android
> app, to just be able to view the servers.

You need to get a ticket first (login). This can be done by doing a POST request:

POST /api2/json/access/ticket

Parameter: see http://pve.proxmox.com/pve2-api-doc/

for example:

POST /api2/json/access/ticket 
PARAMS { username: root at pam, password: yourpasswd }

will return something like:

{
   "CSRFPreventionToken" : "4EA50B55:Mjz1XV9O6jxJNa7cbkGL3bicpVk",
   "ticket" : "PVE:root at pam:4EA50B55::BMP7hcOB/hYdApFAQOH9HX2gT5wKiTDWf4mzw5/3DFnQSvNZIufhGj69svV46co4YX0G+zJWsTqTU4moGGZO8Lzp01OMYltBq4FVNA5RExhaOQNMLFUO4OXqYsjgX56qmm9HKD+ZiXhlEZ1AwPOyJJGoawKSv+Ac9jGTgEpR/qwPdscyWzD4c1eWDkl3wBUxWlt4Sm7TOqqfA+tHVLCHeMRYol+WSQK3nkbzdCSIWa87NX3FM8xjevvr6jj6a8S13BYy6VFT1Z+6aS/eUSf6yfFAUXr0J72vkmuI3PY9CLiHenPFf6kCN3Z7EZzpHy/wZjdN4jxYlg163XQQ09TDNg==",
   "username" : "root at pam"
}


You normally store 'ticket' into a cookie named ' PVEAuthCookie'.

Any PUT/POST/DELETE request need to include the 'CSRFPreventionToken' in the header.

Does that work for you?

- Dietmar





More information about the pve-devel mailing list