0

How to create REST API which will fetch data from custom table?

2
  • Which version of Magento? Commented Jan 4, 2016 at 22:23
  • could you pls explain how you get values from the table by using API Commented Jun 14, 2017 at 6:55

1 Answer 1

1
  1. Declare new service contract interface, see this
  2. In the model implementing this interface read data from custom table (via resource model)
  3. Expose created service contract interface as web API, see this

Also might be useful to look at any core APIs as an example (e.g. \Magento\Customer\Api\CustomerRepositoryInterface)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.