External Authentication API
The External Authentication server receives a GET request from MyQ server with the parameters loginType and loginValue. To authenticate the request the 'Basic' HTTP authentication scheme is used.
Endpoint, username and password are defined in the myq settings page called User Authentication in the External Authentication section.
Headers:
Authentication: Basic {login:pwd in base64}
GET Parameters:
loginType
1 - login via card
0 - login via PIN
7 - Login via card or PIN
loginValue
Card or PIN number according to loginType value
Example request:
https://127.0.0.1/?loginType=1&loginValue=1234
Upon successful card or PIN authentication, the response JSON will include the username or personal number of the corresponding user and the Content-Type: application/json header.
JSON Properties:
result
0 - Success (User has been found)
1 - Invalid (User has been found but their account was blocked, deactivated etc.)
2 - Not found (User has not been found)
personalNumber
A unique number for a MyQ user
username
Username or Alias of MyQ user.
Example response
Headers:
Content-Type: application/json
JSON Examples:
{
"result":0,
"username":"John"
}
{
"result":0,
"personalNumber":"789413"
}
{
"result":2
}
Note:
For result 0 (Success), at least one of values personalNumber, username has to be send and must not be empty, otherwise it logs an exception.
For result 1 (Invalid user), 2 (Not found), the fields username, personalNumber are not required