Logging on to the API server

To interact with BMC Cloud Lifecycle Management through the API, you must log on and obtain an authentication token. Save the authentication token that you receive in the response to your logon request and include it in the header of each subsequent request during the session. The token is valid as long as your session remains active. If your session times out due to inactivity, you must log on again and obtain a new token.

To log on and obtain an authentication token

  1. Send the following HTTP request, replacing yourUsername and yourPassword with your user name and password:
    
    POST /csm/login
    Host: cloud-service-url
    
    {
      "username" : "yourUsername",
      "password" : "yourPassword"
    }
    
  2. From the response, save the text string returned in the Authentication-Token: header. That text string is your authentication token. For example, in the following response, you would save yourToken:
    
    HTTP/1.1 200 OK
    Date: Wed, 11 Jan 2011 13:23:04 GMT
    Authentication-Token: yourToken
    Content-Type: application/json; charset=ISO-8859-1
    Content-Length: 2
    Server: Jetty(6.1.9) 
    
  3. In each subsequent request, include the authentication token request header, as shown in the following example:
    
    POST /csm/organization/search
    Host: cloud-service-url
    Authentication-Token: yourToken
    

Related topics

HTTP request and response headers

Was this page helpful? Yes No Submitting... Thank you

Comments