data provider using json data from Yii REST API

I have a REST API that serve as a centralized database. The API is working fine and I was able to make it query.

For example,


curl -i -H "Accept:application/json" "localhost/api/web/redis/result"

Returned data in JSON format:


curl -i -H "Accept:application/json" "localhost/api/web/redis/result?result_no=170822059&source=test"

Returned data in JSON format:

But now I’m building an admin backend(Gridview) that query from the API above. I know that I could just call the API and return the JSON data, use json_decode() and create an ArrayDataProvider and finally use it with Gridview. But what about the sorting, pagination and filtering/querying features?

What is the best approach? Any suggestion or help would be appreciated.

I’ve done Json result with ArrayDataProviders and display on GridView. I’m using the same approached to set Data Provider. Setting sort and pagination is same as ActiveDataProvider.

For filtering, you can do it based on this example: https://stackoverflow.com/questions/28428492/using-yii2-with-array-of-data-and-a-gridview-with-sorting-and-filter