Google Photos Api返回null

时间:2018-08-19 23:28:00

标签: c# api photos picasa google-photos

当我尝试使用PhotosLibraryService API列出相册时,我总是返回null,有人可以使用新的Google Photos API吗? picasa API不再起作用。

public void ListAlbums()
    {
        var json = File.ReadAllText(_diretorio + "/PhotoClient/" + "client.json");
        var cr = JsonConvert.DeserializeObject<PersonalServiceAccountCred>(json);

        var xCred = new ServiceAccountCredential(new ServiceAccountCredential.Initializer(cr.client_email)
        {
            Scopes = this._scopes
        }.FromPrivateKey(cr.private_key));

        // Create the service.
        var service = new PhotosLibraryService(new Google.Apis.Services.BaseClientService.Initializer()
        {
            HttpClientInitializer = xCred
        });

        var albums = service.Albums.List().Execute();
    }

enter image description here

谢谢!

0 个答案:

没有答案