获取adsense收益PHP

I have to get adsense earnings of day with PHP. But after hours and hours of trying I can not get the "GOOGLE API" to work.

I ended up by getting csv from this URL

https://www.googleapis.com/adsense/v1.4/accounts/pub-*************/reports

But this results in error

adsense.readonly{ "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } }

I guess that I need to login before using that URL, but I can't figure out how to do this in PHP.

Can somebody align me on right way how to do this?