Using Zoomdata Upload API
You can use the Zoomdata Upload API connector to dynamically upload your data.
Configure this connector in the following way:
- Make sure MongoDB is up and running. For more information, see Managing the Upload API as a Streaming Source .
- Get the cURL for your data source.
- Configure fields and charts settings.
- Load your data to Zoomdata.
The table below lists information on the features that for upload API:
|Supports Distinct Count?||Yes|
|Supports Live Mode/ Playback?||Yes|
|Supports Group-by Time?||Yes|
|Supports Multi Group-by Charts?||Yes|
|Supports Box Plot?||No|
|Custom SQL Capable?||No|
|Supports Last Value?||No|
CONFIGURING THE CONNECTION
For details about what is provided on each page of the connection process, review the article Source Connection Workflow . Depending on your needs, you can either follow the steps in order from start to finish or jump to a specific section in the connection process:
Getting The cURL
Log into Zoomdata.
Administrators and users with appropriate access privileges can connect data sources in Zoomdata.
F igure 1
- Specify the name of your source and add a description (if desired).
The data from your data source are stored in MongoDB.
On this page, you need to provide a sample JSON for creating a collection in a MongoDB. Keep in mind that these are just sample data and they will not be uploaded to Zoomdata. Instead, you can manage your actual data using the cURL.
Perform the steps listed below.
- In the Upload Information section, provide a JSON sample data. These data will be used just for fields type and names detection. Click Validate .
Once successfully validated, the default
will be generated in the Example Default
- Click Next to proceed to fields configuration.
The Fields page lets you (1) configure attribute options, (2) create custom labels for the fields in your data source (that will be displayed in the charts), (3) manage the Volume metric, and (4) work with Calculations.
- Determine whether the field should be visible or not to the user.
- Create unique label names, as needed, for each Label field.
- For the Type column, you have the option to edit the field type (although usually you won't need to do this).
column, numeric and time-based fields may be edited:
- Numeric types including Money, Number and Integer - ability to select a default aggregation function
- Time fields - ability to define the default time pattern and granularity; if the time field provides granularities of hour, minute and second, then a time zone label may be applied
- Select fields for Distinct Counts as needed.
- Refresh the connection to a particular field, as desired.
- Configure Filter Display settings for fields.
- Edit the Volume Metric settings, as needed.
, if available and as needed.
If you are setting up a new connection, the Calculations section will not be available until after the connection is saved.
- Click Next to continue.
The Refresh page lets you schedule asynchronous jobs to update the source metadata. For guidance to set up a refresh schedule, refer to the article Using the Zoomdata Scheduler .
On the Charts page, you can:
- Edit Global Default Settings .
- Select the Standard and, if available, Custom chart styles to be used with the data source.
- Set default parameters (group, sub-group, colors, sorting, and so on) for each chart style.
Click Finish to save your changes. Once your data connection has been established, it is listed under the My Data Sources section of the page.
Loading Actual Data
To load your actual data, perform the following steps:
- On the API Endpoint page, copy the default cURL by clicking Copy to Clipboard. Paste the cURL to any text editor and change the default username and password to the actual Zoomdata credentials:
- Paste the default values to the JSON part:
You can also upload the array of JSON data. Note that the number of rows must not exceed the value specified for the
max.upload.rows property in zoomdata.properties file (by default is it set to 1000). Otherwise the request will be rejected.
Note that the object field types must be the same as in the sample that has been provided while creating the data source on the API Endpoint page.
For example, if the value of the quantity field is an integer, you can not upload new rows in which the value of the quantity field is a string.
If while uploading the new rows, the quantity field is not available, no data will be uploaded.
- Open the terminal window, paste and run the modified cURL. The data will be uploaded.
To add new fields to your data structure, use the POST method. For example, a new field - product category must be added to current data structure. Modify the cURL as follows: