today_budget, today_CTR, and today_spend from /line_item endpoint

Posted in General by Tyler Conrad Tue Jul 10 2018 20:13:16 GMT+0000 (Coordinated Universal Time)·1·Viewed 340 times

I'm a developer with Spring Venture Group working on a monitoring application that integrates with Beeswax. I'd like to be able to use the API to retrieve 'today_spend', 'today_CTR' and 'today_budget' along with the default fields for the line_item endpoint with the view set to line_item_stats. When I request the following URL from a script I do not get the 'today_spend', 'today_CTR' or 'today_budget' fields: However when I log in to the portal UI and select these fields from the 'customize fields' button I see the same request in the chrome inspector with these fields in the JSON payload. I'm assuming you store the settings as to what fields to include in the payload in a cookie but I'm not sure. Is there any way to request these fields from the /line_item endpoint? If not would it be possible to configure a view to provide this information? Thanks for your help.
July 10, 2018

The reason you're not seeing the fields is that the field within this view are customizable and the user you are using to authenticate has not opted to include those fields in the view. The easy solution is to login using the API credentials then use the "customize fields" button in the UI to add the fields to the view. The API requests will thereafter have the fields.

The better solution is to add the following to the request: view_all=true, which will force the view to return all fields, even if those fields are not customized for the user.

Markdown is allowed