Datasource API


Overview


Investment Cafe Investor Portal offers the capability to build customisable dashboards consisting of data widgets (charts, graphs) to visualise your data.

The Datasource API allows you to create and manage the data sources used to populate these data widgets.


Getting Started


The following diagram provides an overview of the series of steps, needed to set up a datasource in Investment Cafe.




Each Call Step by Step


1. From the API, call POST /v1/datasource/schema with the description of your data model (this is a one time operation, assuming your data model does not change).

e.g
                        
    {
        "name": "my_ds_1",
        "schemaFields": [
            {
                "name": "Fundid",
                "dataType": "FUND"
            },
            {
                "name": "age",
                "dataType": "INTEGER"
            },
            {
                "name": "income",
                "dataType": "DOUBLE"
            },
            {
                "name": "Date Joined",
                "dataType": "DATE"
            }
        ]
    }
                        
                    


2. The next step is to create a pointer file, which is another one time operation.

To do this create a file using the .txt file extension (e.g my_ds_1.txt), then add the JSON example below as the content, specifying the Location with the name of your schema from step 1.

e.g pointer file content:
                        
    {
        "Location" :  "my_ds_1"
    }
                        
                    
Log into Investment Cafe Portal and head to Administration > Document Management > Upload Single Document
Select one of the ICX based document profiles (i.e Icx Datasource Subscriber). This should auto populate most of the form.
Set a suitable name for Document Title. This value will be the actual name that appears as a selectable datasource option, when editing widgets later on.
Continue through the upload wizard, ensuring the correct fund(s) and investor(s) relating to your data and your intended user audience are selected.
Once the pointer file upload is approved, log out of Portal.




3. With the setup now completed, you can begin uploading data via the API using POST /v1/datasource/data.

(please note, this must reference the schema id from step 1)

e.g
                        
    {
        "name" : "my_ds_q1_data",
        "schemaId" : 1,
        "data" : [
            {
                "fundid" : "Klop_op",
                "age" : 42,
                "income" : 125001.45,
                "Date Joined" : "08/21/2012"
            },
            {
                "fundid" : "Klop_op",
                "age" : 25,
                "income" : 130021.00,
                "Date Joined" : "07/16/2020"
            }
        ]
    }
                        
                    



4. Log back into Investment Cafe Portal and head to the Configure Portal section. Your data should now become available under the 'Datasource' drop down list, whenever editing any dashboard widget.


Once your dashboard widget is set up, you can periodically update data within your datasource by using the POST, PUT and DELETE API endpoints.


For example, use:


POST /v1/datasource/data to further supplement a datasource with new data. This will be automatically appended to all existing data.


PUT /v1/datasource/data to replace a block of data that may contain records that are longer up to date.


DELETE /v1/datasource/data to remove a block of data.


Validation Rules & Notes


- A data 'part' can be described as a collection of records.
- Each 'part' can be up to 10 MB in size.
- Each schema supports up to 1000 data 'parts'.
- Schema name must be unique.
- All schema field names must be unique within the schema.
- All data part names, must be unique within a given schema.
- Schema name, schema field name & data part name, all support up to 150 characters and can only consist of alphanumeric characters, hyphens & underscores.