NAV
shell

Introduction

Welcome to the BI Book API!

Authentication

BI Book uses tokens to allow access to the API.

BI Book expects for the token to be included in all API requests to the server in a header that looks like the following:

Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Endpoints

Manage forms

GET /api/dataroom/:company_id/forms - retrieve all company forms

GET /api/dataroom/:company_id/forms/:id - retrieve single form

POST /api/dataroom/:company_id/forms - create new form

PATCH /api/dataroom/:company_id/forms/:id - update form

DELETE /api/dataroom/:company_id/forms/:id - delete form

Retrieve results

GET /api/dataroom/:company_id/users - retrieve all company users that have filled forms

GET /api/dataroom/:company_id/results - retrieve all company filled forms

GET /api/dataroom/:company_id/results/:user_id - retrieve all users filled forms

GET /api/dataroom/:company_id/results/:user_id/:form_id - retrieve single filled form

PATCH /api/dataroom/:company_id/results/:user_id/:form_id - create or update filled form

Manage rights

GET /api/dataroom/form_accessed_users/:form_id/users - retrieve all accessed users

PATCH /api/dataroom/form_accessed_users/:form_id/users/:user_id/enable - enable form for user

PATCH /api/dataroom/form_accessed_users/:form_id/users/:user_id/disable - disable form for user

Manage forms

Retrieve all company forms

curl "https://bibook.com/api/dataroom/:company_id/forms" -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The above command returns JSON structured like this:

{
  "dataroom_forms": [
    {
      "id": 10,
      "name": "Tempsoft",
      "visible": "ALL",
      "editable": "ALL",
      "company_id": 9,
      "language": "fi",
      "fields": [
        {
          "id": 1,
          "name": "Field_1_short_text",
          "visible": "ALL",
          "editable": "ALL",
          "fieldtype": "SHORT_TEXT",
          "attributes": {},
          "displayname": "Field #1 Short Text Displayname"
        },
        {
          "id": 2,
          "name": "Field_2_long_text",
          "visible": "ALL",
          "editable": "ALL",
          "fieldtype": "LONG_TEXT",
          "attributes": {},
          "displayname": "Field #2 Long Text Displayname"
        },
        {
          "id": 3,
          "name": "Field_3_dropdown",
          "visible": "ALL",
          "editable": "ALL",
          "fieldtype": "DROPDOWN",
          "attributes": {
            "options": [
              {
                "text": "String value",
                "value": "a"
              },
              {
                "text": "Integer value",
                "value": 1
              },
              {
                "text": "Boolean value",
                "value": true
              }
            ]
          },
          "displayname": "Field #3 Dropdown Displayname"
        },
        {
          "id": 4,
          "name": "Field_4_radio",
          "visible": "ALL",
          "editable": "ALL",
          "fieldtype": "RADIO",
          "attributes": {
            "options": [
              {
                "text": "String value",
                "value": "a"
              },
              {
                "text": "Integer value",
                "value": 1
              },
              {
                "text": "Boolean value",
                "value": true
              }
            ]
          },
          "displayname": "Field #4 Radio Displayname"
        },
        {
          "id": 5,
          "name": "Field_5_checkbox",
          "visible": "ALL",
          "editable": "ALL",
          "fieldtype": "CHECKBOX",
          "attributes": {},
          "displayname": "Field #5 CheckBox Displayname"
        },
        {
          "id": 6,
          "name": "Field_6_table",
          "visible": "ALL",
          "editable": "ALL",
          "fieldtype": "TABLE",
          "attributes": {
            "settings": {
              "custom_rows": true,
              "show_column_totals": false
            },
            "columns": {
              "items": {
                "column1": {
                  "displayname": "Column1",
                  "datatype": "SHORT_TEXT",
                  "visible": "ALL",
                  "editable": "ALL",
                  "attributes": {
                    "format": {
                      "bold": true
                    } 
                  }
                },
                "column2": {
                  "displayname": "Column2",
                  "datatype": "NUMBER",
                  "visible": "ALL",
                  "editable": "ALL"
                },
                "column3": {
                  "displayname": "Column3",
                  "datatype": "DROPDOWN",
                  "visible": "ALL",
                  "editable": "ALL",
                  "options": [
                    {
                      "text": "Option1",
                      "value": 1
                    },
                    {
                      "text": "Option2",
                      "value": 2
                    }
                  ],
                  "default_value": 1
                }
              },
              "list": [
                "column1",
                "column2",
                "column3"
              ]
            },
            "rows": {
              "items": {
                "row1": {
                  "displayname": "Row1",
                  "visible": "ALL",
                  "editable": "ALL"
                },
                "row2": {
                  "displayname": "Row2",
                  "visible": "ALL",
                  "editable": "ALL"
                }
              },
              "list": [
                "row1",
                "row2"
              ]
            }
          },
          "displayname": "Field #6 Table Displayname"
        }
      ],
      "form_type": "Custom",
      "multi_entries": false,
      "multi_entries_result_visibility": "ADMIN"
    }
  ]
}

This endpoint retrieves all company forms.

HTTP Request

GET https://bibook.com/api/dataroom/:company_id/forms

Query Parameters

Parameter Default Description
company_id None Id of company

Retrieve single company form

curl "https://bibook.com/api/dataroom/:company_id/forms/:form_id" -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The above command returns JSON structured like this:

{
  "dataroom_form": {
    "id": 10,
    "name": "Tempsoft",
    "visible": "ALL",
    "editable": "ALL",
    "company_id": 9,
    "language": "fi",
    "fields": [
      {
        "id": 1,
        "name": "Field_1_short_text",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "SHORT_TEXT",
        "attributes": {},
        "displayname": "Field #1 Short Text Displayname"
      },
      {
        "id": 2,
        "name": "Field_2_long_text",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "LONG_TEXT",
        "attributes": {},
        "displayname": "Field #2 Long Text Displayname"
      },
      {
        "id": 3,
        "name": "Field_3_dropdown",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "DROPDOWN",
        "attributes": {
          "options": [
            {
              "text": "String value",
              "value": "a"
            },
            {
              "text": "Integer value",
              "value": 1
            },
            {
              "text": "Boolean value",
              "value": true
            }
          ]
        },
        "displayname": "Field #3 Dropdown Displayname"
      },
      {
        "id": 4,
        "name": "Field_4_radio",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "RADIO",
        "attributes": {
          "options": [
            {
              "text": "String value",
              "value": "a"
            },
            {
              "text": "Integer value",
              "value": 1
            },
            {
              "text": "Boolean value",
              "value": true
            }
          ]
        },
        "displayname": "Field #4 Radio Displayname"
      },
      {
        "id": 5,
        "name": "Field_5_checkbox",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "CHECKBOX",
        "attributes": {},
        "displayname": "Field #5 CheckBox Displayname"
      },
      {
        "id": 6,
        "name": "Field_6_table",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "TABLE",
        "attributes": {
          "settings": {
            "custom_rows": true,
            "show_column_totals": false
          },
          "columns": {
            "items": {
              "column1": {
                "displayname": "Column1",
                "datatype": "SHORT_TEXT",
                "visible": "ALL",
                "editable": "ALL",
                "attributes": {
                  "format": {
                    "bold": true
                  }
                }
              },
              "column2": {
                "displayname": "Column2",
                "datatype": "NUMBER",
                "visible": "ALL",
                "editable": "ALL"
              },
              "column3": {
                "displayname": "Column3",
                "datatype": "DROPDOWN",
                "visible": "ALL",
                "editable": "ALL",
                "options": [
                  {
                    "text": "Option1",
                    "value": 1
                  },
                  {
                    "text": "Option2",
                    "value": 2
                  }
                ],
                "default_value": 1
              }
            },
            "list": ["column1", "column2", "column3"] },
          "rows": {
            "items": {
              "row1": { 
                "displayname": "Row1",
                "visible": "ALL",
                "editable": "ALL"
              },
              "row2": { 
                "displayname": "Row2",
                "visible": "ALL",
                "editable": "ALL"
              } },
            "list": ["row1", "row2"] }
        },
        "displayname": "Field #6 Table Displayname"
      }
    ],
    "form_type": "Custom",
    "multi_entries": false,
    "multi_entries_result_visibility": "ADMIN"
  }
}

This endpoint retrieves single form by company_id and form_id.

HTTP Request

GET https://bibook.com/api/dataroom/:company_id/forms/:form_id

Query Parameters

Parameter Default Description
company_id None ID of company
form_id None ID of form

Create new form

curl "https://bibook.com/api/dataroom/:company_id/forms" -X POST -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{"dataroom_form":{"name":"Zoolab","visible": "ALL","editable": "ALL","company_id":8,"language":"fi","form_type":"Budget","fields":[{"id":1,"name":"Field_1_short_text","visible": "ALL","editable": "ALL","fieldtype":"SHORT_TEXT","attributes":{},"displayname":"Field #1 Short Text Displayname"},{"id":2,"name":"Field_2_long_text","visible": "ALL","editable": "ALL","fieldtype":"LONG_TEXT","attributes":{},"displayname":"Field #2 Long Text Displayname"},{"id":3,"name":"Field_3_dropdown","visible": "ALL","editable": "ALL","fieldtype":"DROPDOWN","default_value":"a","attributes":{"options":[{"text":"Nil value","value":null},{"text":"String value","value":"a"},{"text":"Integer value","value":1},{"text":"Boolean value","value":true}]},"displayname":"Field #3 Dropdown Displayname"},{"id":4,"name":"Field_4_radio","visible": "ALL","editable": "ALL","fieldtype":"RADIO","attributes":{"options":[{"text":"Nil value","value":null},{"text":"String value","value":"a"},{"text":"Integer value","value":1},{"text":"Boolean value","value":true}]},"displayname":"Field #4 Radio Displayname"},{"id":5,"name":"Field_5_checkbox","visible": "ALL","editable": "ALL","fieldtype":"CHECKBOX","attributes":{},"displayname":"Field #5 CheckBox Displayname"},{"id":6,"name":"Field_6_table","visible": "ALL","editable": "ALL","fieldtype":"TABLE","attributes":{"settings":{"custom_rows":true,"show_column_totals":false},"columns":{"items":{"column1":{"displayname":"Column1", "datatype":"SHORT_TEXT","visible": "ALL","editable": "ALL","attributes":{"format": {"bold": true}}},"column2":{"displayname":"Column2", "datatype":"NUMBER","visible": "ALL","editable": "ALL"},"column3":{"displayname":"Column3", "datatype":"DROPDOWN","visible": "ALL","editable": "ALL","options":[{"text":"Option1","value":1},{"text":"Option2","value":2}],"default_value":1}},"list":["column1", "column2", "column3"]},"rows":{"items":{"row1":{"displayname":"Row1","visible": "ALL","editable": "ALL"}, "row2":{"displayname":"Row2","visible": "ALL","editable": "ALL"}},"list":["row1", "row2"]}},"displayname":"Field #6 Table Displayname"}]}}'

The above command returns JSON structured like this:

{
  "dataroom_form": {
    "id": 10,
    "name": "Tempsoft",
    "visible": "ALL",
    "editable": "ALL",
    "company_id": 9,
    "language": "fi",
    "fields": [
      {
        "id": 1,
        "name": "Field_1_short_text",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "SHORT_TEXT",
        "attributes": {},
        "displayname": "Field #1 Short Text Displayname"
      },
      {
        "id": 2,
        "name": "Field_2_long_text",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "LONG_TEXT",
        "attributes": {},
        "displayname": "Field #2 Long Text Displayname"
      },
      {
        "id": 3,
        "name": "Field_3_dropdown",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "DROPDOWN",
        "default_value": "a",
        "attributes": {
          "options": [
            {
              "text": "String value",
              "value": "a"
            },
            {
              "text": "Integer value",
              "value": 1
            },
            {
              "text": "Boolean value",
              "value": true
            }
          ]
        },
        "displayname": "Field #3 Dropdown Displayname"
      },
      {
        "id": 4,
        "name": "Field_4_radio",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "RADIO",
        "attributes": {
          "options": [
            {
              "text": "String value",
              "value": "a"
            },
            {
              "text": "Integer value",
              "value": 1
            },
            {
              "text": "Boolean value",
              "value": true
            }
          ]
        },
        "displayname": "Field #4 Radio Displayname"
      },
      {
        "id": 5,
        "name": "Field_5_checkbox",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "CHECKBOX",
        "attributes": {},
        "displayname": "Field #5 CheckBox Displayname"
      },
      {
        "id": 6,
        "name": "Field_6_table",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "TABLE",
        "attributes": {
          "settings": {
            "custom_rows": false,
            "show_column_totals": false
          },
          "columns": {
            "items": {
              "column1": {
                "displayname": "Column1",
                "datatype": "SHORT_TEXT",
                "visible": "ALL",
                "editable": "ALL",
                "attributes": {
                  "format": {
                    "bold": true
                  }
                }
              },
              "column2": {
                "displayname": "Column2",
                "datatype": "NUMBER",
                "visible": "ALL",
                "editable": "ALL"
              },
              "column3": {
                "displayname": "Column3",
                "datatype": "DROPDOWN",
                "visible": "ALL",
                "editable": "ALL",
                "options": [
                  {
                    "text": "Option1",
                    "value": 1
                  },
                  {
                    "text": "Option2",
                    "value": 2
                  }
                ],
                "default_value": 1
              }
            },
            "list": [
              "column1",
              "column2",
              "column3"
            ]
          },
          "rows": {
            "items": {
              "row1": {
                "displayname": "Row1",
                "visible": "ALL",
                "editable": "ALL"
              },
              "row2": {
                "displayname": "Row2",
                "visible": "ALL",
                "editable": "ALL"
              }
            },
            "list": [
              "row1",
              "row2"
            ]
          }
        },
        "displayname": "Field #6 Table Displayname"
      }
    ],
    "form_type": "Budget",
    "multi_entries": false,
    "multi_entries_result_visibility": "ADMIN"
  }
}

This endpoint creates new form.

HTTP Request

POST https://bibook.com/api/dataroom/:company_id/forms

Query Parameters

Parameter Default Description
company_id None ID of company

Request Body

