Basket API

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
adityabanerjee
Posts: 44
Joined: 05 Oct 2019, 06:42

Basket API

Post by adityabanerjee » 20 Dec 2019, 11:15

In the documentation to get the basket, I see -:
If the basket is empty, it will return only the basic basket properties but no products, addresses, service items or coupons. Important is that the same session cookie is sent with each request, which is normally the case. Otherwise, an empty basket is returned for every request
Now I wanted to know which session cookie will I send in each request? I have installed a Laravel passport and we are not going to use these API for web or JavaScript. Instead, we would be using it for mobile application and if I am not wrong we would not be able to send and maintain sessions in mobile applications as the session would be related to the web. So in such a case, we have installed a Laravel passport and we have Authorization token and not session cookie token. Please assist we are not able to fetch basket after adding the product to the basket. The basket api returns empty each time.

We are using "aimeos/aimeos-laravel": "~2019.10.1", "aimeoscom/ai-sites": "^2019.10", Laravel 6.*

User avatar
aimeos
Administrator
Posts: 7865
Joined: 01 Jan 1970, 00:00

Re: Basket API

Post by aimeos » 21 Dec 2019, 13:11

Regardless of the application on the client side (web, native, etc.), you need to pass the server session cookie with each request because a HTTP server is stateless as long as there's no Laravel session.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

adityabanerjee
Posts: 44
Joined: 05 Oct 2019, 06:42

Re: Basket API

Post by adityabanerjee » 22 Dec 2019, 18:27

Please tell us, which Laravel Session cookie key and value I need to pass? Do I need to create a new session, cookie somewhere and then pass that key and value in each API request? Please guide us. We are stuck and not able to progress from here :(. We need to get the basket product we added but not able to figure this out as it is returning empty basket each time. An example would be appreciated.

Thank you

User avatar
aimeos
Administrator
Posts: 7865
Joined: 01 Jan 1970, 00:00

Re: Basket API

Post by aimeos » 24 Dec 2019, 13:11

The Laravel cookie that is sent by the server is usually named "laravel_session" and you have to pass it back to the server. How this is done depends on your software stack you are using (Android/iOS/etc.)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply