How to include the related entities to a response on a Web API «get list» request?

An example

/api/extenddforders?filter[product]=1&include=product,website

orocrm.com/documentation/2.0/book/data-api#inclusion-filter-include

Response

{
    "data": [
        {
            "type": "extenddforders",
            "id": "7",
            "attributes": {
                "date": "2016-05-10",
                "price": 89,
                "support_till": null,
                "explanation": null
            },
            "relationships": {
                "currency": {
                    "data": {
                        "type": "extenddfcurrencies",
                        "id": "1"
                    }
                },
                "product": {
                    "data": {
                        "type": "extenddfproducts",
                        "id": "1"
                    }
                },
                "website": {
                    "data": {
                        "type": "extenddfwebsites",
                        "id": "7"
                    }
                }
            }
        },
		<...>
    ],
    "included": [
        {
            "type": "extenddfproducts",
            "id": "1",
            "attributes": {
                "name_": "Stripe"
            },
            "relationships": {
                "dfProductType": {
                    "data": null
                },
                "dforder_product": {
                    "data": [
                        {
                            "type": "extenddforders",
                            "id": "7"
                        },
						<...>
                    ]
                }
            }
        },
        {
            "type": "extenddfwebsites",
            "id": "7",
            "attributes": {
                "domain": "example.com",
                "aliases": null,
                "m2_version": null,
                "m2_is_enterprise": null,
                "m2_version_url": null
            },
            "relationships": {
                "dfcustomer_websites": {
                    "data": {
                        "type": "extenddfcustomers",
                        "id": "7"
                    }
                },
                "dforder_website": {
                    "data": [
                        {
                            "type": "extenddforders",
                            "id": "7"
                        }
                    ]
                },
                "agencies": {
                    "data": []
                },
                "default_agencies": {
                    "data": null
                },
                "platform": {
                    "data": {
                        "type": "dfwebsiteplatform9e777ae8s",
                        "id": "other"
                    }
                }
            }
        },
		<...>
    ]
}

See also: