0
votes

I am trying to make a rest api call for google big query from the command line. This is the POST request I have, but after I enter the content in the command line, I do not get any errors or results.

Could anyone please provide some comments?

POST https://www.googleapis.com/bigquery/v2/projects/projname/queries
Please enter content (application/x-www-form-urlencoded) to be POSTed:
{
  "kind": "bigquery#queryRequest",
  "query":  "SELECT count(*) As Count FROM [projname:datasetname.tablename]",
  "maxResults": unsigned integer,
  "defaultDataset": {
    "datasetId": datasetname,
    "projectId": projname
   },
  "timeoutMs": 1000000,
  "dryRun": boolean,
  "preserveNulls": boolean,
  "useQueryCache": boolean,
  "useLegacySql": boolean,
  "parameterMode": string,
  "queryParameters": [
  {
    "name": string,
    "parameterType": {
      "type": string,
      "arrayType": (QueryParameterType),
      "structTypes": [
      {
        "name": string,
        "type": (QueryParameterType),
        "description": string
      }
    ]
  },
  "parameterValue": {
    "value": string,
    "arrayValues": [
      (QueryParameterValue)
    ],
    "structValues": {
      (key): (QueryParameterValue)
    }
  }
}
]
}
1

1 Answers

0
votes

Your motivation about going the way you show in question is not super clear, but if you are trying to just play with query API - the best way I can recommend you is to use respective BigQuery Query API Explorer
This will allow you to get to the point when all your "syntax" / resources are passed correctly and you are getting expected result.
After this step is passed - yo can then implement it in client of your choice

Note: you can try/play all BigQuery APIs in APIs Explorer