Login
post
/rest/{versionId}/admin/login
Use this (POST) method to authenticate and establish as user session on the SDM server. A user must establish a valid authenticated session before other method calls can be used. The response to a successful authentication returns a valid time-limited session cookie that needs to be returned with all subsequent REST requests to establish the user has an authenticated session in progress.
Request
Supported Media Types
- application/xml
- application/json
Path Parameters
Header Parameters
Response
Supported Media Types
- application/xml
- application/json
200 Response
successful operation
400 Response
The user input is invalid.
401 Response
The user ID or password is invalid.
404 Response
The REST API version of your input request cannot be found.
Examples
The following example shows how to login to the server by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL
Example of cURL Data
The following shows an example of cURL data sent with the request.
curl -v -s -c sessionid.txt -X POST -d@user.xml -H"Content-Type: application/xml" -H"Accept: application/xml" http://example.com:8080/rest/v1.1/admin/login
Example of Request Body
The following shows an example of the user request body input in XML format.
<?xml version="1.0" encoding="UTF-8"?> <session> <userName>admin</userName> <password>password</password> </session>
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK Date: Fri, 24 Feb 2017 19:39:16 GMT Server: Apache X-Frame-Options: SAMEORIGIN Set-Cookie: JSESSIONID=C1B538D484F77F3EEB25ECD0A3148448.tomcat1; Path=/rest; HttpOnly Content-Length: 304 Vary: Accept-Encoding Content-Type: application/xml
Example of Response Body
The following example shows the contents of the response body in XML format.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <session> <idleTimeout>0</idleTimeout> <serverInfo>NNC76B40</serverInfo> <sessionId>C1B538D484F77F3EEB25ECD0A3148448.tomcat1</sessionId> <userGroup>administrators</userGroup> <userName>admin</userName> <validUntil>valid until logout</validUntil> </session>