0

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

2
  • Which version of Magento?
    – benmarks
    Commented Jan 4, 2016 at 22:23
  • could you pls explain how you get values from the table by using API
    – user51361
    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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.