Level Parent Name Type Description
root None "dataroom_form" Object root element
1 "dataroom_form" "name" String name of form
1 "dataroom_form" "company_id" Integer Id of company, form belongs to
1 "dataroom_form" "visible" String is form visible for users, allowed values: 'ALL', 'ADMIN', 'NONE'
1 "dataroom_form" "editable" String is form able to be edited by user, allowed values: 'ALL', 'ADMIN', 'NONE'
1 "dataroom_form" "fields" Array array of Field objects
1 "dataroom_form" "language" String Language of form, allowed values: 'en', 'fi', 'sv'
1 "dataroom_form" "form_type" String form type, allowed values: 'Custom', 'Budget', 'Budget_pivoted', 'Forecast'
1 "dataroom_form" "multi_entries" Boolean form multi entries
1 "dataroom_form" "multi_entries_result_visibility" String form multi entries visible for users
2 []"fields" "id" Integer Id of form field, determines display ordering
2 []"fields" "name" String name of form field for results serializing
2 []"fields" "displayname" String name of form field during displaying
2 []"fields" "fieldtype" String type of form field, determines input kind, allowed values: 'SHORT_TEXT', 'LONG_TEXT', 'DROPDOWN', 'RADIO', 'CHECKBOX', 'TABLE'
2 []"fields" "visible" String is field visible for users, allowed values: 'ALL', 'ADMIN', 'NONE'
2 []"fields" "editable" String is field able to be edited by user, allowed values: 'ALL', 'ADMIN', 'NONE'
2 []"fields" "attributes" Object field attributes, required for 'DROPDOWN' and 'RADIO' fieldtypes
2 []"fields" "default_value" String, Integer, Boolean Value of input, optional for 'DROPDOWN' and 'RADIO' fieldtypes
3 "attributes" "options" Array selectable options for 'DROPDOWN' and 'RADIO' fieldtypes
4 []"options" "text" String Label for input option
4 []"options" "value" String, Integer, Boolean Value of input option
3 "attributes" "settings" Object settings for 'TABLE' fieldtype
4 "settings" "custom_rows" Boolean is table able to be added row by user
4 "settings" "show_column_totals" Boolean the row "Totals" will be added to the table
3 "attributes" "columns" Object table columns for 'TABLE' fieldtype
4 "columns" "list" Array table columns list items keys. Example: ["column1"]
4 "columns" "items" Object table columns items with keys
5 "columns"."items" "column1" Object table column with key column1
6 "column1" "displayname" String table column with key column1 display name
6 "column1" "datatype" String type of table column, determines input kind, allowed values: 'SHORT_TEXT', 'NUMBER', 'DROPDOWN'
6 "column1" "visible" String is column visible for users, allowed values: 'ALL', 'ADMIN', 'NONE'
6 "column1" "editable" String is column able to be edited by user, allowed values: 'ALL', 'ADMIN', 'NONE'
6 "column1" "default_value" String, Integer, Boolean Value of input, optional for table column 'DROPDOWN' datatype
6 "column1" "options" Array selectable options, required for for table column 'DROPDOWN' datatype
7 "column1"[]"options" "text" String Label for table column input option
7 "column1"[]"options" "value" String, Integer, Boolean Value of table 'DROPDOWN' column input option
6 "column1" "attributes" Object table column other attributes
7 "column1"."attributes" "format" Object table column CSS format attributes
8 "column1"."attributes"."format" "bold" Boolean table column CSS format font weight is bold
3 "attributes" "rows" Object table rows for 'TABLE' fieldtype
4 "rows" "list" Array table rows list items keys. Example: ["row1"]
4 "rows" "items" Object table rows items with keys
5 "rows"."items" "row1" Object table row with key row1
6 "row1" "displayname" String table row with key row1 display name
6 "row1" "visible" String is row visible for users, allowed values: 'ALL', 'ADMIN', 'NONE'
6 "row1" "editable" String is row able to be edited by user, allowed values: 'ALL', 'ADMIN', 'NONE'

Update form

curl "https://bibook.com/api/dataroom/:company_id/forms/:form_id" -X PATCH -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{"dataroom_form":{"name":"Zoolab","visible": "ALL","editable": "ALL","company_id":8,"language":"fi","form_type":"Forecast","fields":[{"id":1,"name":"Field_1_short_text","visible": "ALL","editable": "ALL","fieldtype":"SHORT_TEXT","attributes":{},"displayname":"Field #1 Short Text Displayname"},{"id":2,"name":"Field_2_long_text","visible": "ALL","editable": "ALL","fieldtype":"LONG_TEXT","attributes":{},"displayname":"Field #2 Long Text Displayname"},{"id":3,"name":"Field_3_dropdown","visible": "ALL","editable": "ALL","fieldtype":"DROPDOWN","default_value":"a","attributes":{"options":[{"text":"Nil value","value":null},{"text":"String value","value":"a"},{"text":"Integer value","value":1},{"text":"Boolean value","value":true}]},"displayname":"Field #3 Dropdown Displayname"},{"id":4,"name":"Field_4_radio","visible": "ALL","editable": "ALL","fieldtype":"RADIO","attributes":{"options":[{"text":"Nil value","value":null},{"text":"String value","value":"a"},{"text":"Integer value","value":1},{"text":"Boolean value","value":true}]},"displayname":"Field #4 Radio Displayname"},{"id":5,"name":"Field_5_checkbox","visible": "ALL","editable": "ALL","fieldtype":"CHECKBOX","attributes":{},"displayname":"Field #5 CheckBox Displayname"},{"id":6,"name":"Field_6_table","visible": "ALL","editable": "ALL","fieldtype":"TABLE","attributes":{"settings":{"custom_rows":true, "show_column_totals":true},"columns":{"items":{"column1":{"displayname":"Column1", "datatype":"SHORT_TEXT","visible": "ALL","editable": "ALL","attributes":{"format": {"bold": true}}},"column2":{"displayname":"Column2", "datatype":"NUMBER","visible": "ALL","editable": "ALL"},"column3":{"displayname":"Column3", "datatype":"DROPDOWN","visible": "ALL","editable": "ALL","options":[{"text":"Option1","value":1},{"text":"Option2","value":2}],"default_value":1}},"list":["column1", "column2", "column3"]},"rows":{"items":{"row1":{"displayname":"Row1","visible": "ALL","editable": "ALL"}, "row2":{"displayname":"Row2","visible": "ALL","editable": "ALL"}},"list":["row1", "row2"]}},"displayname":"Field #6 Table Displayname"}]}}'

