Rest API to check user attach to session or not
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Rest API to check user attach to session or not
Hello,
How do I get to know that the user is attached with a session token or not via rest API call? Is there any way to do that?
Thanks
How do I get to know that the user is attached with a session token or not via rest API call? Is there any way to do that?
Thanks
Re: Rest API to check user attach to session or not
You can use a GET request for the "customer" endpoint. If it returns an empty customer item, the user isn't logged in.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Re: Rest API to check user attach to session or not
Thanks for the help. It works.
Now, I want to get all the orders list which is placed by the user. How do I get all the orders data?
I have tried to use order endpoint, but it returns an only id. How do I get all the values of that order?
Now, I want to get all the orders list which is placed by the user. How do I get all the orders data?
I have tried to use order endpoint, but it returns an only id. How do I get all the values of that order?
Re: Rest API to check user attach to session or not
That's still missing while relatively easy to implement:
1.) Use the order/base manager to retrieve the corresponding order/base items here: https://github.com/aimeos/ai-client-jso ... hp#L50-L55
2.) Copy the functions from the basket template to the order template and merge the $entryFcn to with the existing one so it outputs the order and order/base data together:
- https://github.com/aimeos/ai-client-jso ... p#L31-L229
- https://github.com/aimeos/ai-client-jso ... andard.php
3.) Create a pull request at Github with your code
1.) Use the order/base manager to retrieve the corresponding order/base items here: https://github.com/aimeos/ai-client-jso ... hp#L50-L55
Code: Select all
// $items -> use getBaseId() to get order base ID
$manager = \Aimeos\MShop::create( $context, 'order/base' );
$search = $manager->createSearch()->setSlice( 0, count( $items ) );
$search->setConditions( $search->compare( '==', 'order.base.id', $baseIds ) );
$view->baseItems = $manager->searchItems( $search );
- https://github.com/aimeos/ai-client-jso ... p#L31-L229
- https://github.com/aimeos/ai-client-jso ... andard.php
3.) Create a pull request at Github with your code
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star