Connecting to Url

  • Name: The Data Source name
  • URL Base Path: The location of the desired file, starting with the host name and then the file address (without the filename and ending with a /)

Using a URL-based Data Source requires that the service that returns data on the specified URL will use our data format (see the following example).

The query itself inside Redash will simply contain the URL to be executed (such as http://myserver/path/myquery) and return with all the data it has.

Here's a list of valid column types that are acceptable to be returned in results:

  • Integer
  • Float
  • Boolean
  • String
  • Datetime
  • Date

To post-process the data you get from your URL Data Source, you have to save the query and then query that dataset (more about querying Query Results as Dataset is, covered later in this chapter).

The following is an example JSON that is expected to receive the URL from the Data Source:

{
  "columns": [
    {
      "name": "created_date",
      "type": "date",
      "friendly_name": "created_date"
    },
    {
      "name": "adv_uuid",
      "type": "string",
      "friendly_name": "advertiser_uuid"
    },
    {
      "name": "cmp_cnt",
      "type": "integer",
      "friendly_name": "campaigns_count"
    },
    {
      "name": "total_rev",
      "type": "double",
      "friendly_name": "total_revenue"
    }
  ],
  "rows": [
    {
      "adv_uuid": "518ff4e6-80ab-11e8-adc0-fa7ae01bbebc",
      "cmp_cnt": 50,
      "total_rev": 100.2,
      "created_date": "2018-05-30"
    },
    {
      "adv_uuid": "518334e6-80ac-22e8-ebc0-fa9ae011bc12",
      "cmp_cnt": 12,
      "total_rev": 2600.5,
      "created_date": "2018-02-01"
    }
  ]
}

As we can see in the preceding example, columns contain the column names and their datatypes, and rows contain the data itself.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset