login
Login TNAPI user
Log in with your username and password to be issued an Authentication Token to use with other secure TNAPI calls. The service requires HTTPS protocol when it is accessed from an external IP address.
Arguments
Parameter Description
apiKey Your application key
user Telenav Login Name (10-digit phone)
password Password (4-digit pin)
JSON Support
By default, the output format is XML. For JSON output, specify responseDataFormat in the request header or in RESTful URL parameter list. See JSON Support section for details.
Supported Protocol
RESTful:  HTTP GET, HTTP POST (Supported content type: application/xml, application/x-www-form-urlencoded)
SOAP
Sample Request
HTTP GET

HTTP POST (Content-Type: application/x-www-form-urlencoded)
POST /tnapi/services/auth/login HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
Content-Length: 161

apiKey=MyApiKey&user=0083935537&password=1111&domain=1
HTTP POST (Content-Type: application/xml)
POST /tnapi/services/auth/login HTTP/1.1
Content-Type: application/xml; charset=UTF-8
Host: localhost:8080
Content-Length: 270

<ns2:LoginRequest xmlns:ns2="http://telenav.com/tnapi/services/auth/v10/">
    <apiKey>MyApiKey</apiKey>
    <domain>1</domain>
    <user>0083935537</user>
    <password>1111</password>
</ns2:LoginRequest>

SOAP
Operation can be invoked through authentication WSDL. See details in web service WSDL page.
Sample Successful Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/xml;charset=UTF-8
Date: Mon, 02 Feb 2009 23:00:13 GMT
Content-Length: 341

<ns3:LoginResponsexmlns:ns3="http://telenav.com/tnapi/services/auth/v10/">
    <status>
        <code>OK</code>
        <message>OK</message>
    </status>
    <authenticationToken>NewAuthenticationTokenReturned</authenticationToken>
    <expirationTime>2009-02-02T15:30:14.240-08:00</expirationTime>
</ns3:LoginResponse>

Sample Successful Response with JSON output requested
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json/badgerfish
Date: Mon, 02 Feb 2009 23:00:13 GMT
Content-Length: 341

my_callback({
    "ns3:LoginResponse": {
        "@xmlns":{
            "ns3":"http:\/\/telenav.com\/tnapi\/services\/auth\/v10\/"
        },
        "status":{
            "code":{"$":"OK"},
            "message":{"$":"OK"}
        },
        "authenticationToken":{"$":"authenticationToken"},
        "expirationTime":{"$":"2009-02-17T17:39:42.875-08:00"}
    }
});


Sample Failed Responses
Sample 1
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: application/xml;charset=UTF-8
Date: Mon, 02 Feb 2009 23:00:07 GMT
Connection: close
Content-Length: 104

<faultstring>Required element apiKey defined in the schema can not be found in the request</faultstring>

Sample 2
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: application/xml;charset=UTF-8
Date: Mon, 02 Feb 2009 23:00:07 GMT
Connection: close
Content-Length: 205

<ns2:ServiceExceptionData xmlns:ns2="http://telenav.com/tnapi/datatypes/services/v10/">
    <status>
        <code>SERVICE_INVALID_CREDENTIALS</code>
        <message>Invalid API Key</message>
    </status>
</ns2:ServiceExceptionData>

Field Name Description When Present
status.code
OK
User successfully logged in.
SERVICE_INVALID_CREDENTIALS
One of the following:
- Invalid API Key provided
- Provided API Key is not active
- Provided user name is invalid
- Provided password is invalid
Always
status.message Detail error message, if any. When status.code is not OK
authenticationToken Authentication Token. When status.code is OK
Error Handling
Common error data type is returned if any exception happens. See error handling section for detail.
Authentication
FOLLOW US