Title: Rest-api return
Last modified: January 16, 2025

---

# Rest-api return

 *  Resolved [hippoosupport](https://wordpress.org/support/users/hippoosupport/)
 * (@hippoosupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/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](http://hippoo.app).
 * We would greatly appreciate it if you could check and resolve the issue at your
   earliest convenience.
 * Thank you for your support!

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18249224)
 * Hello [@hippoosupport](https://wordpress.org/support/users/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,DannyPS. Hippoo looks really slick. Nice job!
 *  Thread Starter [hippoosupport](https://wordpress.org/support/users/hippoosupport/)
 * (@hippoosupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18249663)
 * 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.
 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18249690)
 * Hi [@hippoosupport](https://wordpress.org/support/users/hippoosupport/),
 * I don’t really see us adding support for WooCommerce authentication keys explicitly,
   but a filter hook on the `permission_callback` is 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
   on `koko_analytics_settings` and set `is_dashboard_public` to `1`. Example:
 *     ```wp-block-code
       // Note: dummy code, replace with proper authorization check using WooCommerce Auth Keysif (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_init` then 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,Danny
 *  Thread Starter [hippoosupport](https://wordpress.org/support/users/hippoosupport/)
 * (@hippoosupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18249697)
 * Thanks so much, Danny.
 *  Super helpful.
 *  Thread Starter [hippoosupport](https://wordpress.org/support/users/hippoosupport/)
 * (@hippoosupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18251532)
 * 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/realtime](https://dev.hippoo.app/wp-json/koko-analytics/v1/realtime)
 * It seems this one is still broken. Could you please check?
 *     ```wp-block-code
       <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 />1
       ```
   
 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18252118)
 * Hi [@hippoosupport](https://wordpress.org/support/users/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, 4 months ago by [Danny van Kooten](https://wordpress.org/support/users/dvankooten/).
 *  Thread Starter [hippoosupport](https://wordpress.org/support/users/hippoosupport/)
 * (@hippoosupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18265302)
 * 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.
 * [https://dev.hippoo.app/wp-json/koko-analytics/v1/stats](https://dev.hippoo.app/wp-json/koko-analytics/v1/stats)
 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18265803)
 * Hi [@hippoosupport](https://wordpress.org/support/users/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!
 *  Thread Starter [hippoosupport](https://wordpress.org/support/users/hippoosupport/)
 * (@hippoosupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18282232)
 * **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=false`
 * Even though `"monthly=false"`, we are still receiving cumulative monthly numbers.
 * Could you please make a quick fix to resolve this issue?
 * Thanks so much!
 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18282492)
 * Hello [@hippoosupport](https://wordpress.org/support/users/hippoosupport/),
 * Can you try using `0` as the value for the `monthly` query parameter, please?
 * `/koko-analytics/v1/stats?start_date=2025-01-01&end_date=2025-01-15&monthly=0`
 * We’ll push an update so that you can supply `false` value as well, but until 
   then this should do the trick.
 * Best, 
   Danny
 *  Thread Starter [hippoosupport](https://wordpress.org/support/users/hippoosupport/)
 * (@hippoosupport)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18320440)
 * Hello Koko Analytics team,
 * We’re excited to share that we’ve integrated Koko Analytics into our [Hippoo WooCommerce app](http://hippoo.app)!
 * ![](https://i0.wp.com/hippoo.app/wp-content/uploads/2025/02/koko-analytics-shot-
   2048x943.png?resize=2048%2C943&ssl=1)
 * 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 Analytic](https://hippoo.app/2025/02/06/track-your-woocommerce-store-analytics-with-hippoo-koko-analytics/)
 * If 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, 3 months ago by [hippoosupport](https://wordpress.org/support/users/hippoosupport/).
 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18320467)
 * [@hippoosupport](https://wordpress.org/support/users/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!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Rest-api return’ is closed to new replies.

 * ![](https://ps.w.org/koko-analytics/assets/icon.svg?rev=2980600)
 * [Koko Analytics - Privacy-Friendly WordPress Analytics](https://wordpress.org/plugins/koko-analytics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/koko-analytics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/koko-analytics/)
 * [Active Topics](https://wordpress.org/support/plugin/koko-analytics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/koko-analytics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/koko-analytics/reviews/)

## Tags

 * [woocommerce app](https://wordpress.org/support/topic-tag/woocommerce-app/)

 * 12 replies
 * 2 participants
 * Last reply from: [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/rest-api-return/#post-18320467)
 * Status: resolved