Skip to content

docs on sql api response examples missing json key 'fields' #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andy-esch opened this issue Jan 28, 2017 · 1 comment
Open

docs on sql api response examples missing json key 'fields' #408

andy-esch opened this issue Jan 28, 2017 · 1 comment
Labels

Comments

@andy-esch
Copy link
Contributor

In the SQL API docs, JSON responses include the keys time, rows, and total_rows, but lack 'fields' which describes the schema (field names and data types) of the response. An example is the response to this call: http://eschbacher.cartodb.com/api/v2/sql?q=select%20mag,place,time%20FROM%20all_month_3%20limit%201

{
  "rows": [
    {
      "mag": 0.22,
      "place": "15km S of Reno, Nevada",
      "time": "2015-02-15T01:35:33Z"
    }
  ],
  "time": 0.004,
  "fields": {
    "mag": {
      "type": "number"
    },
    "place": {
      "type": "string"
    },
    "time": {
      "type": "date"
    }
  },
  "total_rows": 1
}

I also noticed that the keys in the docs are not quoted, but valid JSON has quoted keys.

cc @csobier

@csobier csobier added the docs label Jan 30, 2017
@csobier
Copy link
Contributor

csobier commented Jan 30, 2017

Thanks @ohasselblad , I'll work with the developers and make sure we doc the full API response in the near future...

@csobier csobier changed the title docs on sql api response examplse missing json key 'fields' docs on sql api response examples missing json key 'fields' Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants