How do I make a call to that URL that captures the User ID, using Magento customer Token in magento 2 rest API?
How Magento 2 makes calls in-between for the APIs ?
apicustomermagento2restrest api
How do I make a call to that URL that captures the User ID, using Magento customer Token in magento 2 rest API?
How Magento 2 makes calls in-between for the APIs ?
Best Answer
Magento gets the customer data with passing anything except token value in API call.
In between magento calls some API related controllers for the same
in this API call magento get customer data based on token.
Based on API url
url="/V1/customers/me"
magento calls function fromMagento calls In-between call of dispatch function.
And this
resolve()
function callsoverride()
functionand
overide()
function callsgetOverriddenValue()
functiongetOverriddenValue()
callsParamOverriderInterface
".../me/..."
route, the route should use only user information specific to the"/customers/me/addresses"
route, the service method"getAddresses($customerId)"
, but in thewebapi.xml
, the $customerId parameterand for business logic of this function is in file -
So this is how Magento get Customer Id between API calls !!
Another solution