The above command returns JSON structured like this:

{
  "dataroom_form": {
    "id": 10,
    "name": "Tempsoft",
    "visible": "ALL",
    "editable": "ALL",
    "company_id": 9,
    "language": "fi",
    "fields": [
      {
        "id": 1,
        "name": "Field_1_short_text",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "SHORT_TEXT",
        "attributes": {},
        "displayname": "Field #1 Short Text Displayname"
      },
      {
        "id": 2,
        "name": "Field_2_long_text",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "LONG_TEXT",
        "attributes": {},
        "displayname": "Field #2 Long Text Displayname"
      },
      {
        "id": 3,
        "name": "Field_3_dropdown",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "DROPDOWN",
        "attributes": {
          "options": [
            {
              "text": "String value",
              "value": "a"
            },
            {
              "text": "Integer value",
              "value": 1
            },
            {
              "text": "Boolean value",
              "value": true
            }
          ]
        },
        "displayname": "Field #3 Dropdown Displayname"
      },
      {
        "id": 4,
        "name": "Field_4_radio",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "RADIO",
        "attributes": {
          "options": [
            {
              "text": "String value",
              "value": "a"
            },
            {
              "text": "Integer value",
              "value": 1
            },
            {
              "text": "Boolean value",
              "value": true
            }
          ]
        },
        "displayname": "Field #4 Radio Displayname"
      },
      {
        "id": 5,
        "name": "Field_5_checkbox",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "CHECKBOX",
        "attributes": {},
        "displayname": "Field #5 CheckBox Displayname"
      },
      {
        "id": 6,
        "name": "Field_6_table",
        "visible": "ALL",
        "editable": "ALL",
        "fieldtype": "TABLE",
        "attributes": {
          "settings": {
            "custom_rows": true,
            "show_column_totals": true
          },
          "columns": {
            "items": {
              "column1": {
                "displayname": "Column1",
                "datatype": "SHORT_TEXT",
                "visible": "ALL",
                "editable": "ALL",
                "attributes": {
                  "format": {
                    "bold": true
                  }
                }
              },
              "column2": {
                "displayname": "Column2",
                "datatype": "NUMBER",
                "visible": "ALL",
                "editable": "ALL"
              },
              "column3": {
                "displayname": "Column3",
                "datatype": "DROPDOWN",
                "visible": "ALL",
                "editable": "ALL",
                "options": [
                  {
                    "text": "Option1",
                    "value": 1
                  },
                  {
                    "text": "Option2",
                    "value": 2
                  }
                ],
                "default_value": 1
              }
            },
            "list": [
              "column1",
              "column2",
              "column3"
            ]
          },
          "rows": {
            "items": {
              "row1": {
                "displayname": "Row1",
                "visible": "ALL",
                "editable": "ALL"
              },
              "row2": {
                "displayname": "Row2",
                "visible": "ALL",
                "editable": "ALL"
              }
            },
            "list": [
              "row1",
              "row2"
            ]
          }
        },
        "displayname": "Field #6 Table Displayname"
      }
    ],
    "form_type": "Forecast",
    "multi_entries": false,
    "multi_entries_result_visibility": "ADMIN"
  }
}

This endpoint updates form.

HTTP Request

PATCH https://bibook.com/api/dataroom/:company_id/forms/:form_id

Query Parameters

Parameter Default Description
company_id None ID of company
form_id None ID of form

Request Body

