Login

The login request is used to authenticate an API user and grant access to make further requests.

REST

Request

https://api.neoncrm.com/neonws/services/api/common/login?login.apiKey=[API KEY]&login.orgid=[ORG ID]

Response

"loginResponse": {
    "operationResult": "SUCCESS",
    "responseMessage": "User logged in.",
    "responseDateTime": "2012-12-25T21:26:41.981-06:00",
    "userSessionId": "T1356492402097" 
}

SOAP

Request

<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:neon="http://www.z2systems.com/schemas/neonws/">
    <soapenv:body>
      <neon:loginrequest>
         <login>
            <apikey>xxxxxx</apikey>
            <orgid>test</orgid>
         </login>
      </neon:loginrequest>
    </soapenv:body>
</soapenv:envelope>

Response

<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:body>
      <ns2:loginresponse xmlns:ns2="http://www.z2systems.com/schemas/neonws/">
         <operationresult>SUCCESS</operationresult>
         <responsemessage>User logged in.</responsemessage>
         <responsedatetime>2013-01-07T23:42:03.018-06:00</responsedatetime>
         <usersessionid>T1357623723287</usersessionid>
      </ns2:loginresponse>
    </soap:body>
</soap:envelope>

Example

Authentication is a two-step process. Using an API key and Organization ID, we validate credentials with the server. The server provides a session access token, which is used for the duration of the API session as proof of identity. The steps, in practice, look like this:

First, we make a Login request.

curl https://api.neoncrm.com/neonws/services/api/common/login?login.apiKey=[API_KEY]&login.orgid=[ORG_ID]

If you’ve supplied valid credentials, you’ll receive a success message in the server response and, more importantly, a userSessionId.

"loginResponse": {
    "operationResult": "SUCCESS",
    "responseMessage": "User logged in.",
    "responseDateTime": "2012-12-25T21:26:41.981-06:00",
    "userSessionId": "T1356492402097" 
}

Now that we have a session ID, we need to store that (often done as a server-side session variable) and include it as a parameter in all subsequent API requests. Example:

curl https://api.neoncrm.com/neonws/services/api/account/listGenders?userSessionId=T1356492402097

Request Parameters

Name Required Description
login.apikey True The API Key is a unique identification code required to gain access to API requests.
login.orgId True The unique database Organization Identification name that is specific to each organization. Also known as an “instance” name.

Response Parameters

Name Required Description
userSessionId True The session token used in all other API requests.

Error Codes

Code Text Description
10 Api key is required.
12 Org Id is required.
13 Api key is invalid.
14 Org Id is invalid.