REST API Workbook

For each call, you can add the following command:

-w"\n%{http_code}\n"

After the username and password in order to receive more meaningful HTTP errors.

Read Workbook

This REST API call has been deprecated as of Datameer v7.0 and is scheduled to be removed before the release of Datameer v8.0. It is replaced by the call Read Workbook v2.

Request method - GET

Description

Returns information on a specified workbook within Datameer including version number, class name, file information (uuid, path, description, name), run schedule, custom properties, and sheet data.

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/workbook/<workbook-configuration-id>'

Example response

 Click here to expand...
{
  "version": "2.1",
  "className": "datameer.dap.common.entity.WorkbookConfigurationImpl",
  "file": {
    "uuid": "e1b88f00-899f-4c62-817a-cf1e7cb62e96",
    "path": "/Workbooks/Behavioral Analytics/Clickstream Preprocessing.wbk",
    "description": "This workbook transforms raw web server logs into information useful for analysts by sessionizing, enriching with visitor profile information, and extracting click paths.\r\n\r\nThis workbook drives the Clickstream Analytics workbook",
    "name": "Clickstream Preprocessing"
  },
  "pullType": "MANUALLY",
  "properties": {},
  "sheets": [
    {
      "name": "weblogs",
      "sheetId": "weblogs",
      "sheetType": "das.internal.DataSourceSheetType",
      "keep": false,
      "datasource": {
        "path": "/FileUploads/Clickstream Data.upl",
        "uuid": "743b6251-4524-4668-a771-9a716b2b1e58"
      },
      "columnStyles": []
    },
    {
      "name": "No_Images_Or_Errors",
      "sheetId": "No_Images_Or_Errors",
      "sheetType": "das.internal.FilterSheetType",
      "keep": false,
      "sourceSheet": "weblogs",
      "connector": "AND",
      "filterArguments": [
        {
          "column": "status",
          "filterExpression": "EQUALS",
          "value": "200",
          "valueStatic": true,
          "type": "CONSTANT"
        },
        {
          "column": "request",
          "filterExpression": "NOT_CONTAINS",
          "value": ".jpg",
          "valueStatic": true,
          "type": "CONSTANT"
        },
        {
          "column": "request",
          "filterExpression": "NOT_CONTAINS",
          "value": ".jpeg",
          "valueStatic": true,
          "type": "CONSTANT"
        },
        {
          "column": "request",
          "filterExpression": "NOT_CONTAINS",
          "value": ".gif",
          "valueStatic": true,
          "type": "CONSTANT"
        },
        {
          "column": "request",
          "filterExpression": "NOT_CONTAINS",
          "value": ".tif",
          "valueStatic": true,
          "type": "CONSTANT"
        },
        {
          "column": "request",
          "filterExpression": "NOT_CONTAINS",
          "value": ".ico",
          "valueStatic": true,
          "type": "CONSTANT"
        }
      ],
      "columnStyles": []
    },
    {
      "name": "Session_Stats",
      "sheetId": "Session_Stats",
      "sheetType": "das.internal.FormulaSheetType",
      "keep": true,
      "formulas": [
        {
          "columnName": "User",
          "columnId": "0",
          "columnIndex": 0,
          "formulaString": "=GROUPBY(#No_Images_Or_Errors!remoteUser)"
        },
        {
          "columnName": "Session_Start",
          "columnId": "1",
          "columnIndex": 1,
          "formulaString": "=GROUPBYGAP(#No_Images_Or_Errors!timeEnglishFormat;5m)"
        },
        {
          "columnName": "Session_End",
          "columnId": "2",
          "columnIndex": 2,
          "formulaString": "=GROUPMAX(#No_Images_Or_Errors!timeEnglishFormat)"
        },
        {
          "columnName": "Mins",
          "columnId": "3",
          "columnIndex": 3,
          "formulaString": "=(#Session_End-#Session_Start)/60000"
        },
        {
          "columnName": "Clicks",
          "columnId": "4",
          "columnIndex": 4,
          "formulaString": "=GROUPCOUNT()"
        }
      ],
      "columnStyles": [
        {
          "columnIndex": 0,
          "width": 100,
          "name": "User",
          "thousandSeparator": true
        },
        {
          "columnIndex": 1,
          "width": 100,
          "name": "Session_Start",
          "thousandSeparator": true
        },
        {
          "columnIndex": 2,
          "width": 100,
          "name": "Session_End",
          "thousandSeparator": true
        },
        {
          "columnIndex": 3,
          "width": 100,
          "name": "Mins",
          "thousandSeparator": true
        },
        {
          "columnIndex": 4,
          "width": 100,
          "name": "Clicks",
          "thousandSeparator": true
        }
      ],
      "nextColumnId": 5
    },
    {
      "name": "Sessionized_Clicks",
      "sheetId": "Sessionized_Clicks",
      "sheetType": "das.internal.FormulaSheetType",
      "keep": true,
      "formulas": [
        {
          "columnName": "User",
          "columnId": "0",
          "columnIndex": 0,
          "formulaString": "=GROUPBY(#No_Images_Or_Errors!remoteUser)"
        },
        {
          "columnName": "Session_Start",
          "columnId": "1",
          "columnIndex": 1,
          "formulaString": "=GROUPBYGAP(#No_Images_Or_Errors!timeEnglishFormat;5m)"
        },
        {
          "columnName": "Path",
          "columnId": "2",
          "columnIndex": 2,
          "formulaString": "=GROUP_PATH_CHANGES(URL_FILE(#No_Images_Or_Errors!request))"
        },
        {
          "columnName": "From",
          "columnId": "3",
          "columnIndex": 3,
          "formulaString": "=REGEX(JSON_ELEMENT(#Path;0);\"(.*)\\\\..*\";\"$1\";\"external\")"
        },
        {
          "columnName": "To",
          "columnId": "4",
          "columnIndex": 4,
          "formulaString": "=REGEX(JSON_ELEMENT(#Path;1);\"(.*)\\\\..*\";\"$1\";\"external\")"
        },
        {
          "columnName": "Last_Click",
          "columnId": "5",
          "columnIndex": 5,
          "formulaString": "=GROUP_PREVIOUS(#No_Images_Or_Errors!timeEnglishFormat)"
        },
        {
          "columnName": "Landing",
          "columnId": "6",
          "columnIndex": 6,
          "formulaString": "=#No_Images_Or_Errors!timeEnglishFormat"
        },
        {
          "columnName": "Dwell_Time_ms",
          "columnId": "7",
          "columnIndex": 7,
          "formulaString": "=GROUP_DIFF(#Landing)"
        }
      ],
      "columnStyles": [
        {
          "columnIndex": 0,
          "width": 100,
          "name": "User",
          "thousandSeparator": true
        },
        {
          "columnIndex": 1,
          "width": 100,
          "name": "Session_Start",
          "thousandSeparator": true
        },
        {
          "columnIndex": 2,
          "width": 100,
          "name": "Path",
          "thousandSeparator": true
        },
        {
          "columnIndex": 3,
          "width": 100,
          "name": "From",
          "thousandSeparator": true
        },
        {
          "columnIndex": 4,
          "width": 100,
          "name": "To",
          "thousandSeparator": true
        },
        {
          "columnIndex": 5,
          "width": 100,
          "name": "Last_Click",
          "thousandSeparator": true
        },
        {
          "columnIndex": 6,
          "width": 100,
          "name": "Landing",
          "thousandSeparator": true
        },
        {
          "columnIndex": 7,
          "width": 100,
          "name": "Dwell_Time_ms",
          "thousandSeparator": true
        }
      ],
      "nextColumnId": 8
    },
    {
      "name": "Moves",
      "sheetId": "Moves",
      "sheetType": "das.internal.FilterSheetType",
      "keep": true,
      "sourceSheet": "Sessionized_Clicks",
      "connector": "AND",
      "filterArguments": [
        {
          "column": "To",
          "filterExpression": "NOT_CONTAINS",
          "value": "external",
          "valueStatic": true,
          "type": "CONSTANT"
        }
      ],
      "columnStyles": []
    },
    {
      "name": "Click_Pairs",
      "sheetId": "Click_Pairs",
      "sheetType": "das.internal.FormulaSheetType",
      "keep": true,
      "formulas": [
        {
          "columnName": "Path",
          "columnId": "0",
          "columnIndex": 0,
          "formulaString": "=GROUPBY(#Moves!Path)"
        },
        {
          "columnName": "From",
          "columnId": "1",
          "columnIndex": 1,
          "formulaString": "=REGEX(JSON_ELEMENT(#Path;0);\"(.*)\\\\..*\";\"$1\";\"external\")"
        },
        {
          "columnName": "To",
          "columnId": "2",
          "columnIndex": 2,
          "formulaString": "=REGEX(JSON_ELEMENT(#Path;1);\"(.*)\\\\..*\";\"$1\";\"external\")"
        },
        {
          "columnName": "Occurrences",
          "columnId": "3",
          "columnIndex": 3,
          "formulaString": "=GROUPCOUNT()"
        },
        {
          "columnName": "Avg_Mins_On_Page",
          "columnId": "4",
          "columnIndex": 4,
          "formulaString": "=GROUPAVERAGE(#Moves!Dwell_Time_ms)/60000"
        }
      ],
      "columnStyles": [
        {
          "columnIndex": 0,
          "width": 100,
          "name": "Path",
          "thousandSeparator": true
        },
        {
          "columnIndex": 1,
          "width": 100,
          "name": "From",
          "thousandSeparator": true
        },
        {
          "columnIndex": 2,
          "width": 100,
          "name": "To",
          "thousandSeparator": true
        },
        {
          "columnIndex": 3,
          "width": 100,
          "name": "Occurrences",
          "thousandSeparator": true
        },
        {
          "columnIndex": 4,
          "width": 100,
          "name": "Avg_Mins_On_Page",
          "thousandSeparator": true
        }
      ],
      "nextColumnId": 5
    },
    {
      "name": "User_Stats",
      "sheetId": "User_Stats",
      "sheetType": "das.internal.FormulaSheetType",
      "keep": false,
      "formulas": [
        {
          "columnName": "User",
          "columnId": "0",
          "columnIndex": 0,
          "formulaString": "=GROUPBY(#Session_Stats!User)"
        },
        {
          "columnName": "Avg_Session_Mins",
          "columnId": "1",
          "columnIndex": 1,
          "formulaString": "=GROUPAVERAGE(#Session_Stats!Mins)"
        },
        {
          "columnName": "Avg_Clicks",
          "columnId": "2",
          "columnIndex": 2,
          "formulaString": "=GROUPAVERAGE(#Session_Stats!Clicks)"
        },
        {
          "columnName": "Median_Session_Mins",
          "columnId": "3",
          "columnIndex": 3,
          "formulaString": "=GROUPMEDIAN(#Session_Stats!Mins)"
        },
        {
          "columnName": "Num_Sessions",
          "columnId": "4",
          "columnIndex": 4,
          "formulaString": "=GROUPCOUNT()"
        },
        {
          "columnName": "Total_Clicks",
          "columnId": "5",
          "columnIndex": 5,
          "formulaString": "=GROUPSUM(#Session_Stats!Clicks)"
        }
      ],
      "columnStyles": [
        {
          "columnIndex": 0,
          "width": 100,
          "name": "User",
          "thousandSeparator": true
        },
        {
          "columnIndex": 1,
          "width": 100,
          "name": "Avg_Session_Mins",
          "thousandSeparator": true
        },
        {
          "columnIndex": 2,
          "width": 100,
          "name": "Avg_Clicks",
          "thousandSeparator": true
        },
        {
          "columnIndex": 3,
          "width": 100,
          "name": "Median_Session_Mins",
          "thousandSeparator": true
        },
        {
          "columnIndex": 4,
          "width": 100,
          "name": "Num_Sessions",
          "thousandSeparator": true
        },
        {
          "columnIndex": 5,
          "width": 100,
          "name": "Total_Clicks",
          "thousandSeparator": true
        }
      ],
      "nextColumnId": 6
    },
    {
      "name": "customers",
      "sheetId": "customers",
      "sheetType": "das.internal.DataSourceSheetType",
      "keep": false,
      "datasource": {
        "path": "/FileUploads/Web User Profile.upl",
        "uuid": "cc9fc852-9e16-4c81-ab97-ccfc9ee687b6"
      },
      "columnStyles": []
    },
    {
      "name": "Users_Enriched",
      "sheetId": "Users_Enriched",
      "sheetType": "das.internal.JoinedSheetType",
      "keep": true,
      "sheetDefinition": {
        "joinCategory": "TWO_MEMBER_JOIN",
        "joinPairs": [
          {
            "joinType": "INNER",
            "sheet1": "User_Stats",
            "sheet2": "customers",
            "joinColumn1": "User",
            "joinColumn2": "user"
          }
        ],
        "sheetToIncludeColumns": {
          "User_Stats": [
            "User",
            "Avg_Session_Mins",
            "Avg_Clicks",
            "Median_Session_Mins",
            "Num_Sessions",
            "Total_Clicks"
          ],
          "customers": [
            "Email",
            "Activated"
          ]
        }
      },
      "columnStyles": []
    },
    {
      "name": "Raw_ClickPaths",
      "sheetId": "Raw_ClickPaths",
      "sheetType": "das.internal.FormulaSheetType",
      "keep": false,
      "formulas": [
        {
          "columnName": "User",
          "columnId": "0",
          "columnIndex": 0,
          "formulaString": "=GROUPBY(#Sessionized_Clicks!User)"
        },
        {
          "columnName": "Session_Start",
          "columnId": "1",
          "columnIndex": 1,
          "formulaString": "=GROUPBY(#Sessionized_Clicks!Session_Start)"
        },
        {
          "columnName": "Path",
          "columnId": "2",
          "columnIndex": 2,
          "formulaString": "=TOJSON(GROUPCOMBIN(#Sessionized_Clicks!To))"
        }
      ],
      "columnStyles": [
        {
          "columnIndex": 0,
          "width": 100,
          "name": "User",
          "thousandSeparator": true
        },
        {
          "columnIndex": 1,
          "width": 100,
          "name": "Session_Start",
          "thousandSeparator": true
        },
        {
          "columnIndex": 2,
          "width": 100,
          "name": "Path",
          "thousandSeparator": true
        }
      ],
      "nextColumnId": 3
    },
    {
      "name": "Internal_Moves",
      "sheetId": "Internal_Moves",
      "sheetType": "das.internal.FilterSheetType",
      "keep": true,
      "sourceSheet": "Click_Pairs",
      "connector": "AND",
      "filterArguments": [
        {
          "column": "Path",
          "filterExpression": "NOT_CONTAINS",
          "value": "external",
          "valueStatic": true,
          "type": "CONSTANT"
        }
      ],
      "columnStyles": []
    },
    {
      "name": "ClickPaths_4_Plus",
      "sheetId": "ClickPaths_4_Plus",
      "sheetType": "das.internal.FilterSheetType",
      "keep": true,
      "sourceSheet": "Raw_ClickPaths",
      "connector": "AND",
      "filterArguments": [
        {
          "filterExpression": "FORMULA",
          "value": "NOT(ISNULL(JSON_ELEMENT(#Path;3)))",
          "valueStatic": false,
          "type": "ADVANCED_FORMULA"
        }
      ],
      "columnStyles": []
    },
    {
      "name": "Page_Pairs",
      "sheetId": "Page_Pairs",
      "sheetType": "das.internal.FormulaSheetType",
      "keep": true,
      "formulas": [
        {
          "columnName": "From",
          "columnId": "0",
          "columnIndex": 0,
          "formulaString": "=#Click_Pairs!From"
        },
        {
          "columnName": "To",
          "columnId": "1",
          "columnIndex": 1,
          "formulaString": "=#Click_Pairs!To"
        },
        {
          "columnName": "Occurrences",
          "columnId": "2",
          "columnIndex": 2,
          "formulaString": "=#Click_Pairs!Occurrences"
        },
        {
          "columnName": "Avg_Mins_On_Page",
          "columnId": "3",
          "columnIndex": 3,
          "formulaString": "=#Click_Pairs!Avg_Mins_On_Page"
        }
      ],
      "columnStyles": [
        {
          "columnIndex": 0,
          "width": 100,
          "name": "From",
          "thousandSeparator": true
        },
        {
          "columnIndex": 1,
          "width": 100,
          "name": "To",
          "thousandSeparator": true
        },
        {
          "columnIndex": 2,
          "width": 100,
          "name": "Occurrences",
          "thousandSeparator": true
        },
        {
          "columnIndex": 3,
          "width": 100,
          "name": "Avg_Mins_On_Page",
          "thousandSeparator": true
        }
      ],
      "nextColumnId": 4
    },
    {
      "name": "Entrances",
      "sheetId": "Entrances",
      "sheetType": "das.internal.FilterSheetType",
      "keep": true,
      "sourceSheet": "Sessionized_Clicks",
      "connector": "AND",
      "filterArguments": [
        {
          "column": "From",
          "filterExpression": "TEXT_EQUALS",
          "value": "external",
          "valueStatic": true,
          "type": "CONSTANT"
        }
      ],
      "columnStyles": []
    }
  ],
  "errorHandlingMode": "IGNORE"
}
 
      &quot;name&quot;: &quot;Entrances&quot;,
      &quot;sheetId&quot;: &quot;Entrances&quot;,
      &quot;sheetType&quot;: &quot;das.internal.FilterSheetType&quot;,
      &quot;keep&quot;: true,
      &quot;sourceSheet&quot;: &quot;Sessionized_Clicks&quot;,
      &quot;connector&quot;: &quot;AND&quot;,
      &quot;filterArguments&quot;: [
        {
          &quot;column&quot;: &quot;From&quot;,
          &quot;filterExpression&quot;: &quot;TEXT_EQUALS&quot;,
          &quot;value&quot;: &quot;external&quot;,
          &quot;valueStatic&quot;: true,
          &quot;type&quot;: &quot;CONSTANT&quot;
        }
      ],
      &quot;columnStyles&quot;: []
    }
  ],
  &quot;errorHandlingMode&quot;: &quot;IGNORE&quot;
}</pre>

