EndPreviousNextEnd EndPrint This TopicEnd

LogInUser

The LogInUser webservice is used to validate that a Contegro user has entered the correct login information.

 

If the user has entered the correct details, the webservice will pass back a new authentication token.

 

This authentication token can be used like a regular authentication token, but on the server it will be associated to the user's account. Any future webservices which are created to serve up user data will require an authentication token which is generated from a LogInUser webservice call.

 

Contegro supports having multiple tokens associated to the same user account (for example if the same user is logged into an app on their phone and on their desktop browser).

 

Authentication tokens which are generated from a LogInUser webservice call also aren't restricted to an IP address, and have a very long (ie: 5 years) expiry time. This means that they are suitable for storing so that users don't need to log in every time they use your system.

 

Data to be passed to the webservice

Variable name

Data type

Description

username

String

The Contegro user's username (this will very often be their email address)

password

String

The Contegro user's password

authToken

String

The authentication token for your session

 

Data which is returned

Variable name

Data type

Description

token

String

The auth token which you can use when calling the other APIs. This authentication token isn't restricted to an IP address and has a very long expiry time

expiryDate

DateTime

The date and time that the auth token will stop working

errorCode

String

If your request was successful, the errorCode will be 0

If your request had a problem, there will be an error code for each kind of problem

errorMessage

String

A description of the problem with your error request (if there was a problem)

If your request was successful, this will be an empty string

 

Example XML for a LogInUser request

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

 <soap:Body>

         <LogInUser xmlns="http://contegro.com/">

                 <authToken>14ffdfd6-78c3-4fc0-9c63-3902011640af</authToken>

                 <username>example@email.com</username>

                 <password>password123</password>

         </LogInUser>

 </soap:Body>

</soap:Envelope>

 

Example XML which is returned

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <soap:Body>

         <LogInUserResponse xmlns="http://contegro.com/">

                 <LogInUserResult>

                         <errorCode>0</errorCode>

                         <errorMessage/>

                         <token>deb13a42-94a2-4fb1-aa94-b888ce156454</token>

                         <expiryDate>2021-01-27T11:47:31.4008962+13:00</expiryDate>

                 </LogInUserResult>

         </LogInUserResponse>

 </soap:Body>

</soap:Envelope>

Topic Link