Booklinker.API

<back to all web services

PostAffiliateTokensRequest

Requires Authentication
The following routes are available for this service:
POST/v1/affiliate-tokens
import 'package:servicestack/servicestack.dart';

// @DataContract
class AffiliateTokensBaseResponse implements IConvertible
{
    // @DataMember(Name="success")
    bool? success;

    // @DataMember(Name="responseStatus")
    ResponseStatus? responseStatus;

    AffiliateTokensBaseResponse({this.success,this.responseStatus});
    AffiliateTokensBaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        success = json['success'];
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'success': success,
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

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

// @DataContract
class PostAffiliateTokensResponse extends AffiliateTokensBaseResponse implements IConvertible
{
    PostAffiliateTokensResponse();
    PostAffiliateTokensResponse.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "PostAffiliateTokensResponse";
    TypeContext? context = _ctx;
}

// @DataContract
class PostAffiliateTokensRequest implements IConvertible
{
    // @DataMember(Name="parameters")
    Map<String,String?>? parameters;

    // @DataMember(Name="programGuid")
    String? programGuid;

    PostAffiliateTokensRequest({this.parameters,this.programGuid});
    PostAffiliateTokensRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        parameters = JsonConverters.toStringMap(json['parameters']);
        programGuid = json['programGuid'];
        return this;
    }

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

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

TypeContext _ctx = TypeContext(library: 'api.booklinker.com', types: <String, TypeInfo> {
    'AffiliateTokensBaseResponse': TypeInfo(TypeOf.Class, create:() => AffiliateTokensBaseResponse()),
    'PostAffiliateTokensResponse': TypeInfo(TypeOf.Class, create:() => PostAffiliateTokensResponse()),
    'PostAffiliateTokensRequest': TypeInfo(TypeOf.Class, create:() => PostAffiliateTokensRequest()),
});

Dart PostAffiliateTokensRequest DTOs

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

HTTP + OTHER

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

POST /v1/affiliate-tokens HTTP/1.1 
Host: api.booklinker.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"parameters":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"success":false,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}