Title: API not working
Last modified: September 11, 2023

---

# API not working

 *  Resolved [pablosan42](https://wordpress.org/support/users/pablosan42/)
 * (@pablosan42)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/api-not-working-10/)
 * Hello!
 * I am working with an application that has a webapp as well as an mobile app. 
   For the mobile app i am using the API to manage the wishlist of users. Our customer
   brought up that recently the wishlist is not working anymore. No items can be
   added and none show up. However on the homepage everything works fine.
 * I am using the `/wp-json/wc/v3/wishlist/get_by_user/{userid}` to retreive the`
   share_key` of the users wishlist. The result is as follows:
 *     ```wp-block-code
       [
           {
               "id": 2204,
               "user_id": 8313,
               "date_added": "2023-05-15 14:02:17",
               "title": "Wunschliste",
               "share_key": "91021b"
           }
       ]
       ```
   
 * I checked on the homepage and the share key is the same. I went to my wishlist
   and checked the <form> element. It has the data attribute `data-tinvwl_sharekey
   ="91021b"`.
 * When i call the `/wp-json/wc/v3/wishlist/91021b/get_products?count=100` API, 
   i am getting an empty array `[]`. However, on the homepage i added a product 
   to the wishlist, so it should not be empty. As I said, on the homepage everything
   looks okay.
 * The same goes for the POST `/wp-json/wc/v3/wishlist/91021b/add_product` API. 
   If I am trying to add a product, i am getting the following error:
 *     ```wp-block-code
       {
           "code": "ti_woocommerce_wishlist_api_wishlist_products_not_found",
           "message": "Das Hinzufügen des Produktes zur Wunschliste ist fehlgeschlagen.",
           "data": {
               "status": 400
           }
       }
       ```
   
 * I confirmed that the product_id I am sending is correct, and that the same product
   works if i try it on the website. I have seen that someone else had the same 
   issue, that was still unresolved: [https://wordpress.org/support/topic/always-get-the-error-products-not-found-for-a-valid-product/](https://wordpress.org/support/topic/always-get-the-error-products-not-found-for-a-valid-product/)
 * Can you please help me with this? If there is any other information needed, please
   inform me.

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

 *  [widdydev](https://wordpress.org/support/users/widdydev/)
 * (@widdydev)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/api-not-working-10/#post-17180094)
 * I was facing the exact same issue and could find out that there was a bug in 
   the plugin itself.
   I already created a [pull-request](https://github.com/TemplateInvaders/ti-woocommerce-wishlist/pull/41)
   that fixes that issue. In the meantime you could also apply the changes according
   to the pull request directly in the files on your server.
 *  Plugin Author [templateinvaders](https://wordpress.org/support/users/templateinvaders/)
 * (@templateinvaders)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/api-not-working-10/#post-17227892)
 * Hi [@pablosan42](https://wordpress.org/support/users/pablosan42/) and [@widdydev](https://wordpress.org/support/users/widdydev/)
 * The issue has been fixed in version 2.8.0. Feel free to update our plugin to 
   the latest version.
 * Thanks for the pull request!

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

The topic ‘API not working’ is closed to new replies.

 * ![](https://ps.w.org/ti-woocommerce-wishlist/assets/icon-256x256.gif?rev=2469447)
 * [TI WooCommerce Wishlist](https://wordpress.org/plugins/ti-woocommerce-wishlist/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ti-woocommerce-wishlist/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ti-woocommerce-wishlist/)
 * [Active Topics](https://wordpress.org/support/plugin/ti-woocommerce-wishlist/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ti-woocommerce-wishlist/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ti-woocommerce-wishlist/reviews/)

 * 3 replies
 * 5 participants
 * Last reply from: [templateinvaders](https://wordpress.org/support/users/templateinvaders/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/api-not-working-10/#post-17227892)
 * Status: resolved