ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 46 - AD0-E716 discussion

Report
Export

An Adobe Commerce developer added a new API method to search and retrieve a list of Posts for a custom Blog functionality. This is the content of the module's etc/webapi.xml file:

The new code has been deployed to production and the merchant is using https: //merchant. domain. com/swagger to review the new endpoint, but it is not visible in swagger.

What would be a reason for this?

A.
The webapi.xml file should be moved into the etc/webapi_rest/webapi.xml file.
Answers
A.
The webapi.xml file should be moved into the etc/webapi_rest/webapi.xml file.
B.
Since the new endpoint is not anonymous, the merchant needs to enter a valid integration token in swagger in order to see the new method.
Answers
B.
Since the new endpoint is not anonymous, the merchant needs to enter a valid integration token in swagger in order to see the new method.
C.
The greturn annotation is missing in the MyVendor\Blog\Api\PostRepositoryInterf ace class.
Answers
C.
The greturn annotation is missing in the MyVendor\Blog\Api\PostRepositoryInterf ace class.
Suggested answer: B

Explanation:

The reason why the new endpoint is not visible in swagger is that since the new endpoint is not anonymous, the merchant needs to enter a valid integration token in swagger in order to see the new method. The webapi.xml file specifies that the resource for the new endpoint is MyVendor_Blog::post, which means that only authorized users with this permission can access it. To generate an integration token, the merchant needs to create an integration in the admin panel and activate it. Then they can copy the token and paste it in swagger's authorization field. Verified

Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]

asked 02/10/2024
Luke Smith
30 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first