Hmx Accounts

<back to all web services

LoginRequest

The following routes are available for this service:
POST/api/users/token
import 'package:servicestack/servicestack.dart';

class LoginResponse implements IConvertible
{
    String? accessToken;

    LoginResponse({this.accessToken});
    LoginResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        accessToken = json['accessToken'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'accessToken': accessToken
    };

    getTypeName() => "LoginResponse";
    TypeContext? context = _ctx;
}

class LoginRequest extends LoginResponse implements IPost, IConvertible
{
    String? username;
    String? password;

    LoginRequest({this.username,this.password});
    LoginRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        username = json['username'];
        password = json['password'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'username': username,
        'password': password
    });

    getTypeName() => "LoginRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'accounts.dev.healthmonix.com', types: <String, TypeInfo> {
    'LoginResponse': TypeInfo(TypeOf.Class, create:() => LoginResponse()),
    'LoginRequest': TypeInfo(TypeOf.Class, create:() => LoginRequest()),
});

Dart LoginRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/users/token HTTP/1.1 
Host: accounts.dev.healthmonix.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"username":"String","password":"String","accessToken":"String"}