Use the Upload API

You can use the Composer Upload API to dynamically upload and stream your data in real-time. Uploaded data can be in CSV or JSON XML formats. Setting up and configuring an Upload API connector has two parts:

See Manage Connectors and Connector Servers for general instructions on enabling the Upload API connector.

After the connector has been set up, you can create data source configurations that specify the necessary connection information and identify the data you want to use. See Manage Data Source Configurations for more information. After data sources are configured, they can be used to create dashboards and visuals from your data. See Create Dashboards.

Composer Feature Support

Upload API support for specific Composer features is shown in the following table.

Key: P - Supported; O - Not Supported; N/A - not applicable

Feature Supported?
Admin-Defined Functions P
Box Plots P
Custom SQL Queries O
Derived Fields (Row-Level Expressions) P
Distinct Counts P
Fast Distinct Values N/A
Group By Multiple Fields P
Group By Time P
Group By UNIX Time P
Histogram Floating Point Values P
Histograms P
Kerberos Authentication O
Last Value P
Live Mode and Playback P
Multivalued Fields N/A
Nested Fields N/A
Partitions O
Pushdown Joins for Fusion Data Sources P
Schemas P
Text Search N/A
User Delegation O
Wild Card Filters P
Wild Card Filters, Case-Insensitive Mode P
Wild Card Filters, Case-Sensitive Mode P

Set Up the Upload API Data Source

  1. Log into Composer as an administrator.

  2. Select Sources.

  3. Select Upload API.

  4. Specify the name of your source and add a description (if desired).

  5. Select .

  6. On the Sampling page, enter your sample data. The supported formats are CSV or JSON. You can also upload sample data from a file.

  7. Select Preview to view your data.

  8. Select .

  9. On the Fields Tab, edit the data shown for the source. For more information and steps, see Manage Data Source Configurations.

  10. Select .

  11. On the Refresh page, set the refresh rates or your data. If you want to schedule a refresh of all your data, select Schedule and then selecting an option. If you only want certain fields within your data to be refreshed, select Configuration.

  12. Use the sample cURL calls to clear previously stored data or add additional data to the source. The example cURL calls can be found on the API Endpoints page.

  13. Select .

  14. On the Visuals page, you can:

    • Edit Global Default Settings.

    • Select the Standard and, if available, Custom visual styles to be used with the data source.

    • Set default parameters (group, sub-group, colors, sorting, and so on) for each visual style.

  15. Select to save your changes. After your data connection has been established, it is listed under My Data Sources.

Work with the Upload API

There are two operations that can be performed using the Upload API: appending additional data and clearing previously uploaded data. The data source wizard offers convenient example cURL requests but the APIs can be leveraged from your preferred development platform.

Remember to modify the example cURL requests to include your own Composer credentials, replacing the placeholders for username and password.

curl -v --user <username>:<password> <YourServer>

Example: Append Data

In the following example, the Upload API accepts an array of JSON objects. Note that the object field types must match those used to create the Upload API source originally. For example, if the value of the price field is a number, you can not upload new rows in which the value of the price field is a string.

curl -v --user <username>:<password> 'https://<Your_Composer_Server>/ composer/api/upload/<YourDataSourceId>' -X POST -H "Content-Type: application/vnd.composer.v2+json" -d '[{"price":100.5,"venue_id":"V678","venue_name": "Pizza Barn"}]' --insecure

Example: Clear Previously Uploaded Data

In the example below, the Upload API will clear all previously uploaded data from the data source with the ID of <YourDataSourceId>.

curl -v --user <username>:<password> 'https://<Your_Composer_Server>/ api/upload/<YourDataSourceId>' -X DELETE --insecure