cancel
Showing results for 
Search instead for 
Did you mean: 

Issue while creating virtual machine on SAP Cloud platform

prathik
Participant
0 Kudos

Hi,

I am trying to create a virtual machine on SAP cloud platform, but when I execute the GET API call to get a CSRF token after setting up the API endpoint, The CSRF fetch request fails with a "401 - unauthorized" response code.

gauravdey Could you please help me resolve this issue.

Request URL : https://api.hana.ondemand.com/virtualMachines/v2/accounts/<Technical name of SubAccount>/csrf

The "X-message-code": says PWD_WRONG, Could you please let me know where am I slipping here.

Response body :

{  "Strict-Transport-Security": "[max-age=31536000; includeSubDomains; preload]",
  "WWW-Authenticate": "[Basic realm=\"SAP HANA Cloud Platform\"]",  
"Date": "[Fri,  16 Nov 2018 10:23:03 GMT]",  
"Transfer-Encoding": "[chunked]", 
 "X-message-code": "[PWD_WRONG]", 
 "Server": "[SAP]"
}

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Prathik,

I believe you are missing the correct landscape on your URL.

API's need to have the correct landscape where your account is created.

For instance, if I have my account at Europe Rot (EU1), then the api url should be:

https://api.eu1.hana.ondemand.com/virtualMachines

Thus, I suggest you use the API Business Hub web site to test your credentials against the correct landscape before being able to call this API.

Regards,
Ivan

prathik
Participant

Thanks for the help! Ivan that worked.

Answers (0)