A module MyModule needs to send notifications to customers only when the account was modified from a mobile app using the REST web APIs.
You decided to implement an observer for customer_save_after_data_object event.
In which file do you declare the observer?
A. etc/webapi_rest/events.xml
B. etc/adminhtml/events.xml
C. etc/webapi/rest_events.xml
D. etc/events.xml
Answer: A
Answer: A
check below path – – vendor/magento/module-catalog-rule/etc/webapi_rest/events.xml
Correct Answer : A
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#event-areas
Changed my Answer to A
https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/components/modules/mod_and_areas.html
A
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Quote/etc/webapi_rest/events.xml
Correct answer is D no area such webapi_rest only /etc/fronted, /etc/adminhtml if it is global place the file in /etc
ANS: D
Read Magento dev doc carefully
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#event-areas
Last line of `Event areas`
The events.xml file can also be defined under the /etc/frontend and /etc/adminhtml directories to configure observers to only watch for events in those specific areas.
Correct answer for this is Option A: etc/webapi_rest/events.xml – as the question specifically states “only when the account was modified from a mobile app using the REST web APIs”
i think the correct ans is D, https://devdocs.magento.com/guides/v2.3/extension-dev-guide/service-contracts/service-to-web-service.html
Correct answer for this is Option A: etc/webapi_rest/events.xml
Correct answer is A, D will observe the event in all the areas