Level Parent Name Type Description
root None "dataroom_form" Object root element
1 "dataroom_form" "name" String name of form
1 "dataroom_form" "company_id" Integer Id of company, form belongs to
1 "dataroom_form" "visible" String is form visible for users, allowed values: 'ALL', 'ADMIN', 'NONE'
1 "dataroom_form" "editable" String is form able to be edited by user, allowed values: 'ALL', 'ADMIN', 'NONE'
1 "dataroom_form" "fields" Array array of Field objects
1 "dataroom_form" "language" String Language of form, allowed values: 'en', 'fi', 'sv'
1 "dataroom_form" "form_type" String form type, allowed values: 'Custom', 'Budget', 'Budget_pivoted', 'Forecast'
1 "dataroom_form" "multi_entries" Boolean form multi entries
1 "dataroom_form" "multi_entries_result_visibility" String form multi entries visible for users
2 []"fields" "id" Integer Id of form field, determines display ordering
2 []"fields" "name" String name of form field for results serializing
2 []"fields" "displayname" String name of form field during displaying
2 []"fields" "fieldtype" String type of form field, determines input kind, allowed values: 'SHORT_TEXT', 'LONG_TEXT', 'DROPDOWN', 'RADIO', 'CHECKBOX', 'TABLE'
2 []"fields" "visible" String is field visible for users, allowed values: 'ALL', 'ADMIN', 'NONE'
2 []"fields" "editable" String is field able to be edited by user, allowed values: 'ALL', 'ADMIN', 'NONE'
2 []"fields" "attributes" Object field attributes, required for 'DROPDOWN' and 'RADIO' fieldtypes
2 []"fields" "default_value" String, Integer, Boolean Value of input, optional for 'DROPDOWN' and 'RADIO' fieldtypes
3 "attributes" "options" Array selectable options for 'DROPDOWN' and 'RADIO' fieldtypes
4 []"options" "text" String Label for input option
4 []"options" "value" String, Integer, Boolean Value of input option
3 "attributes" "settings" Object settings for 'TABLE' fieldtype
4 "settings" "custom_rows" Boolean is table able to be added row by user
4 "settings" "show_column_totals" Boolean the row "Totals" will be added to the table
3 "attributes" "columns" Object table columns for 'TABLE' fieldtype
4 "columns" "list" Array table columns list items keys. Example: ["column1"]
4 "columns" "items" Object table columns items with keys
5 "columns"."items" "column1" Object table column with key column1
6 "column1" "displayname" String table column with key column1 display name
6 "column1" "datatype" String type of table column, determines input kind, allowed values: 'SHORT_TEXT', 'NUMBER', 'DROPDOWN'
6 "column1" "visible" String is column visible for users, allowed values: 'ALL', 'ADMIN', 'NONE'
6 "column1" "editable" String is column able to be edited by user, allowed values: 'ALL', 'ADMIN', 'NONE'
6 "column1" "default_value" String, Integer, Boolean Value of input, optional for table column 'DROPDOWN' datatype
6 "column1" "options" Array selectable options, required for for table column 'DROPDOWN' datatype
7 "column1"[]"options" "text" String Label for table column input option
7 "column1"[]"options" "value" String, Integer, Boolean Value of table 'DROPDOWN' column input option
6 "column1" "attributes" Object table column other attributes
7 "column1"."attributes" "format" Object table column CSS format attributes
8 "column1"."attributes"."format" "bold" Boolean table column CSS format font weight is bold
3 "attributes" "rows" Object table rows for 'TABLE' fieldtype
4 "rows" "list" Array table rows list items keys. Example: ["row1"]
4 "rows" "items" Object table rows items with keys
5 "rows"."items" "row1" Object table row with key row1
6 "row1" "displayname" String table row with key row1 display name
6 "row1" "visible" String is row visible for users, allowed values: 'ALL', 'ADMIN', 'NONE'
6 "row1" "editable" String is row able to be edited by user, allowed values: 'ALL', 'ADMIN', 'NONE'

Delete form

curl "https://bibook.com/api/dataroom/:company_id/forms/:form_id" -X DELETE -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The above command returns JSON structured like this:

  {"success": true}

This endpoint deletes form.

HTTP Request

DELETE https://bibook.com/api/dataroom/:company_id/forms/:form_id

Query Parameters

Parameter Default Description
company_id None ID of company
form_id None ID of form

Retrieve results

Retrieve all company users that have filled forms

curl "https://bibook.com/api/dataroom/:company_id/users" -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The above command returns JSON structured like this:

{
  "dataroom_form_users":[
    {
      "id": 6034,
      "name": "Dwain McDermott II",
      "email": "cori@rempel.name",
      "filled_forms_count": 1
    }
  ]
}

This endpoint retrieves all company users that have filled forms.

HTTP Request

GET https://bibook.com/api/dataroom/:company_id/users

Query Parameters

Parameter Default Description
company_id None ID of company

Retrieve all company filled forms

curl "https://bibook.com/api/dataroom/:company_id/results" -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The above command returns JSON structured like this:

