Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Create a Content Library

Serban Simu edited this page Nov 3, 2018 · 2 revisions

Create a Content Library

A Content Library is created in a Content Space.

It is identified by an ID of the form ilib7ZTNtob8RpatynHQy3sS1w

API reference: content-libraries

Create a simple, unauthenticated Content Library

Note: this is only allowed in a dev Content Fabric instance configured for authentication bypass

curl -X POST http://q.contentfabric.io/qlibs
{"id":"ilib7ZTNtob8RpatynHQy3sS1w","qid":"iq__7ZTNtob8RpatynHQy3sS1w"}

This will return the library ID. To check the library object:

curl http://localhost:8008/qlibs/ilib7ZTNtob8RpatynHQy3sS1w
{"id":"ilib7ZTNtob8RpatynHQy3sS1w","qid":"iq__7ZTNtob8RpatynHQy3sS1w"}

To list the contents of the library:

curl http://localhost:8008/qlibs/ilib7ZTNtob8RpatynHQy3sS1w/q

Create a blockchain-backed Content Library

Given a Content Space, for example ispcjALidS82U9EjuffFUnFWE32dHGG

  1. Execute a blockchain transaction on the Content Space contract createLibrary
  • Retrieve the resulting transaction ID txid and contract address.
  1. Create an authorization token - How to Create an Authorization Token
  • Use your blockchain address addr and the transaction ID obtained above txid
  1. Convert the contract address to a Content Fabric multi-format
  • For example TODO
  1. Create the Content Library
curl -X POST http://q.contentfabric.io/qlibs -H "Authorization: Bearer ********"
{"id":"ilib7ZTNtob8RpatynHQy3sS1w","qid":"iq__7ZTNtob8RpatynHQy3sS1w"}