Configurations Model

Action

Method

Resource

Description

Get all

GET

/configs

Get all configurations.

Get

GET

/configs/:config_id

Get configuration with id config_id.

Create

POST

/configs

Create a configuration.

Update

PUT

/configs/:config_id

Update configuration with config_id.

Delete

DELETE

/configs/:config_id

Delete configuration with config_id.

The configuration model is composed of the following attributes:

Attribute

Type

Required

Description

key

string

no, required on create

The configuration's key.

value

string

no, required on create

The configuration's value.

name

string

no

The configuration's name.

description

string

no

The configuration's Description.

type

integer

no, required to create

The configuration's type.

enabled

boolean

no

The configuration is enabled.

public

boolean

no

The configuration is public.

config_category_id

integer

no

The Config category identifier if belong to one

options

JSON

no, required if type 2, 3 o 4

The options which can be used to value config

image

string

no

The image of the config.

video

string

no

The video of the config

more_info

string

no

More details about the info

support_url

string

no

The url to go to Config documentation

protected

boolean

no

This mark the configs con value protected so always return "PROTECT" as a value

dependency_key

string

no

Mark is depend on other config key

dependency_value

string

no

Mark wich value must have the config key

rank

integer

no

This attribute is only to order the configs

required

boolean

no

The configuration if mandatory

🚧

Only users type Administrator can get, find, create, update or remove configurations.

Types

The configuration type is used to tell the front end how the options should be displayed and how they should be received so that the api understands them.

  • Type 1: Is only a value can be anything
  • Type 2: Is only a value but, must me a value of one of the options for this config
  • Type 3: have multiple values of the options with the folowin format "1|2|3|4" (values separated by |)
  • Type 4: Have multiple values in an array "[1,2,3,4]"

Options

The options must have the following structure to be accepted

[
    {
    "text": "TEXT",
    "value": "VALUE"
    },
  ....
]