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
Send the following HTTP request, replacing yourUsername and yourPassword with your user name and password:
POST /csm/login
Host: http://<Plaform_Manager>:<Port>/csm/login
{
"username" : "yourUsername",
"password" : "yourPassword"
}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)In each subsequent request, include the authentication token request header, as shown in the following example:
POST /csm/organization/search
Host: http://<Plaform_Manager>:<Port>/csm/organization/search
Authentication-Token: yourToken
Related topics