-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST API Support #9
Comments
Hi there
We of course suggest to create a PR to this repo, in order to improve and extend the plugin Talking about standards, we have no specific suggestions regarding plugin scaffolding, but of course we recommend to follow WP's coding standards and best practice in general; we'll hopefully write a contributing guide for this project soon enough Regarding namespace, I'd follow WC's example, and place the root of API at The structure of the API, instead, should describe the two main entities of the project: I'll spend some time drafting a possible API structure, to share here for anyone who may want to contribute, or even to get feedback before proceeding with development |
Tasks
|
As the deadline of one of my client projects approaches. I have created a separate plugin with the work and can be found here https://github.com/prionkor/yith-woocommerce-wishlist-rest-api The checklist above is a list of things that were done. The plugin needs pull request #11 to be merged to work properly. |
Great work @prionkor have you accomplished the "Create Wishlist" task yet?? I'm developing some custom endpoints for a project and I'm kinda stuck in there. Somehow I can create a "wishlist object" but the "->save()" wont work even though it returns an id. I'm attaching photos of the endpoint, what I get as a response from my endpoint and what I see on the wishlists list. I don't seem to find the one that got created. |
Sorry, for the delay. I think I did, I will check this in the weekend and get back to you. |
Would really appreciate it. Thank you :D |
@melomontoya Could you move over to https://github.com/prionkor/yith-woocommerce-wishlist-rest-api and create a ticket there? BTW, There is always a default wishlist created for a user. Unless you need multiple wishlist you do not need a create wishlist endpoint. You can just add to the wishlist and it should stick. |
So why would "YITH_WCWL_Wishlist_Factory::get_default_wishlist( $user_id );" return false? |
hi? |
Was this ever added somehow into the plugin? |
How does still have no updates? can someone provide reference here? |
Continue of the discussion from WP Support Forum
I am going to for this project and start the development. If you have any preferred guidelines on how you structure your code let me know. I am using a pattern like this.
Namespace
/yith/wishlist/v1
Proposed Endpoint for (CRUD)
GET
{url}/wishlists
Users with credentials will be returned with an array of wishlists object.
POST
{url}/wishlists
Add product/s to wishlist endpoint. Users with credentials will be returned with a wishlists object created from the POST data. if no wishlist id was provided a new wishlist is created otherwise the object with the given id returned.
Params:
wishlistId
: id of the wishlistproductIds
: an array of product ids. for a single product add send one element array.userId
(optional): In the case of client credentials or API key, admin user auth send userId. For a user auth userId isn't required because userId will be gathered from authentication. Defaults to the current user. (needs discussion)DELETE
{url}/wishlists/{id}
Clears the wishlist data.
DELETE
{url}/wishlists/{id}/product/{product_id}
Removes the given product id from wishlist id
The text was updated successfully, but these errors were encountered: