Pinned topic Google Analytics
I am using Cast Iron to send an HTTP GET request to the Google Analytics API to perform several queries. The problem is when I send my HTTP GET request I receive the following message, "The request operation failed . Exception: Received Http Code:400 from www.googleapis.com." The 400 error code indicates there is something in the query string that is not correct. Here is a sample of my query string, https://www.googleapis.com/analytics/v3/data/ga? and also utilizing the following URI, ids=ga%3AXXXXXXX&dimensions=ga%3AvisitorType%2Cga%3AvisitCount%2Cga%3AdaysSinceLastVisit%2Cga%3AuserDefinedValue&metrics=ga%3Avisitors&start-date=2012-11-29&end-date=2012-12-13&max-results=10000. I am also providing an authorization token as a header item in my GET request.
To build the query string I used http://ga-dev-tools.appspot.com/explorer/. I have tried using as few as one metric and I also tried switching between tables to see if that made a difference, but I have had no luck in getting my query to work.
Does anyone have experience with the Google Analytics API and know why I would be receiving the 400 error code?
Please let me know if I need to provide any more information.
SystemAdmin 110000D4XK1250 Posts
DGarriott 270004E2P38 Posts
ESBDeveloper 270002CRFF1 PostACCEPTED ANSWER
Re: Google Analytics2015-03-11T20:14:01Z in response to DGarriott
I know it was while a ago you may worked on this. I am also working on the similar requirement pulling the data from Google analytics. I ama able to get eh token and then when trying to fetch the data it is failing to connect to get http activity and throwing below error. Any idea about the below error. Can you please give mfew details how you are trying to retrieve the data like which activity you are using and what are the high level params etc
"The send request failed. Exception: Error while parsing the host port. Incorrect port number:"