Wie erhalte ich die Kontakt-ID des Nutzers über die Google-API mit PHP?

Ich versuche, Nutzerkontakte mit allen Nutzerdaten abzurufen, unter anderem mit der Google API 3.0. Ich kann die JSON-Antwort mit den Details des Benutzers abrufen.

$url = 'https://www.google.com/m8/feeds/contacts/default/full?max-results='.$max_results.'&alt=json&v=3.0&oauth_token='.$accesstoken;

Das Ergebnis is

   [entry] => Array
            (
                [0] => Array
                    (
                        [id] => Array
                            (
                                [$t] => http://www.google.com/m8/feeds/contacts/sfdhitdf1%40gmail.com/base/1
                            )

                        [gd$etag] => "RXc7fTVSLit7I2A9XRZaEkoLRAw."
                        [updated] => Array
                            (
                                [$t] => 2014-08-29T00:16:24.905Z
                            )

                        [app$edited] => Array
                            (
                                [xmlns$app] => http://www.w3.org/2007/app
                                [$t] => 2014-08-29T00:16:24.905Z
                            )

                        [category] => Array
                            (
                                [0] => Array
                                    (
                                        [scheme] => http://schemas.google.com/g/2005#kind
                                        [term] => http://schemas.google.com/contact/2008#contact
                                    )

                            )

                        [title] => Array
                            (
                                [$t] => abc
                            )

                        [link] => Array
                            (
                                [0] => Array
                                    (
                                        [rel] => http://schemas.google.com/contacts/2008/rel#photo
                                        [type] => image
                                        [href] => https://www.google.com/m8/feeds/photos/media/sachdfwdfd%40gmail.com/1?v=3.0
                                        [gd$etag] => "VWVIH3oyWit7I2B0UBRURzwNBWM8ODs8cSk."
                                    )

                                [1] => Array
                                    (
                                        [rel] => self
                                        [type] => application/atom+xml
                                        [href] => https://www.google.com/m8/feeds/contacts/sachitdff%40gmail.com/full/1?v=3.0
                                    )

                                [2] => Array
                                    (
                                        [rel] => edit
                                        [type] => application/atom+xml
                                        [href] => https://www.google.com/m8/feeds/contacts/sachidtfd%40gmail.com/full/1?v=3.0
                                    )

                            )

                        [gd$name] => Array
                            (
                                [gd$fullName] => Array
                                    (
                                        [$t] => abc xyz 
                                    )

                                [gd$givenName] => Array
                                    (
                                        [$t] => abc
                                    )

                                [gd$familyName] => Array
                                    (
                                        [$t] => xyz
                                    )

                            )

                        [gd$email] => Array
                            (
                                [0] => Array
                                    (
                                        [address] => [email protected]
                                        [primary] => true
                                        [rel] => http://schemas.google.com/g/2005#other
                                    )

                            )

                        [gContact$website] => Array
                            (
                                [0] => Array
                                    (
                                        [href] => http://www.google.com/profiles/104048264070958665151
                                        [rel] => profile
                                    )

                            )

                        [gContact$groupMembershipInfo] => Array
                            (
                                [0] => Array
                                    (
                                        [deleted] => false
                                        [href] => http://www.google.com/m8/feeds/groups/sachitaware

                            )

                    )

Aber hier bekomme ich nicht diecontact image des Benutzers. DasDokumentatio sagt, ich brauche eincontact id für das Abrufen des Fotos, aber in der obigen Antwort wird keine Kontakt-ID angezeigt. Wie kann ich die Kontakt-ID des Benutzers und anschließend sein Kontaktfoto abrufen?

Ich habe die App mit oauth 2.0 autorisiert und neben dem Bild bekomme ich die meisten Details des Kontakts.

BEARBEITEN Ich habe es versuchtDie Weg aus der Dokumentation und es funktioniert, aber es gibt das Binärbild anstelle desBild UR und ich muss eine weitere Anfrage senden, um das Bild zu erhalten.

 $url1   ='https://www.google.com/m8/feeds/photos/media/{useremail}/13444?       v=3.0&oauth_token='.$accesstoken;
 $xmlresponse1 =  curl($url1);

Um das Bild anzuzeigen:

 <img src="data:image/*;base64,<?php echo base64_encode($xmlresponse1); ?> />

Kann ich die URL des Kontaktbilds nicht erhalten, wenn etwas wie Facebook zurückkehrt?

Antworten auf die Frage(1)

Ihre Antwort auf die Frage