Copyright 2009-2010 © Digital Bazaar, Inc.
This document defines a set of REST Web APIs to enable the legal transfer of commercialized digital content. These APIs enable new Web-based business models by specifying methods of interaction between user agents and web servers to exchange digital goods and ensure the subequent distribution of monetary compensation to the content distributors and rights holders.
This document is merely a public working draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organisation.



This section describes the media discovery, license acquisition, contract drafting, negotiating, data transfer, payment and file assembly process in detail.
This section contains all of the developer documentation for interacting with a PaySwarm network via a standard set of REST-based API calls. Programs written in Javascript Python, Ruby, C, C++, C#, Perl, and many other programming languages can be written to interact with a PaySwarm network via the following Web Services.
(
(
(
licenseAmount: string
)
or
(
licensePayees: array
)
)
and
(
licenseAmount: optional precisemoney
piecePayees: optional
(
array
and
each item matches
(
mediaId: optional integer range(0 - 4294967296)
description: optional string
min: optional string
amount: optional precisemoney
amountResolved: optional boolean
amountType: string
percentage: optional string
id: integer range(1 - 4294967296)
taxExempt: optional boolean
)
)
filePieceCount: optional integer range(1 - 4294967296)
licensePayees: optional
(
array
and
each item matches
(
mediaId: optional integer range(0 - 4294967296)
description: optional string
min: optional string
amount: optional precisemoney
amountResolved: optional boolean
amountType: string
percentage: optional string
id: integer range(1 - 4294967296)
taxExempt: optional boolean
)
)
dataPayees: optional
(
array
and
each item matches
(
mediaId: optional integer range(0 - 0)
description: optional string
min: optional string
amount: optional precisemoney
amountResolved: optional equals false
amountType:
(
equals PAYEE_AMOUNT_TYPE_FLATFEE
or
equals PAYEE_AMOUNT_TYPE_PLICENSE
or
equals PAYEE_AMOUNT_TYPE_PCUMULATIVE
or
equals PAYEE_AMOUNT_TYPE_PTOTAL
)
percentage: optional string
id: integer range(1 - 4294967296)
taxExempt: optional boolean
)
)
)
)( nodeuser: integer range(1 - 4294967296) )
( mediaIds: equals true fileId: fileid )
( nodeuser: integer range(1 - 4294967296) )
( nodeuser: integer range(1 - 4294967296) )
( payees: datapayees description: ( string and more than 1 character ) )
( nodeuser: integer range(1 - 4294967296) )
( payees: datapayees description: ( string and more than 1 character ) )
( nodeuser: integer range(1 - 4294967296) )
( nodeuser: integer range(1 - 4294967296) )
( ip: string token: ( string and less than 50 characters ) )
( start: optional integer range(0 - 4294967296) num: optional integer range(0 - 4294967296) relationship: optional regex("^(similar)$") )
( index: optional regex("^(contributors|media)$") list: optional integer range(1 - 4294967296) owner: optional integer range(1 - 4294967296) start: optional integer range(0 - 4294967296) num: optional integer range(1 - 50) genre: optional integer range(1 - 4294967296) query: optional ( string and more than 2 characters and less than 320 characters ) type: optional string )
( id: integer range(0 - 4294967296) )
( )
( nodeuser: integer range(1 - 4294967296) )
(
(
mediaId: integer range(1 - 4294967296)
id:
(
string
and
more than 1 character
)
description: optional string
)
and
(
(
fileInfo:
(
id: fileid
)
)
or
(
fileInfos:
(
array
and
more than 1 character
and
less than 1 characters
and
each item matches
(
id: fileid
)
)
)
)
and
(
(
payeeSchemeId: integer range(1 - 4294967296)
)
or
(
payees: datapayees
)
)
)( nodeuser: integer range(1 - 4294967296) )
( nodeuser: integer range(1 - 4294967296) )
( null or dynamiclicensepayees )
( nodeuser: integer range(1 - 4294967296) )
( index: integer range(0 - 4294967296) peerbuyKey: ( string and more than 1 character ) mediaId: integer range(1 - 4294967296) sellerProfileId: integer range(1 - 4294967296) bfpId: integer range(1 - 4294967296) csHash: ( string and more than 1 character ) fileId: ( string and more than 1 character ) size: integer range(0 - 4294967296) )
(
url:
(
string
and
more than 1 character
)
listingUpdateId: string
)(
url:
(
string
and
more than 1 character
)
)( nodeuser: integer range(1 - 4294967296) )
(
media:
(
licenseAmount: precisemoney
piecePayees: piecepayees
publicDomain: boolean
title: string
ccLicenses: string
payees: licensepayees
signature: string
releaseDate: regex("^[0-9]{4}-")
buyerId: integer range(1 - 4294967296)
signer:
(
userId: integer range(1 - 4294967296)
profileId: integer range(1 - 4294967296)
)
ownerId: integer range(1 - 4294967296)
distribution: string
payeeRules:
(
array
and
each item matches
(
mediaId: integer range(0 - 4294967296)
value: string
type: string
)
)
type: string
id: integer range(1 - 4294967296)
)
version: equals "3.0"
buyer:
(
username: optional string
userId: integer range(1 - 4294967296)
delegateId: optional integer range(1 - 4294967296)
profileId: integer range(1 - 4294967296)
)
sections:
(
map
and
each item matcheseach item matches
(
negotiationTerms: optional map
seller:
(
username: optional string
userId: integer range(1 - 4294967296)
serverId: integer range(1 - 4294967296)
url: string
)
webbuy: optional boolean
buyer:
(
username: optional string
userId: integer range(1 - 4294967296)
delegateId: optional integer range(1 - 4294967296)
profileId: integer range(1 - 4294967296)
)
ware:
(
id:
(
string
and
more than 1 character
)
)
contractId: optional integer range(0 - 4294967296)
)
)
id: integer range(0 - 4294967296)
)( date: regex("^[2-9][0-9]{3}-") section: ( ( sellerSignature: string seller: ( username: optional string url: string userId: integer range(1 - 4294967296) profileId: integer range(1 - 4294967296) serverId: integer range(1 - 4294967296) ) buyerSignature: string buyer: ( username: optional string userId: integer range(1 - 4294967296) delegateId: optional integer range(1 - 4294967296) profileId: integer range(1 - 4294967296) accountId: integer range(1 - 4294967296) ) ware: ( mediaId: integer range(1 - 4294967296) payees: warepayees id: ( string and more than 1 character ) description: optional string ) contractId: integer range(1 - 4294967296) ) and ( ( webbuy: equals true ware: ( fileInfos: ( array and each item matches ( contentType: string extension: string pieces: optional ( map and less than 0 characters ) mediaId: integer range(1 - 4294967296) size: integer range(1 - 4294967296) id: string contentSize: integer range(1 - 4294967296) ) ) ) ) or ( webbuy: optional equals false ware: ( fileInfos: ( array and each item matches ( contentType: string extension: string pieces: optional ( array and each item matches ( index: integer range(0 - 4294967296) ciphered: boolean encrypted: boolean sellerSignature: string bfpSignature: string pieceKey: optional ( data: string length: integer range(1 - 4294967296) algorithm: string ) openKey: optional ( data: string length: integer range(1 - 4294967296) algorithm: string ) sellerProfileId: integer range(1 - 4294967296) bfpId: integer range(1 - 4294967296) size: integer range(0 - 4294967296) ) ) mediaId: integer range(1 - 4294967296) size: integer range(1 - 4294967296) id: string contentSize: integer range(1 - 4294967296) ) ) ) ) ) ) )
( mediaId: integer range(1 - 4294967296) preferences: ( array and each item matches ( mediaIds: optional ( array and each item matchesinteger range(1 - 4294967296) ) preferences: ( array and each item matches ( ( contentType: regex("^audio/.+$") minBitrate: integer range(1 - 4294967296) ) or ( contentType: regex("^video/.+$") videoCodec: string ) ) ) ) ) )
(
(
media:
(
licenseAmount: precisemoney
piecePayees: piecepayees
publicDomain: boolean
title: string
ccLicenses: string
payees: licensepayees
signature: string
releaseDate: regex("^[0-9]{4}-")
buyerId: integer range(1 - 4294967296)
signer:
(
userId: integer range(1 - 4294967296)
profileId: integer range(1 - 4294967296)
)
ownerId: integer range(1 - 4294967296)
distribution: string
payeeRules:
(
array
and
each item matches
(
mediaId: integer range(0 - 4294967296)
value: string
type: string
)
)
type: string
id: integer range(1 - 4294967296)
)
version: equals "3.0"
buyer:
(
username: optional string
userId: integer range(1 - 4294967296)
delegateId: optional integer range(1 - 4294967296)
profileId: integer range(1 - 4294967296)
accountId: integer range(1 - 4294967296)
)
sections: optional
(
map
and
less than 0 characters
)
id: integer range(0 - 0)
)
and
)(
token:
(
string
and
less than 50 characters
)
host: string
timeout: integer range(15 - 30)
path: string
sellerId: integer range(1 - 4294967296)
port: integer range(1 - 65535)
)( os: string id: integer range(1 - 4294967296) apiVersion: string cpuType: string )
No normative references.
No informative references.