VMware Networking Community
David5323
Contributor
Contributor

All HCX APIs return 302

HCX manager API calls to /hybridity/api/sessions works correctly and returns the token. When calling any other HCX manager API (using curl, or postman), I always get a 302 response. If I allow the redirect, I always get a 200 response, with the html below as the body, for all HCX manager API calls.

How would I get HCX manager API calls to behave as they are documented? Is there some setting that needs to be enabled to "turn on" HCX APIs?

 

<!DOCTYPE html><html lang=""><head><title>VMware HCX</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="description" content="VMware HCX"><link rel="icon" type="image/png" href="assets/icon/favicon.ico"><meta name="referrer" content="no-referrer"/><base href=""><!-- <script src="assets/js/custom-elements.min.js"></script> --><style>#preloader {
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            position: fixed;
            z-index: 99999999999;
        }
        #preloader > .spinner {
            margin: auto;
            display: block;
            margin-top: 200px;
            position: relative;
        }</style><link media="screen" rel="stylesheet" type="text/css" href="assets/css/jquery.dataTables.min.css"/><link href="/hybridity/ui/hcx-client/main.94fd349b5fa6b6150ca82f92ed23604d.css" rel="stylesheet"/><link rel="preload" href="/hybridity/ui/hcx-client/polyfills.78db231c9b94fc5357ee.bundle.js" as="script"/><link rel="preload" href="/hybridity/ui/hcx-client/main.115660375736f629e6f1.bundle.js" as="script"/></head><body><app><div id="preloader"><div class="spinner"></div></div></app><script>var FULL_PATH = '';
    window.DATA = { path: FULL_PATH };

    function onAssetsLoadFailure() {
        window.DATA.loadError = true;
    }</script><!-- <script src="assets/js/web-animations.min.js" onerror="onAssetsLoadFailure();"></script> --><script type="text/javascript" src="/hybridity/ui/hcx-client/inline.4835a1b0bc127b9cc05e.bundle.js"></script><script type="text/javascript" src="/hybridity/ui/hcx-client/polyfills.78db231c9b94fc5357ee.bundle.js"></script><script type="text/javascript" src="/hybridity/ui/hcx-client/main.115660375736f629e6f1.bundle.js" async></script></body></html>

 

1 Reply
David5323
Contributor
Contributor

Turns out that html response is actually the login page. The issue was that I was using the wrong "token" from the sessions API response. I was using the "certificate" value from the response body instead of the "x-hm-authorization" value in the response header.