Get Login Token
This endpoint allows you to retrieve a login token for a specific user, which can be used for temporary authentication.
Token Security: Login tokens provide temporary access and can be used with QR codes for mobile authentication. Tokens expire based on the token_expire parameter and should be handled securely.
POST Parameters
| Parameter | Required | Value | Description |
|---|---|---|---|
api_key | {key} | An API key that has access to the resource you want to query for | |
user_id | {integer} | The unique ID of the user to generate a token for | |
token_expire | {integer} | Token expiration time in seconds (minimum: 60, maximum: 86400). Required to generate token and QR code |
Response Information
| Element | Description |
|---|---|
<status> | A status code in response to the operation |
<message> | Additional information about the operation – human readable |
<user_id> | The unique ID of the user |
<token> | The generated login token for temporary authentication |
<qrcode> | URL to the QR code image for mobile scanning |
<expire> | Token expiration timestamp |
Example
Sample Request
POST https://api-app.xtracta.com/v1/user/login_token HTTP/1.1 api_key=123&user_id=12345
Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<user_response>
<status>200</status>
<message>The request has been successfully processed</message>
<user_id>12345</user_id>
<token>1234567890</token>
<qrcode>https://....ee5de.png</qrcode>
<expire>9090</expire>
</user_response>
Schema Definition
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:simpleType name="ConfidenceType">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:complexType name="UserresponseType">
<xs:sequence>
<xs:element name="status" type="xs:positiveInteger"/>
<xs:element name="message" type="xs:string"/>
<xs:element name="user_id" type="xs:nonNegativeInteger"/>
<xs:element name="token" type="xs:string"/>
<xs:element name="qrcode" type="xs:anyURI"/>
<xs:element name="expire" type="xs:nonNegativeInteger"/>
</xs:sequence>
</xs:complexType>
<xs:element name="user_response">
<xs:complexType>
<xs:sequence>
<xs:element name="status" type="xs:positiveInteger"/>
<xs:element name="message" type="xs:string"/>
<xs:element name="user_id" type="xs:nonNegativeInteger"/>
<xs:element name="token" type="xs:string"/>
<xs:element name="qrcode" type="xs:anyURI"/>
<xs:element name="expire" type="xs:nonNegativeInteger"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>