API

C3 have a REST-API connector that makes it possible to read data directly from a data base. When reading from this kind of data source C3 just read one node at a time and don't have to load the complete data file in memory, this approach is better when dealing with bid data sources.

Settings

First set up URL, user and password. The URL is a base URL and all calls below adds to the base URL.

  • For example http://www.c3.com/api/api-version
  • Within <xml> in the response is the data delivered.
  • When you should add an ID below we indicates this with double zero 00

Methods

Version

API version returns version of this api spec

GET /api-version

< 200
< Accept: application/xml; application/json
< Content-Type: application/xml 
<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <api-version>1.0</api-version>
</xml>

Language

Language list the avaliable languages. This list populates the Language Drop Down in C3.

GET /languages

< 200
< Accept: application/xml; application/json
< Content-Type: application/xml 
<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <lang type="lang" id="en" label="English" href="http://rest.myserver.com/c3-database/languages/en"/>
    <lang type="lang" id="se" label="Swedish" href="http://rest.myserver.com/c3-database/languages/se"/>
    <lang type="lang" id="no" label="Norwegian" href="http://rest.myserver.com/c3-database/languages/no"/>
    <lang type="lang" id="fi" label="Finnish" href="http://rest.myserver.com/c3-database/languages/fi"/>
    <lang type="lang" id="da" label="Danish" href="http://rest.myserver.com/c3-database/languages/da"/>
    <lang type="lang" id="fr" label="French" href="http://rest.myserver.com/c3-database/languages/fr"/>
    <lang type="lang" id="cz" label="Czech" href="http://rest.myserver.com/c3-database/languages/cz"/>
</xml>

List

List delivers the structure of the data. List creates the tree in the browser, one level at at time.

GET /list

Listar rootnivån

GET /list

< 200
< Accept: application/xml; application/json
< Content-Type: application/xml 
<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <library ctrlid="00" type="library" label="The C3 Database" href="http://rest.myserver.com/c3-database/list"/>
</xml>
GET /list/id/00

List the sub nodes of the id.

GET /list/id/00

< 200
< Accept: application/xml; application/json
< Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <section ctrlid="0.1" type="section" label="Section one" href="http://rest.myserver.com/c3-database/list/1.1"/>
    <section ctrlid="0.2" type="section" label="Section two" href="http://rest.myserver.com/c3-database/list/1.1"/>
</xml>

Item Content

Item Content deliver the content of a node. This is the content that is placed in the document.

GET /item/content/id/00

Läser information

GET /item/content/id/0.2.1

< 200
< Accept: application/xml; application/json
< Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <article type="article" label="First article" ctrlid="0.2.1">
        <p class="Heading">My Article Heading</p>
        <p class="Ingress">The life of C3</p>
        <p class="Body">A long time ago, in a galaxy far, far away...</p>
    </article>
</xml>
POST /item/content/id/00

Write back information

POST /item/content/id/0.2.1

< 200
< Accept: application/xml; application/json
< Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<xml>
    <article type="article" label="First article" ctrlid="0.2.1">
        <p class="Heading">My Article Heading</p>
        <p class="Ingress">The life of C3</p>
        <p class="Body">A long time ago, in a galaxy far, far away...</p>
    </article>
</xml>

results matching ""

    No results matching ""