Read Workbook (version 2)

Request method - GET

Description

Reads a workbook based on a JSON representation for the workbooks using the Git versioning plug-in.

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/workbooks/<file-id>'

Example response

 Click here to expand...
{
  "workbook": {
    "_version": "5.11.0",
    "dataPermission": {
      "groups": {},
      "owner": "system",
      "permissionForOthers": false
    },
    "errorHandling": {
      "maxLogErrors": 1000,
      "mode": "IGNORE"
    },
    "file": {
      "createdAt": "2015-12-07T09:08:11.557+01:00",
      "description": "",
      "extension": "WORKBOOK",
      "folder": [
        "/Analytics/Workbooks",
        "8bbdb7a0-7ddc-4225-85fe-95d001caedb9"
      ],
      "modifiedAt": "2015-12-07T09:08:11.568+01:00",
      "name": "apache_log_wb",
      "permission": {
        "groups": {},
        "owner": "system",
        "permissionForOthers": {
          "executable": true,
          "readable": true,
          "writable": true
        },
        "publiclyShared": false
      },
      "uuid": "1a552255-3f2a-407d-9270-2813af4c1a74"
    },
    "jobConfiguration": {
      "dataRetentionPolicy": {
        "_type": "PurgeAfter",
        "minimumToKeep": 1
      },
      "hadoopProperties": {},
      "logging": {
        "properties": {}
      },
      "triggering": {
        "_type": "DataDrivenTriggering",
        "sheets": {}
      }
    },
    "notification": {
      "emailsInCaseOfFailure": [],
      "emailsInCaseOfSuccess": []
    },
    "sheets": [
      {
        "_type": "DataSourceReferenceSheet",
        "uuid": "69aee54f-44f1-4d9a-a259-2fba7aa91a69",
        "columns": [
          {
            "id": "remoteHost",
            "name": "remoteHost",
            "position": 0
          },
          {
            "id": "logName",
            "name": "logName",
            "position": 1
          },
          {
            "id": "remoteUser",
            "name": "remoteUser",
            "position": 2
          },
          {
            "id": "requestTime",
            "name": "requestTime",
            "position": 3
          },
          {
            "id": "request",
            "name": "request",
            "position": 4
          },
          {
            "id": "status",
            "name": "status",
            "position": 5
          },
          {
            "id": "bytesSent",
            "name": "bytesSent",
            "position": 6
          }
        ],
        "identifier": "7f170571-06e1-4655-b9b8-823b228df25c",
        "kept": false,
        "name": "apache_log",
        "position": 0
      },
      {
        "_type": "FormulaSheet",
        "columns": [
          {
            "formula": "=GROUPBY(#apache_log!status)",
            "id": "0",
            "name": "A",
            "position": 0
          },
          {
            "formula": "=GROUPCOUNT()",
            "id": "1",
            "name": "B",
            "position": 1
          }
        ],
        "identifier": "2228a24d-87fc-4bf5-bc40-3b7486c33a49",
        "kept": true,
        "name": "status",
        "position": 1
      }
    ],
    "properties": {}
  },
  "_links": {
    "file": {
      "href": "/api/filesystem/files/1a552255-3f2a-407d-9270-2813af4c1a74"
    },
    "self": {
      "href": "/api/filesystem/workbooks/1a552255-3f2a-407d-9270-2813af4c1a74"
    }
  }

Create Workbook

This REST API call has been deprecated as of Datameer v7.0 and is scheduled to be removed before the release of Datameer v8.0. It is replaced by the call Create Workbook v2.

Request method - POST

Description

Adds a workbook in Datameer.

URI syntax

curl -u <username>:<password> -X POST -d @<file name>.json 'http://<Datameer-serverIP>:<port-number>/rest/workbook'

Example response

{ 
    "configuration-id": 48,
    "status": "success"
}   

Additional notes

<file name>.json

  • The workbook file is a JSON representation of all information entered during the creation process using the web interface.
  • An easy method of creating a workbook file is to use REST to read an import job, data link ,or workbook and change the JSON that is returned.
  • Injecting a workbook from a JSON file needs to match the current version of Datameer. Backup workbooks from previous versions of Datameer aren't supported unless properly migrated during the upgrade.

Create Workbook (version 2)

Request method - POST

Description

Creates a workbook based on a JSON representation for workbooks using the Git versioning plug-in.

URI syntax

curl -u <username>:<password> -X POST -H "Content-Type:application/json" -d @<file name>.json 'http://<Datameer-serverIP>:<port-number>/api/workbooks'

Response

If the request is successful, there is no output.

Additional notes

<file name>.json

  • The workbook file is a JSON representation of all information entered during the creation process using the web interface.
  • An easy method of creating a workbook file is to use REST to read an import job, data link ,or workbook and change the JSON that is returned.
  • Injecting a workbook from a JSON file needs to match the current version of Datameer. Backup workbooks from previous versions of Datameer aren't supported unless properly migrated during the upgrade.

Update Workbook

This REST API call has been deprecated as of Datameer v7.0 and is scheduled to be removed before the release of Datameer v8.0. It is replaced by the call Update Workbook v2.

Request method - PUT

Description

Edits an existing workbook in Datameer.

URI syntax

curl -u <username>:<password> -X PUT -d @<file name>.json 'http://<Datameer-serverIP>:<port-number>/rest/workbook/<workbook-configuration-id>'

Example response

{"status": "success"} 

Additional notes

<file name>.json

  • The workbook file is a JSON representation of all information entered during the creation process using the web interface.
  • An easy method of creating a workbook file is to use REST to read an import job, data link ,or workbook and change the JSON that is returned.
  • Injecting a workbook from a JSON file needs to match the current version of Datameer. Backup workbooks from previous versions of Datameer aren't supported unless properly migrated during the upgrade.

Update Workbook (version 2)

Request method - PUT

Description

Updates an existing workbook using the Git versioning plug-in.

URI syntax

curl -u <username>:<password> -X PUT -H "Content-Type:application/json" -d @<file name>.json 'http://<Datameer-serverIP>:<port-number>/api/workbooks/<file-id>

Response

If the request is successful, there is no output.

Additional notes

<file name>.json

  • The workbook file is a JSON representation of all information entered during the creation process using the web interface.
  • An easy method of creating a workbook file is to use REST to read an import job, data link ,or workbook and change the JSON that is returned.
  • Injecting a workbook from a JSON file needs to match the current version of Datameer. Backup workbooks from previous versions of Datameer aren't supported unless properly migrated during the upgrade.

Delete Workbook

Request method - DELETE

Description

Removes a workbook from Datameer.

URI syntax

curl -u <username>:<password> -X DELETE 'http://<Datameer-ServerIP>:<Port>/rest/workbook/<workbook-configuration-id>'

Example response

{"status": "success"} 

Metadata of Workbook

Request method - GET

Description

Returns data on the workbook including the path, number of records, time stamp, and ID.

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/data/workbook/{configuration-id}

Example response

[
{
"path": "/Data/ImportJobs/DatameerImport.imp",
"record-count": 20,
"datas": [
{
"timestamp": "Mar 5, 2013 10:44:59 AM",
"record-count": 20,
"id": 19372
}
]

Download Data of Workbook

Request method - GET

Description

Returns the column names and records of the workbook.

The default limit for number of rows to download is 100,000, as this functionality is intended for small aggregated data sets. To adjust the record download limit, change the rest.download-data.records-max=100000 property in the <datameer_install>/conf/default.properties file. Setting the value to 0 unlocks the limit, but increasing the number could result in slower processing for the Datameer conductor. Your local system might also have download restrictions. If you want to download more than 100,000 rows, we suggest creating an export job instead.

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/data/workbook/{configuration-id}/{sheet-name}/download
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/data/workbook/{configuration-id}/{sheet-name}/download?dataId={data-id}

Example response

"ID","NAME","Email","Status","Check"
"1","""admin""","""admin@datameer.com""","0","true"
"2","""Ajay""","""Ajay@datameer.com""","2","true"
"3","""analyst""","""analyst@datameer.com""","1","true"
"4","""Bob""","""Bob@datameer.com""","2","false"
"5","""Alice""","""Alice@datameer.com""","2","false"
"6","""John""","""John@datameer.com""","2","false"
"7","""Andreas""","""Andreas@datameer.com""","2","true"
"8","""Arthur""","""Arthur@datameer.com""","2","true"
"9","""Dagmar""","""Dagmar@datameer.com""","2","false"
"10","""Frank""","""Frank@datameer.com""","2","true"
"11","""Johannes""","""Johannes@datameer.com""","2","true"
"12","""Marko""","""Marko@datameer.com""","2","true"
"13","""Marlon""","""Marlon@datameer.com""","2","true"
"14","""Mike""","""Mike@datameer.com""","2","true"
"15","""Orlando""","""Orlando@datameer.com""","2","true"
"16","""Peter""","""Peter@datameer.com""","2","true"
"17","""Ralf""","""Ralf@datameer.com""","2","false"
"18","""Shirish""","""Shirish@datameer.com""","2","true"
"19","""Stefan""","""Stefan@datameer.com""","2","true"
"20","""Teresa""","""Teresa@datameer.com""","2","true" 

Sheet Details of Workbook

Request method - GET

Description

Returns the column names and data type of a workbook.

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/sheet-details/<workbook-configuration-id>/<sheet-name>'
curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/sheet-details?file=<path-to-workbook>.wbk&sheetName=<sheet-name>'

Example response

{
    "columns": [
        {
            "name": "remoteHost",
            "type": "STRING"
        },
        {
            "name": "remoteUser",
            "type": "STRING"
        },
        {
            "name": "timeEnglishFormat",
            "type": "DATE"
        },
        {
            "name": "request",
            "type": "STRING"
        },
        {
            "name": "status",
            "type": "INTEGER"
        },
        {
            "name": "bytesSent",
            "type": "INTEGER"
        }
    ],
    "file": {
        "path": "/Examples/Basic Tutorial/Solution/Basic Workbook.wbk",
        "uuid": "c02c5f10-2d30-4320-b2ec-52f89550bfe5"
    },
    "sheetId": "SheetId[_id=2c87ddad-fea4-441a-8475-6ce4cbb5def4]",
    "sheetName": "Clickstream_Data",
    "sheetType": "das.internal.DataSourceSheetType"
}  

List All Workbooks

Request method - GET

Description

Returns a list of all the workbooks in Datameer. This list displays the description, ID number, name, and the path of the workbooks. 

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/rest/workbook'

Example response

[
    {
        "description": "",
        "id": 388,
        "name": "Workbook_copy5",
        "path": "/Workbooks/Andreas/Workbook_copy5.wbk"
    },
    {
        "description": "",
        "id": 393,
        "name": "wb 1605 twitter",
        "path": "/Workbooks/tester/wb 1605 twitter.wbk"
    },
    {
        "description": "",
        "id": 396,
        "name": "wbk_ext_reference",
        "path": "/Workbooks/wbk_ext_reference.wbk"
    },
    {
        "description": "",
        "id": 397,
        "name": "wbk_ext_ref_2",
        "path": "/Workbooks/wbk_ext_ref_2.wbk"
    }

Start Workbook

Request method - POST

Description

Runs a workbook.

URI syntax

curl -u <username>:<password> -X POST 'http://<Datameer-serverIP>:<port-number>/rest/job-execution?configuration=<workbook-configuration-id>'

Example response

{
    "job-execution-id": 1,
    "job-execution-trigger": "RESTAPI",
    "job-execution-user": "admin",
    "status": "success"
} 

Workbook Dependencies

This API requires enabling Datameer's Advanced Governance plug-in.

Request method - GET

Description

Returns the hierarchy of up- and downstream dependencies for a given workbook.

URI syntax

curl -u <username>:<password> -X GET 'http://<server>:<port>/api/workbook/[configurationID]/dependencies[?direction=<upstream | downstream>][&level=<number>]'

Example response

{
  "dependencies": [
    {
      "id": 22,
      "file": {
        "path": "/Users/admin/ImportJobTest",
        "name": "ImportJobTest",
        "type": "imp",
        "description": "",
        "uuid": "b8f258f5-90c9-451d-9058-9d3a8c9b2c5d"
      }
    },
    {
      "id": 2,
      "file": {
        "path": "/Data/Connections/Datameer server filesystem",
        "name": "Datameer server filesystem",
        "type": "dst",
        "description": "A data store for the local filesystem where Datameer is running.  Note, this works ONLY for Datameer Personal, Workgroup, and Trial editions.\n",
        "uuid": "78a2fb59-375e-4eae-b338-956ef806f7b1"
      }
    }
  ],
  "fileCountWithNoReadPermission": 0,
  "_links": {
    "self": {
      "href": "http://localhost:8088/api/workbook/23/dependencies"
    }
  }

Additional notes

Path parameters:

  • configurationId:
    • Data type must be a number
    • Use the configuration ID

Query parameters:

  • Direction:
    • Data type must be a string
    • Optional
    • Shows either upstream or downstream
    • If left blank, shows both
  • Level:
    • Data type must be a number
    • Optional
    • If left blank, shows all levels

View Workbook Permissions

Request method - GET

Description

Returns a list of all the workbook's permission settings.

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/workbooks/<FileID>/permission'

Response

{
  "readableForOthers": true,
  "_links": {
    "file": {
      "href": "/api/filesystem/files/43"
    },
    "groups": {
      "href": "/api/filesystem/files/43/permission/groups"
    },
    "self": {
      "href": "/api/workbooks/43/permission"
    },
    "others": {
      "href": "/api/filesystem/files/43/permission/others"
    }
  },
  "_embedded": {
    "groups": [
      {
        "readable": true,
        "name": "IT-Dept.",
        "_links": {
          "self": {
            "href": "/api/filesystem/files/43/permission/groups/IT-Dept."
          },
          "permission": {
            "href": "/api/filesystem/files/43/permission"
          }
        }
      }
    ]
  }

Advanced Parameters 

View the workbook's permissions for others

Returns a list of the workbook's permission settings for "Others".

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/workbooks/<FileID>/permission/others'

View the workbook's permissions for groups

Returns a list of the workbook's permission settings for all "Groups".

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/workbooks/<FileID>/permission/groups'

View the workbook's permissions for a specific group

Returns the workbook's permission settings for a selected "Group".

URI syntax

curl -u <username>:<password> -X GET 'http://<Datameer-serverIP>:<port-number>/api/workbooks/<FileID>/permission/groups/<group-name>'


Roll Back a Workbook

Request method - PUT

Description

Rolls back a workbook to a previous state using the Git versioning plug-in. If the workbook exists, it is overwritten. If it doesn't exist, a new one is created. This REST API must be used in conjunction with other version 2 REST APIs.

URI syntax

curl -u <username>:<password> -X PUT -H "Content-Type:application/json" -d @wbk.json 'http://<Datameer-serverIP>:<port-number>/api/workbooks/rollback'

Response

If the request is successful, there is no output.