REST API knowledge exchange
Post Reply
TlEtiVaN@proton.me
Lurker
Posts: 2
Liked: never
Joined: Aug 26, 2024 9:53 am
Full Name: TlEtiVaN
Contact:

Cannot login to Veeam Backup Enterprise Manager REST API

Post by TlEtiVaN@proton.me »

The provider gave me credentials to VMware Cloud Director and Veeam Backup Enterprise Manager REST API
- VMware url: https://vcd.provider.com/tenant/myCompanyName/vdcs
- Veeam url: https://vssp.provider.com:9398
- username
- password
Vmware Cloud Director has Veeam Plug-in.
I need to login to Veeam Backup Enterprise Manager REST API, which works together with Vmware Cloud Director.

I use this: https://helpcenter.veeam.com/docs/backu ... ml?ver=120
I send the request using Vmware Cloud Director username and password.

Code: Select all

curl -X POST -L 'https://vssp.provider.com:9398/api/sessionMngr/?v=v1_7' -u 'username:password' -d ''
Response:

Code: Select all

{"FirstChanceExceptionMessage":null,"StackTrace":null,"Message":"The user name or password is incorrect","StatusCode":401,"Status":"Unauthorized"}
I also try these two ways: https://helpcenter.veeam.com/docs/backu ... ml?ver=120
1. I send the request using Vmware Cloud Director username and password in the request header and body.

Code: Select all

curl -X POST -L 'https://vssp.provider.com:9398/api/sessionMngr/?v=v1_7' -u 'username:password' -H 'Content-Type: application/xml' \
-d  '<?xml version="1.0" encoding="utf-8"?>
<LoginSpec xmlns="http://www.veeam.com/ent/v1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <TenantCredentials>
   <Username>username</Username>
   <Password>password</Password>
 </TenantCredentials>
</LoginSpec>'
Response:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<Error xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Message="The user name or password is incorrect" StatusCode="401" Status="Unauthorized" xmlns="http://www.veeam.com/ent/v1.0" />
2. The same, but I take name of my organization from Vmware url (myCompanyName).

Code: Select all

curl -k -X POST -L 'https://vssp.provider.com:9398/api/sessionMngr/?v=v1_7' -u 'username:password' -H 'Content-Type: application/xml' \
--data '<LoginSpec xmlns="http://www.veeam.com/ent/v1.0">
   <VCloudOrganizationCredentials>
       <OrganizationName>company</OrganizationName>
       <Login>username</Login>
       <Password>password</Password>
   </VCloudOrganizationCredentials>a
</LoginSpec>'
Response:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<Error xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Message="The user name or password is incorrect" StatusCode="401" Status="Unauthorized" xmlns="http://www.veeam.com/ent/v1.0" />
What am I doing wrong? Which of the 3 requests should I use? Should credentials be different in the header and body of the request for 2 and 3 ways?
The provider talk that credentials from Vmware Cloud Director should work for Veeam Backup Enterprise Manager REST API as well. Vmware Cloud Director and Veeam Backup Enterprise Manager REST API can have different credentials or always similar?
oleg.feoktistov
Veeam Software
Posts: 2021
Liked: 673 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Cannot login to Veeam Backup Enterprise Manager REST API

Post by oleg.feoktistov »

Hi,

Question - did you send your username:password as a base64 endcoded string or as a plain text? EM REST API requires to send base64 encoded username:password pair, as stated in the guide you shared.

Best regards,
Oleg
TlEtiVaN@proton.me
Lurker
Posts: 2
Liked: never
Joined: Aug 26, 2024 9:53 am
Full Name: TlEtiVaN
Contact:

Re: Cannot login to Veeam Backup Enterprise Manager REST API

Post by TlEtiVaN@proton.me »

Hi,
I send username:password as a base64 encoded string.
Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests