3

I am currently using the Analytics API to get report metadata. With the report ID, i can see a report, but I want to query through a particular report with a particular filter in reportFilters.

There is an example here, but it doesn't provide what the REST url would look like to get that JSON response.

Is there a way to filter reports using the analytics API?

3

It is the same url, but you have the filters in the request body e.g.

$.ajax({
    type:'POST',
    url:'/services/data/v29.0/analytics/reports/' + reportId,
    data: JSON.stringify({ reportMetadata: reportMetadata }),
    contentType: "application/json; charset=utf-8",
    beforeSend: function(xhr) {xhr.setRequestHeader('Authorization', 'Bearer {!$Api.Session_ID}');},
    success: function(response) {
        cb(response);
    }
});

The website you linked as an example of what reportMetadata looks like. Alternatively you can do a request to

'/services/data/v29.0/analytics/reports/' + reportId + '/describe'

and have a look at the reportMetadata there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.