API - concepts

1 minute read


The API of Apiviz backend deals with several distinct concepts :

  • configuration’s collections : the several aspects to take innto account when you customize a dataviz website with Apiviz
  • models : the set of every document in every colleection corresponding to an UUID

COLLECTIONS AND CONFIGURATIONS

Schemas

Every collection and sometimes each document could have a specific schema corresponding to its own purppose. Still some fields are usually present for each document :

  • example :
{ "field"       : "app_languages",
  "app_version" : "1.0.0",
  "help"        : "The languages and default locale for your ApiViz instance",
  [...]
  "apiviz_front_uuid" : "c5efafab-1733-4ad1-9eb8-d529bc87c481",
  "is_default"  : True
}

Collections

the global collection

contains global configuration variables of your Apiviz’s instance

  • app_languages :
  • app_basic_dict :
  • app_screen_tabs :
  • app_logo :
  • app_title :
  • app_description :
  • app_keywords :
  • app_welcome :
  • app_pitch :
  • app_code :
  • app_indexing :
  • app_analytics :
  • app_support :

the navbar collection

One document to describe your navbar

  • app_navbar :

One document to describe your navbar

  • app_footer :

the tabs collection

You can register several tabs and point on their individual tab_uri

the endpoints collection

Endpoints are a crucial part of an Apiviz configuration. You can add as many new datasets, data filters as you want ; but there are also some fields designed for authentication only

the routes collection

the styles collection

The documents allowing to customize the styles and colors of your Apiviz’s instance

  • app_colors:
  • app_typo:
  • app_banners:
  • app_search_default_images_sets:

the socials collection

  • app_twitter :
  • app_facebook :
  • app_github :

Edit a configuration


MODELS

A model is defined by all documents in every collection corresponding to a specific UUID (aka apiviz_front_uuid)

Reusable models

A resusable model is a model whose app_title’s document has the field can_be_used_as_model as true.

  • example :
{ "field"       : "app_title",
  "app_version" : "1.0.0",
  "help"        : "Choose a title for your ApiViz instance",
  "content"     : "SoNum",
  "can_be_used_as_model" : True,
  "image_preview" : "https://raw.githubusercontent.com/co-demos/apiviz-frontend/master/documentation/screenshots/map-view-sonum-03.png",
  "apiviz_front_uuid" : "c5efafab-1733-4ad1-9eb8-d529bc87c481",
  "is_default"  : True
}

Create a new model from another

From the Apiviz website generator you can use a resuable model to create a complete and brand new model : it will use your new UUID and copy-paste the chosen template juste updating the UUID onn each document