{
  "dataroom_form_results": [
    {
      "company_id": 8037,
      "user_id": 6033,
      "form_id": 1237,
      "form_name": "Gembucket",
      "data": [
        {
          "field_id": 1,
          "name": "Field_1_short_text",
          "result": "some filled short text"
        },
        {
          "field_id": 2,
          "name": "Field_2_long_text",
          "result": "some \n long \n text"
        },
        {
          "field_id": 3,
          "name": "Field_3_dropdown",
          "result": null
        },
        {
          "field_id": 4,
          "name": "Field_4_radio",
          "result": null
        },
        {
          "field_id": 5,
          "name": "Field_5_checkbox",
          "result": false
        },
        {
          "field_id": 6,
          "name": "Field_6_table",
          "result": {
            "custom_rows": {
              "list": ["row_1", "row_2", "row_3"],
              "items": {
                "row1": {
                  "displayname": "Row1",
                  "visible": "ALL",
                  "editable": "ALL"
                },
                "row2": {
                  "displayname": "Row2",
                  "visible": "ALL",
                  "editable": "ALL"
                },
                "row3": {
                  "displayname": "Row3",
                  "visible": "ALL",
                  "editable": "ALL"
                }
              }
            },
            "row_1": {
              "column_1": "row_1_column_1_value",
              "column_2": "row_1_column_2_value",
              "column_3": "row_1_column_3_value"
            },
            "row_2": {
              "column_1": "row_2_column_1_value",
              "column_2": "row_2_column_2_value",
              "column_3": "row_2_column_3_value"
            },
            "row_3": {
              "column_1": "row_3_column_1_value",
              "column_2": "row_3_column_2_value",
              "column_3": "row_3_column_3_value"
            }
          }
        }
      ],
      "language": "fi",
      "latest_fill_timestamp": "2022-03-12 22:35:55"
    }
  ]
}

This endpoint retrieves all filled form results for company.

HTTP Request

GET https://bibook.com/api/dataroom/:company_id/results

Query Parameters

Parameter Default Description
company_id None ID of company

Retrieve all company's filled forms for user

curl "https://bibook.com/api/dataroom/:company_id/results/:user_id" -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The above command returns JSON structured like this:

{
  "dataroom_form_results": [
    {
      "company_id": 8037,
      "user_id": 6033,
      "form_id": 1237,
      "form_name": "Gembucket",
      "data": [
        {
          "field_id": 1,
          "name": "Field_1_short_text",
          "result": "some filled short text"
        },
        {
          "field_id": 2,
          "name": "Field_2_long_text",
          "result": "some \n long \n text"
        },
        {
          "field_id": 3,
          "name": "Field_3_dropdown",
          "result": null
        },
        {
          "field_id": 4,
          "name": "Field_4_radio",
          "result": null
        },
        {
          "field_id": 5,
          "name": "Field_5_checkbox",
          "result": false
        },
        {
          "field_id": 6,
          "name": "Field_6_table",
          "result": {
            "custom_rows": {
              "list": ["row_1", "row_2", "row_3"],
              "items": {
                "row1": {
                  "displayname": "Row1",
                  "visible": "ALL",
                  "editable": "ALL"
                },
                "row2": {
                  "displayname": "Row2",
                  "visible": "ALL",
                  "editable": "ALL"
                },
                "row3": {
                  "displayname": "Row3",
                  "visible": "ALL",
                  "editable": "ALL"
                }
              }
            },
            "row_1": {
              "column_1": "row_1_column_1_value",
              "column_2": "row_1_column_2_value",
              "column_3": "row_1_column_3_value"
            },
            "row_2": {
              "column_1": "row_2_column_1_value",
              "column_2": "row_2_column_2_value",
              "column_3": "row_2_column_3_value"
            },
            "row_3": {
              "column_1": "row_3_column_1_value",
              "column_2": "row_3_column_2_value",
              "column_3": "row_3_column_3_value"
            }
          }
        }
      ],
      "language": "fi",
      "latest_fill_timestamp": "2022-03-12 22:35:55"
    }
  ]
}

This endpoint retrieve all company's filled forms by user.

HTTP Request

GET https://bibook.com/api/dataroom/:company_id/results/:user_id

Query Parameters

Parameter Default Description
company_id None ID of company
user_id None ID of user

Retrieve form result by id

curl "https://bibook.com/api/dataroom/:company_id/results/:user_id/:form_id" -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The above command returns JSON structured like this:

{
  "dataroom_form_result": {
    "company_id": 8037,
    "user_id": 6033,
    "form_id": 1237,
    "form_name": "Gembucket",
    "data": [
      {
        "field_id": 1,
        "name": "Field_1_short_text",
        "result": "some filled short text"
      },
      {
        "field_id": 2,
        "name": "Field_2_long_text",
        "result": "some \n long \n text"
      },
      {
        "field_id": 3,
        "name": "Field_3_dropdown",
        "result": null
      },
      {
        "field_id": 4,
        "name": "Field_4_radio",
        "result": null
      },
      {
        "field_id": 5,
        "name": "Field_5_checkbox",
        "result": false
      },
      {
        "field_id": 6,
        "name": "Field_6_table",
        "result": {
          "row_1": {
            "column_1": "row_1_column_1_value",
            "column_2": "row_1_column_2_value",
            "column_3": "row_1_column_3_value"
          },
          "row_2": {
            "column_1": "row_2_column_1_value",
            "column_2": "row_2_column_2_value",
            "column_3": "row_2_column_3_value"
          }
        }
      }
    ],
    "language": "fi",
    "latest_fill_timestamp": "2022-03-12 22:35:55"
  }
}

