Creating Datasource using API

Issue Summary

I am trying to create a data source with type “mssql” using the path /api/data_sources. I can successful authenticate and get the data sources that are currently on redash. However, whenever I try to create a POST request to create a new datasource i get the following error:
“message”: “The browser (or proxy) sent a request that this server could not understand.”

This is the body of the POST Request I am sending:
{

"name": "NewDB",

"type": "mssql",

"options": {

    "db": "mydatabase",

    "server": "myserverhost",

    "user": "sa",

    "password": "somepassword",

    "port": "1433"

}

}

Technical details:

  • Redash Version:
  • Browser/OS:
  • How did you install Redash:

Looking at the configuration schema for mssql here, port should be a number, not a string. Try this:

{
  "name": "NewDB",
  "type": "mssql",
  "options": {
    "db": "mydatabase",
    "server": "myserverhost",
    "user": "sa",
    "password": "somepassword",
    "port": 1433
  }
}

Oh wow, thank you :slight_smile: it seems i completely missed that part. \

Worked well now :slight_smile: