Rest-api return
-
Hello,
It seems that the following endpoint:
example.com/wp-json/koko-analytics/v1/stats
is returning a “500 Internal Server Error.”We have deactivated all other plugins, but it appears that there might be an issue specifically with the Koko Analytics REST API.
We are reviewing the plugin’s API, and if it works well, we plan to make one integration with our Hippoo WooCommerce app.
We would greatly appreciate it if you could check and resolve the issue at your earliest convenience.
Thank you for your support!
-
Hello @hippoosupport,
Thanks for bringing that issue to our attention – you’re absolutely right, something was broken in our plugin. The fix will be included in the next plugin release, but for now you can also bypass it by passing a valid start_date parameter in the URL.
For example:example.com/wp-json/koko-analytics/v1/stats?start_date=2024-12-01
Best,
Danny
PS. Hippoo looks really slick. Nice job!Thanks so much, it works well with the trick you said.
I wanted to kindly inquire if it would be possible to add an additional authentication method for accessing the API via WooCommerce REST API keys. This change would help improve our integration process.
Currently, Hippoo accesses data using WooCommerce authentication keys, but since Koko uses a different method, it has been challenging to integrate.
We would greatly appreciate your consideration of this enhancement, as it would make the process much more manageable on our end. Thank you so much for your time and support!
Looking forward to your feedback.
Hi @hippoosupport,
I don’t really see us adding support for WooCommerce authentication keys explicitly, but a filter hook on the
permission_callbackis probably a good idea!
Note that you can already accomplish a similar thing by doing something like this:
For REST requests with a valid WooCommerce auth key provided, add a filter hook onkoko_analytics_settingsand setis_dashboard_publicto1.
Example:// Note: dummy code, replace with proper authorization check using WooCommerce Auth Keys
if (REST_REQUEST && woocommerce_authorize_request()) {
add_filter('koko_analytics_settings', function ($settings) {
$settings['is_dashboard_public'] = '1';
return $settings;
});
}As long as the code above runs before
rest_api_initthen this should also authorize requests using a WooCommerce Auth Keys.
But again, I agree that a filter hook on/in the REST authorization callback sounds nice so we’ll probably add that.
Best,
DannyThanks so much, Danny.
Super helpful.
Apologies for coming back to you with another question.
First of all, thank you for the update! We’re happy to see the previous issue has been resolved.
That said, we have a question regarding this URL:
https://dev.hippoo.app/wp-json/koko-analytics/v1/realtimeIt seems this one is still broken. Could you please check?
<br />
<b>Deprecated</b>: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in <b>/var/www/html/dev.hippoo.app/public_html/wp-content/plugins/koko-analytics/src/functions.php</b> on line <b>145</b><br />
1Hi @hippoosupport,
Thanks – nice catch again. Will fix! Until then you can bypass it by explicitly passing a since parameter.
Example: GET /wp-json/koko-analytics/v1/realtime?since=-10+minutes
since can be a relative time string that strtotime() understands, or a Unix timestamp.-
This reply was modified 1 year, 1 month ago by
Danny van Kooten.
Hello Danny,
Just wanted to let you know that it seems there is an issue with the recent update, allowing access to the stats without requiring authentication.
Hi @hippoosupport,
Ugh, thanks for the heads up. I ended up accidentally pushing something which I only added for testing one of my previous comments in this thread. Fix is going out right away!
Hi there,
We’ve discovered another issue in the REST API.
For example, when we request the following endpoint:
/koko-analytics/v1/stats?start_date=2025-01-01&end_date=2025-01-15&monthly=falseEven though
"monthly=false", we are still receiving cumulative monthly numbers.Could you please make a quick fix to resolve this issue?
Thanks so much!
Hello @hippoosupport,
Can you try using
0as the value for themonthlyquery parameter, please?/koko-analytics/v1/stats?start_date=2025-01-01&end_date=2025-01-15&monthly=0We’ll push an update so that you can supply
falsevalue as well, but until then this should do the trick.Best,
DannyHello Koko Analytics team,
We’re excited to share that we’ve integrated Koko Analytics into our Hippoo WooCommerce app!

Store owners can now track their website analytics directly within Hippoo, making it easier to gain insights without need to come to WordPress dashboard. We’ve written about this integration here:
Track Your WooCommerce Store Analytics with Hippoo & Koko AnalyticIf possible, we’d love for you to feature this integration on your website so more users can discover and benefit from it.
Additionally, if you have any other plugins that you think would be valuable for integration, we’d love to explore the possibilities. Let us know your thoughts!
Thanks,
-
This reply was modified 1 year ago by
hippoosupport.
@hippoosupport Nice, that looks sleek! I’ve just shared it on my social media accounts and plan to write about your integration on the Koko Analytics blog as well. Nicely done!
-
This reply was modified 1 year, 1 month ago by
The topic ‘Rest-api return’ is closed to new replies.