This endpoint retrieve form result by id of form.

HTTP Request

GET https://bibook.com/api/dataroom/:company_id/results/:user_id/:form_id

Query Parameters

Parameter Default Description
company_id None ID of company
user_id None ID of user
form_id None ID of form

Create or update form result by id of form

curl "https://bibook.com/api/dataroom/:company_id/results/:user_id/:form_id" 
     -X PATCH -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Content-Type: application/json" 
     -d '{"data":{"Field_1_short_text":"some filled short text","Field_2_long_text":"some \n long \n text","Field_3_dropdown":null,"Field_4_radio":null,"Field_5_checkbox":false}}'

The above command returns JSON structured like this:

{
  "dataroom_form_result": {
    "company_id": 8037,
    "user_id": 6033,
    "form_id": 1237,
    "form_name": "Gembucket",
    "data": [
      {
        "field_id": 1,
        "name": "Field_1_short_text",
        "result": "some filled short text"
      },
      {
        "field_id": 2,
        "name": "Field_2_long_text",
        "result": "some \n long \n text"
      },
      {
        "field_id": 3,
        "name": "Field_3_dropdown",
        "result": null
      },
      {
        "field_id": 4,
        "name": "Field_4_radio",
        "result": null
      },
      {
        "field_id": 5,
        "name": "Field_5_checkbox",
        "result": false
      },
      {
        "field_id": 6,
        "name": "Field_6_table",
        "result": {
          "custom_rows": {
            "list": ["row_1", "row_2", "row_3"],
            "items": {
              "row1": {
                "displayname": "Row1",
                "visible": "ALL",
                "editable": "ALL"
              },
              "row2": {
                "displayname": "Row2",
                "visible": "ALL",
                "editable": "ALL"
              },
              "row3": {
                "displayname": "Row3",
                "visible": "ALL",
                "editable": "ALL"
              }
            }
          },
          "row_1": {
            "column_1": "row_1_column_1_value",
            "column_2": "row_1_column_2_value",
            "column_3": "row_1_column_3_value"
          },
          "row_2": {
            "column_1": "row_2_column_1_value",
            "column_2": "row_2_column_2_value",
            "column_3": "row_2_column_3_value"
          },
          "row_3": {
            "column_1": "row_3_column_1_value",
            "column_2": "row_3_column_2_value",
            "column_3": "row_3_column_3_value"
          }
        }
      }
    ],
    "language": "fi",
    "latest_fill_timestamp": "2022-03-12 22:35:55"
  }
}

This endpoint for create or update form result.

HTTP Request

PATCH https://bibook.com/api/dataroom/:company_id/results/:user_id/:form_id

Query Parameters

Parameter Default Description
company_id None ID of company
user_id None ID of user
form_id None ID of form

Request Body

Level Parent Name Type Description
root None "data" Object root element
1 "data" "Field_1_short_text" String value for field Field_1_short_text
1 "data" "Field_2_long_text" String value for field Field_2_long_text
1 "data" "Field_3_dropdown" String value for field Field_3_dropdown
1 "data" "Field_4_radio" String value for field Field_4_radio
1 "data" "Field_5_checkbox" Boolean value for field Field_5_checkbox

Manage rights

Retrieve all form enabled users

curl "/api/dataroom/form_accessed_users/:form_id/users" -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The above command returns JSON structured like this:

{
  "dataroom_form_users":[
    {
      "id": 6034,
      "name": "Dwain McDermott II",
      "email": "cori@rempel.name",
      "filled_forms_count": 1
    }
  ]
}

HTTP Request

GET https://bibook.com/api/dataroom/form_accessed_users/:form_id/users

Query Parameters

Parameter Default Description
form_id None ID of form

Enable form for user

curl "https://bibook.com/api/dataroom/form_accessed_users/:form_id/users/:user_id/enable" -X PATCH -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Content-Type: application/json"

The above command returns JSON structured like this:

  { "success": true }

HTTP Request

PATCH https://bibook.com/api/dataroom/form_accessed_users/:form_id/users/:user_id/enable

Query Parameters

Parameter Default Description
form_id None ID of form
user_id None ID of user

Disable form for user

curl "https://bibook.com/api/dataroom/form_accessed_users/:form_id/users/:user_id/disable" -X PATCH -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Content-Type: application/json"

The above command returns JSON structured like this:

  { "success": true }

HTTP Request

PATCH https://bibook.com/api/dataroom/form_accessed_users/:form_id/users/:user_id/disable

Query Parameters

Parameter Default Description
form_id None ID of form
user_id None ID of user

Errors

The BI Book uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
404 Wrong entity Id
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.