It can be very frustrating when these things don’t actually generate anything. I have never worked with PHP on this (I use Node-RED and it all works fine) however…
As a starting point it is worth building a complete URL with API key, mpan, meter number, and ? parameters in a text editor and pasting this into a browser - if correct it will return the results.
I can’t comment on how PHP manages the authentication, but this format works for me.
If the authentication is OK, and the URL has the correct mpan and meter, then a lack of results will be down to having a date issue.
The dates do not have to be specified - so start with zero parameters and see what comes back (the most recent 24 hours worth). After that add in the date parameters you want, but take note:
the consumption file has the most recent readings at the ‘front’, and by default you should get back the last 24 hours (48 readings) on file
readings are added during the day after, so electricity usually appears by 10:00 in the morning. Gas can take to mid afternoon to arrive, so asking for ‘todays’ meter readings will always end in nothing - you can only get ‘yesterday’ and older.
Dates must be correct ISO format. Again I have no idea what PHP is doing here, but if you are generated 2-digit years then it will not work. 2024-03-04T23:00:00Z is required.