Expand my Community achievements bar.

SOLVED

Trouble using "startingWith" and "top" parameters with Realtime reports API

Avatar

Level 1

I've been running Realtime reports via the REST API, specifying the "startingWith" and "top" parameters but the "startingWith" parameter is not having any effect on the response - it seems to be ignored entirely. I'm seeing this with REST clients and also via the API explorer.

I'm also encountering "element_top_invalid" errors stating that "The maximum number of top element values supported is 100" whenever I set "top" to be greater than 100 - I've been reading that the max "top" value is 50000 - could there be a reason I'm getting these errors?

Your help with resolving these issues would be greating appreciated.

Many thanks,

Michael

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi Michael,

Looks like the documented max for "top" was 50 for version 1.3 of the API for GetRealTimeReport. For version 1.4 for Report.Run realtime I get the error below when setting "top" to > 100  

"The maximum number of top element values supported is 100"

Sample Query: "top":"101"

{ "reportDescription":{ "source": "realtime", "reportSuiteID":"RSID", "metrics":[ {"id":"pageviews"} ], "elements":[ {"id":"page", "top":"101", } ] } } 

Query Response

{ "error":"element_top_invalid", "error_description":"The maximum number of top element values supported is 100", "error_uri":"https:\/\/marketing.adobe.com\/developer\/documentation\/analytics-reporting-1-4\/errors" }

Also, as you wrote and experienced "startingWith" is ignored in my realtime query as well and the results are always displayed with the top result first.

{ "reportDescription":{ "source": "realtime", "reportSuiteID":"RSID", "metrics":[ {"id":"pageviews"} ], "elements":[ {"id":"page", "top":"100", "startingWith":"100" } ] } } 

Best,

Ryan

View solution in original post

7 Replies

Avatar

Employee

Hi Michael,

Apologies for a delayed response.

Could you please attach your API request so we could look and debug the issue you are facing?

Thanks!

TM

Avatar

Level 4

Hi Michael,

You have to set top to 50 or lower when using GetRealTimeReport for version 1.3 of the API.

Best,

Ryan

Avatar

Level 1

Hi Tanmay

Thank you for your reply.   The request we are making is specifying both the "top" and "startingWith" parameters, but "startingWith" is not being respected:

{"reportSuiteID”:”myReportSuiteId”,”dateFrom":"2015-12-18 06:29","dateGranularity":"minute:30","source":"realtime","metrics":[{"id":"pageviews"}],"elements":[{"id":"page","top":100,"startingWith":100},{"id":"referringdomain","selected":["facebook.com","t.co"]}]}

We are using version 1.4 of the API.

Many thanks,

Michael

Avatar

Level 1

Also,  thanks Ryan for your response.   The screenshot you posted is for the 1.3 API documententation, but we are using version 1.4 of the API - we are hitting a limit of 100 for "top", rather than the 50 that you indicate.   I can find no mention of this 100 limit in the 1.4 documentation.

Many thanks

Michael

Avatar

Correct answer by
Level 4

Hi Michael,

Looks like the documented max for "top" was 50 for version 1.3 of the API for GetRealTimeReport. For version 1.4 for Report.Run realtime I get the error below when setting "top" to > 100  

"The maximum number of top element values supported is 100"

Sample Query: "top":"101"

{ "reportDescription":{ "source": "realtime", "reportSuiteID":"RSID", "metrics":[ {"id":"pageviews"} ], "elements":[ {"id":"page", "top":"101", } ] } } 

Query Response

{ "error":"element_top_invalid", "error_description":"The maximum number of top element values supported is 100", "error_uri":"https:\/\/marketing.adobe.com\/developer\/documentation\/analytics-reporting-1-4\/errors" }

Also, as you wrote and experienced "startingWith" is ignored in my realtime query as well and the results are always displayed with the top result first.

{ "reportDescription":{ "source": "realtime", "reportSuiteID":"RSID", "metrics":[ {"id":"pageviews"} ], "elements":[ {"id":"page", "top":"100", "startingWith":"100" } ] } } 

Best,

Ryan

Avatar

Level 1

Hi Tanmay

Did you see my response containing the request we are sending - wondered if you could give me an update?   Thanks to Ryan for his responses - he has also confirmed that "startingWith" parameter is being ignored by the API.   Is this a bug with the API ?

Many thanks,

Michael

Avatar

Employee

Hi Micheal,

Ryan is correct in his answer because real time reports are configured differently than standard reports so the "startingwith" for the standard report would not function with the real time report. In general, if you could use a functionality in the Web UI you can use it in the API as well and vice versa.

Thanks!

Tanmay