VMware Cloud Community
xeva01
Contributor
Contributor

Can't login to VCD API v1.0 /org/{id}

Hi,

I try to connected VCD api  I can login "https://{URL-vCloud}/api/v1.0/login" but  follow code below I alway get error "403  Forbidden"  help me pls.

I

$requestVc = new HTTP_Request2("https://{URL-vCloud}/api/v1.0/org/{id}",
                    HTTP_Request2::METHOD_POST, array('ssl_verify_peer' => false, 'use_brackets' => true));
$requestVc->setAuth($user, $pswd);
        $requestVc->setHeader($responseOrg->getHeader());
        
            try
  { 
      $responseVC = $requestVc->send();
       print_r($responseVC);
}
catch (HTTP_Request2_Exception $e)
              {
                   echo 'Error: ' . $e->getMessage();
              }
0 Kudos
3 Replies
charliejllewell
Enthusiast
Enthusiast

This sounds like you're have issues with the authentication. Are you logging in correctly and then parsing the authentication cookie with you request?

A colleague of mine has written some information up on using the vCloud API which may help.

http://support.cloud.eduserv.org.uk/entries/20410523-vcloud-api-walk-thru

http://support.cloud.eduserv.org.uk/entries/20914716-example-perl-api-code

Message was edited by: charliejllewe…

xeva01
Contributor
Contributor

Thank you, you advice help me fixed this issue.

0 Kudos
charliejllewell
Enthusiast
Enthusiast

Great glad to have helped Smiley Happy