Magento – How to create REST API in Magento 2

apimagento2oauthrest

i'm new to Magento 2, i am assigned to create a HTML search form which take input as a CustomerID and return the Customer info associated with that CustomerID, using oAuth and REST API. I have no idea where I should begin, or which documents I should take, please give me an advice !

Best Answer

Two high-level steps should be completed to create new REST API in Magento:

  1. Create new service
  2. Configure webapi.xml to expose this service as REST API

Then your service can be called as described here