| POST | /v1/links/unclaimed |
|---|
"use strict";
export class PostLinkCreationRequestBase {
/** @param {{url?:string,domain?:string,parameterKeyValues?:{ [index:string]: string; }}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
url;
/** @type {string} */
domain;
/** @type {{ [index:string]: string; }} */
parameterKeyValues;
}
export class ProductMetadata extends ProductMetadata {
/** @param {{title?:string,author?:string,url?:string,description?:string,retailer?:string,productImages?:{ [index:string]: string; }}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
}
export class PostLinkCreationResponse {
/** @param {{success?:boolean,linkResult?:string,destinations?:ProductMetadata[],responseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {boolean} */
success;
/** @type {string} */
linkResult;
/** @type {ProductMetadata[]} */
destinations;
/** @type {ResponseStatus} */
responseStatus;
}
export class AffiliateTokens {
/** @param {{guid?:string,programGuid?:string,affiliateTokens?:{ [index:string]: string; }}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
guid;
/** @type {string} */
programGuid;
/** @type {{ [index:string]: string; }} */
affiliateTokens;
}
export class PostUnclaimedLinkCreationRequest extends PostLinkCreationRequestBase {
/** @param {{affiliatePrograms?:AffiliateTokens[],url?:string,domain?:string,parameterKeyValues?:{ [index:string]: string; }}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {AffiliateTokens[]} */
affiliatePrograms;
}
export class ProductMetadata {
/** @param {{title?:string,author?:string,url?:string,description?:string,retailer?:string,productImages?:{ [index:string]: string; }}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
title;
/** @type {string} */
author;
/** @type {string} */
url;
/** @type {string} */
description;
/** @type {string} */
retailer;
/** @type {{ [index:string]: string; }} */
productImages;
}
JavaScript PostUnclaimedLinkCreationRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/links/unclaimed HTTP/1.1
Host: api.booklinker.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
affiliatePrograms:
[
{
affiliateTokens:
{
String: String
}
}
],
url: String,
domain: String,
parameterKeyValues:
{
String: String
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
success: False,
linkResult: String,
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}