Reference

ISCN(iscn-dev) web widget API Reference

Introduction

This is a PoC web widget connected to iscn-dev network for testing/demo/development purpose. We will update this widget later when ISCN feature is released on our production chain.

Formatting the widget URL

Base URL

Testnet: https://rinkeby.like.co/in/widget/iscn/dev

Production: https://like.co/in/widget/iscn/dev

Input Params

Query String

Description

fingerprint

IPFS hash of content, cid v0

type

Type of content, default is article

tags

(optional) list of tags separated by comma

title

Title of the content

license

License of the content. Fixed as CCSA 4.0 for now if publisher is not set

publisher

(optional) name of the platform if your content was published through a platform. Currently only matters is valid option.

state

(optional) local state to be passed back after signing success, used for data/security purpose

redirect_uri

(optional) Act as a whitelist host for postMessage, actual redirect is not implemented, please use with opener below

opener

(optional) default false. If set, would fire a postMessage back to window.opener with redirect_uri host as target, then close current window

blocking

(optional) default false, wait until transaction is confirmed before finishing

Output Params

Query String

Description

tx_hash

transaction hash of resulting payment, verify status using transaction status query API

error

set if any catchable error occur

success

only if blocking is set, return true if transaction success

state

locale state that was passed as input, used for data/security purpose

PostMessage format

if opener and redirect_uri is set, the widget would fire a postMessage to redirect_uri 's origin.

const message = JSON.stringify({
action: 'ISCN_SUBMITTED',
data: {
tx_hash,
error,
state,
success,
},
});
this.windowOpener.postMessage(message, this.redirectOrigin);
window.close();

Following links are in testnet.