POST | /share/refer-business-link-used | A business referral link was used | Validates the JWT token with the identity of the referring user and the place, and returns relevant information. |
---|
library ConsumerApi;
import 'package:servicestack/servicestack.dart';
class ReferBusinessUser implements IConvertible
{
String? firstName;
String? lastName;
String? profilePhotoUrl;
ReferBusinessUser({this.firstName,this.lastName,this.profilePhotoUrl});
ReferBusinessUser.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
firstName = json['firstName'];
lastName = json['lastName'];
profilePhotoUrl = json['profilePhotoUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'firstName': firstName,
'lastName': lastName,
'profilePhotoUrl': profilePhotoUrl
};
getTypeName() => "ReferBusinessUser";
TypeContext? context = _ctx;
}
class ReferredPlace implements IConvertible
{
int? id;
String? guid;
String? name;
String? logoUrl;
String? imageUrl;
ReferredPlace({this.id,this.guid,this.name,this.logoUrl,this.imageUrl});
ReferredPlace.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
guid = json['guid'];
name = json['name'];
logoUrl = json['logoUrl'];
imageUrl = json['imageUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'guid': guid,
'name': name,
'logoUrl': logoUrl,
'imageUrl': imageUrl
};
getTypeName() => "ReferredPlace";
TypeContext? context = _ctx;
}
enum ReferBusinessState
{
SignInToSee,
Available,
CanNotReferYourself,
AlreadyClaimedByYou,
AlreadyClaimedBySomeoneElse,
Expired,
}
class ReferBusinessLinkUsedResponse implements IConvertible
{
ReferBusinessUser? referringUser;
ReferredPlace? referredPlace;
ReferBusinessState? state;
ReferBusinessLinkUsedResponse({this.referringUser,this.referredPlace,this.state});
ReferBusinessLinkUsedResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
referringUser = JsonConverters.fromJson(json['referringUser'],'ReferBusinessUser',context!);
referredPlace = JsonConverters.fromJson(json['referredPlace'],'ReferredPlace',context!);
state = JsonConverters.fromJson(json['state'],'ReferBusinessState',context!);
return this;
}
Map<String, dynamic> toJson() => {
'referringUser': JsonConverters.toJson(referringUser,'ReferBusinessUser',context!),
'referredPlace': JsonConverters.toJson(referredPlace,'ReferredPlace',context!),
'state': JsonConverters.toJson(state,'ReferBusinessState',context!)
};
getTypeName() => "ReferBusinessLinkUsedResponse";
TypeContext? context = _ctx;
}
class ReferBusinessLinkUsedRequest implements IPost, IConvertible
{
String? referBusinessToken;
ReferBusinessLinkUsedRequest({this.referBusinessToken});
ReferBusinessLinkUsedRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
referBusinessToken = json['referBusinessToken'];
return this;
}
Map<String, dynamic> toJson() => {
'referBusinessToken': referBusinessToken
};
getTypeName() => "ReferBusinessLinkUsedRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'ConsumerApi', types: <String, TypeInfo> {
'ReferBusinessUser': TypeInfo(TypeOf.Class, create:() => ReferBusinessUser()),
'ReferredPlace': TypeInfo(TypeOf.Class, create:() => ReferredPlace()),
'ReferBusinessState': TypeInfo(TypeOf.Enum, enumValues:ReferBusinessState.values),
'ReferBusinessLinkUsedResponse': TypeInfo(TypeOf.Class, create:() => ReferBusinessLinkUsedResponse()),
'ReferBusinessLinkUsedRequest': TypeInfo(TypeOf.Class, create:() => ReferBusinessLinkUsedRequest()),
});
Dart ReferBusinessLinkUsedRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /share/refer-business-link-used HTTP/1.1
Host: unstable-consumer-api.brovs.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ReferBusinessLinkUsedRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Api.Dto">
<ReferBusinessToken>String</ReferBusinessToken>
</ReferBusinessLinkUsedRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ReferBusinessLinkUsedResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Api.Dto"> <ReferredPlace> <Guid>00000000-0000-0000-0000-000000000000</Guid> <Id>0</Id> <ImageUrl>String</ImageUrl> <LogoUrl>String</LogoUrl> <Name>String</Name> </ReferredPlace> <ReferringUser> <FirstName>String</FirstName> <LastName>String</LastName> <ProfilePhotoUrl>String</ProfilePhotoUrl> </ReferringUser> <State>SignInToSee</State> </ReferBusinessLinkUsedResponse>