POST | /v1/User/RefreshToken | Refresh user token before timeout |
---|
import 'package:servicestack/servicestack.dart';
class Account implements IConvertible
{
String? GasUserId;
int? UserId;
List<int>? UserRoleId;
String? UserRoleRedirectUrl;
String? UserToken;
String? RetailerGroupId;
DateTime? Modified;
bool? Exists;
String? DefaultVehicleType;
String? DefaultRetailerGssn;
Account({this.GasUserId,this.UserId,this.UserRoleId,this.UserRoleRedirectUrl,this.UserToken,this.RetailerGroupId,this.Modified,this.Exists,this.DefaultVehicleType,this.DefaultRetailerGssn});
Account.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
GasUserId = json['GasUserId'];
UserId = json['UserId'];
UserRoleId = JsonConverters.fromJson(json['UserRoleId'],'List<int>',context!);
UserRoleRedirectUrl = json['UserRoleRedirectUrl'];
UserToken = json['UserToken'];
RetailerGroupId = json['RetailerGroupId'];
Modified = JsonConverters.fromJson(json['Modified'],'DateTime',context!);
Exists = json['Exists'];
DefaultVehicleType = json['DefaultVehicleType'];
DefaultRetailerGssn = json['DefaultRetailerGssn'];
return this;
}
Map<String, dynamic> toJson() => {
'GasUserId': GasUserId,
'UserId': UserId,
'UserRoleId': JsonConverters.toJson(UserRoleId,'List<int>',context!),
'UserRoleRedirectUrl': UserRoleRedirectUrl,
'UserToken': UserToken,
'RetailerGroupId': RetailerGroupId,
'Modified': JsonConverters.toJson(Modified,'DateTime',context!),
'Exists': Exists,
'DefaultVehicleType': DefaultVehicleType,
'DefaultRetailerGssn': DefaultRetailerGssn
};
getTypeName() => "Account";
TypeContext? context = _ctx;
}
class RefreshUserTokenResponse implements IConvertible
{
Account? Account;
bool? IsValid;
RefreshUserTokenResponse({this.Account,this.IsValid});
RefreshUserTokenResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Account = JsonConverters.fromJson(json['Account'],'Account',context!);
IsValid = json['IsValid'];
return this;
}
Map<String, dynamic> toJson() => {
'Account': JsonConverters.toJson(Account,'Account',context!),
'IsValid': IsValid
};
getTypeName() => "RefreshUserTokenResponse";
TypeContext? context = _ctx;
}
class RefreshUserTokenRequest implements IPost, IConvertible
{
RefreshUserTokenRequest();
RefreshUserTokenRequest.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "RefreshUserTokenRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'prod_api_auth_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
'Account': TypeInfo(TypeOf.Class, create:() => Account()),
'RefreshUserTokenResponse': TypeInfo(TypeOf.Class, create:() => RefreshUserTokenResponse()),
'RefreshUserTokenRequest': TypeInfo(TypeOf.Class, create:() => RefreshUserTokenRequest()),
});
Dart RefreshUserTokenRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/User/RefreshToken HTTP/1.1
Host: prod-api-auth-mb-dhc.rapp-customers.co.uk
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Account":{"GasUserId":"String","UserId":0,"UserRoleId":[0],"UserRoleRedirectUrl":"String","UserToken":"00000000000000000000000000000000","RetailerGroupId":"String","Modified":"\/Date(-62135596800000-0000)\/","Exists":false,"DefaultVehicleType":"String","DefaultRetailerGssn":"String"},"IsValid":false}