Loading...

REST API - Authentication: POST Login

Description

SnapProtect REST APIs support token-based authentication via the Authtoken request header. The POST Login API is used to retrieve the authentication token. Once obtained, the authentication token must be inserted into the Authtoken header for all requests.

Note: The authentication token expires after 30 minutes of inactivity.

Request

Syntax

XML

POST <webservice>/Login HTTP/1.1
Host: <host name>
Accept: application/xml
Content-type: application/xml

<DM2ContentIndexing_CheckCredentialReq mode="Webconsole" domain="" username="" password="" commserver="" />

JSON

POST <webservice>/Login HTTP/1.1
Host: <host name>
Accept: application/json
Content-type: application/json

{
    "mode":"WebConsole",
    "domain":"",
    "username":"",
    "password":"",
    "commserver":""
}

where <webservice> is the root path used to route the API requests to the Web Server.

For more information, see Available Web Services for REST API.

Request Headers

Name Description
Host The host name of the Web Server or Web Console used in the API request.
Accept The format of the response. Valid values are: application/xml or application/json.
Content-type The media type contained in the request body. Valid values are: application/xml or application/json.

Request Body

An XML element or a JSON message is required. See Syntax. The following table displays the parameters for the request body.

Parameter Description Elements
mode This must equal Webconsole. DM2ContentIndexing_CheckCredentialReq
domain If the user logging in is a domain user, the domain parameter must be set to the domain associated with the user. DM2ContentIndexing_CheckCredentialReq
username The name of the CommCell Console user. For Active Directory (AD) users, an email address can be used. DM2ContentIndexing_CheckCredentialReq
password A Base64 encoded password for the user. DM2ContentIndexing_CheckCredentialReq
commserver The option to log in to a remote CommServe. If this parameter is not used, the user is logged in to the CommServe associated with the Web Server.

Use the following values for the commserver parameter: commserve_host_name*commserve_name.

The CommServe host name and the CommServe name must be separated by an asterisk (*).

For example:

commserver="client.mydomain.com*testcs"

DM2ContentIndexing_CheckCredentialReq

Response

Response Parameters

Parameter Description Elements
aliasName The alias name. DM2ContentIndexing_CheckCredentialReq
userGUID The globally unique identifier for the user. DM2ContentIndexing_CheckCredentialReq
token The authentication token that must be inserted into the Authtoken header for all requests. DM2ContentIndexing_CheckCredentialReq
ccn An internal reference number. DM2ContentIndexing_CheckCredentialReq
userName The name of the CommCell Console user sent in the request. DM2ContentIndexing_CheckCredentialReq

Examples

Sample Request

XML

This request logs in to the CommServe associated with the Web Server.

POST <webservice>/Login HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Content-type: application/xml

<DM2ContentIndexing_CheckCredentialReq mode="Webconsole" username="admin" password="RkVSNTVXND0=" />

This request logs in to a remote CommServe.

POST <webservice>/Login HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Content-type: application/xml

<DM2ContentIndexing_CheckCredentialReq mode="Webconsole" username="admin" password="RkVSNTVXND0=" commserver="client.mydomain.com*testcs" />

JSON

This request logs in to the CommServe associated with the Web Server.

POST <webservice>/Login HTTP/1.1
Host: client.mydomain.com
Accept: application/json
Content-type: application/json

{
    "mode":"WebConsole",
    "username":"admin",
    "password":"RkVSNTVXND0"
}

Sample Response

XML

<DM2ContentIndexing_CheckCredentialResp aliasName="1" userGUID="99965E43-C535-49F6-900C-2FFE77002549" loginAttempts="0" remainingLockTime="0" userName="admin" providerType="1" ccn="0" token="QSDK 321865d9d0e468a7b9b2413ef52201f434b2518ea74e72e3bda4a50beb9f282898b75e7f1106d9538a677367253493
53d374fd34e163db118bdf2a3f75728cb6e62bb6d2318acdcef999facaf4c58300edd65977339d4fe0afba86e93122
bd9cc719ba0a885fb16db303bf830f699bf58d77d41f78c4febc6bfea8f6cf4f74f54956f25f12067939ea4f511baf
b78d48ee441f0bdfdd33ace43c128bc6605823adab758541a38d08d8dea556654e3f3b8c3d091e1253ac4a0e40a4c0
71f6cdf7ee935ca47005b0fade0a5b50d207f4fe69b170971910055dab88f7c4exc9f8c439ba0cf2fb625e2492d0e
8c55d880d8b315aa7ecb4facc8fb98105ee9696b78d" forcePasswordChange="0" isAccountLocked="0"><ownerOrganization providerId="0" providerDomainName="Qinetix Commcell" /><providerOrganization providerId="0" providerDomainName="Qinetix Commcell" /></DM2ContentIndexing_CheckCredentialResp>

JSON

{
"ownerOrganization":{
"providerId":0,"providerDomainName":"Qinetix Commcell"
},"aliasName":"1","userGUID":"99965E43-C535-49F6-900C-2FFE77002549","loginAttempts":0,"remainingLockTime":0,"smtpAddress":"","providerOrganization":{
"providerId":0,"providerDomainName":"Qinetix Commcell"
},"errList":[

],"userName":"admin","providerType":1,"ccn":0,"token":"QSDK 3feedcdeccfa56f536a1e9ddc92275e7e78025640882eb106964622e6d9edf36eaca970a00d27710e7e88c38f54239d1c7
04c4f993f28358277d0caa53fbc2681c4214c6f1ad02d7ea661dbff4e2dd906afab382f47ee489fdb9b85754538e904674
d76e7a7c82ee5137dfeadb094a441da9916f77ce8356f7a23d864d510e43221f9e86d3240b172dd0731faa8045f35bb618
5b99af701629b5391c4fe1516936f0fa17e21c01b8eefee6cfb143f00b496c3a332bdbe2ddd534c2301e466eb79d3bce77
e11d81ce67eb8ba5c93385798d417dca01a56e015647377cc29ed3403a7a3bd93101f0exea415f100ecab9e0d3544847ec
6fe583f00bcd2e026f21292","capability":4328650366975,"forcePasswordChange":false,"isAccountLocked":false
}