Inquiry about the Proxmox Backup API

admin_ready

New Member
Nov 29, 2024
12
1
3
I have created a user API and tried giving it admin privileges, following the API documentation.However, I am unable to retrieve VM data that is in a backup group. An error message appears stating 'no data' (as shown in the picture).Has anyone encountered this before, and what is the method to fix it?
 

Attachments

  • Screenshot 2568-06-03 at 14.48.05.png
    Screenshot 2568-06-03 at 14.48.05.png
    26.5 KB · Views: 13
  • Screenshot 2568-06-03 at 14.48.22.png
    Screenshot 2568-06-03 at 14.48.22.png
    174.6 KB · Views: 13
  • Screenshot 2568-06-03 at 14.49.37.png
    Screenshot 2568-06-03 at 14.49.37.png
    52.4 KB · Views: 12
  • Screenshot 2568-06-03 at 15.01.16.png
    Screenshot 2568-06-03 at 15.01.16.png
    54.6 KB · Views: 13
try using that user using proxmox-backup-client - if that works, your API requests are wrong. if it doesn't, then your ACLs are wrong. in any case, you'd need to provide more detail if you want help figuring it out..
 
I think the API's value/setting isn't wrong, but I'm not sure about the /path being used. Would you like us to send any additional information?
 

Attachments

  • Screenshot 2568-06-03 at 16.51.47.png
    Screenshot 2568-06-03 at 16.51.47.png
    61.7 KB · Views: 7
providing actual API requests (e.g., this full API path with this method and these parameters) would be a start (not as screenshots, but as actual formatted text).
 
your requests don't seem to include the right authentication headers.. you are also mixing token and user authentication, which makes no sense.

you might want to start off with a request that the UI makes and base yours on that..
 
cannot send the actual URL, username/password because it is internal organizational data. I apologize for this.May I ask, have you encountered this problem before?
 
In addition to this, I also tried writing code to check whether the token is usable or not.
 

Attachments

  • Screenshot 2568-06-04 at 09.20.11.png
    Screenshot 2568-06-04 at 09.20.11.png
    33.5 KB · Views: 7
encountered what? you still haven't provided any data that could help me help you ;)
 
This is the API endpoint according to the docs; no response data was received. However, please be advised that I have off the URL and store informati.
But a status of 200 indicates that the API endpoint is correct.
 

Attachments

  • Screenshot 2568-06-03 at 14.49.37.png
    Screenshot 2568-06-03 at 14.49.37.png
    52.4 KB · Views: 6
that could also mean that you user/token doesn't see any groups. like I said, start with the UI, and then try to reproduce the requests (you can dump them using the browser console) using your API client.. if they don't work (using the same authorization), then something is wrong with how you are using the API. if they work, then you can start comparing with how you previously tried to find your mistake(s).
 
In the UI, have namespace and VM data is as shown in the picture. However, I want to do some automation, so I was thinking of using an API to help, but I can't find the necessary information
 

Attachments

  • Screenshot 2568-06-04 at 14.48.21.png
    Screenshot 2568-06-04 at 14.48.21.png
    35.3 KB · Views: 6
  • Screenshot 2568-06-04 at 14.49.03.png
    Screenshot 2568-06-04 at 14.49.03.png
    13.5 KB · Views: 6
In the UI, have namespace and VM data is as shown in the picture. However, I want to do some automation, so I was thinking of using an API to help, but I can't find the necessary information
You have no groups in the root namespace, so that is why you get the empty array as response. You will have to provide the optional ns parameter to list groups contained within a namespace.
 
Which page in the docs do I have to follow? Should I use this page or not:
https://pbs.proxmox.com/docs/api-viewer/index.html#/admin/datastore/{store}/namespace
Depends on what your actual goal is. In order to get a list of namespaces, you can use that endpoint with a get request. To fetch the list of groups contained within that namespace, you will have to use the already mentioned
and pass the namespace via the additional ns parameter. Same if you want the snapshots contained within that group, but that requires get requests to the snapshots endpoint https://pbs.proxmox.com/docs/api-viewer/index.html#/admin/datastore/{store}/snapshots and optionally the backup type and id.
 
Last edited: