2015-10-30 10 views
5

Öğrencilerin Derse Yanıtları ile ilgili bir sorum var.Google Classroom API - Öğrencinin "emailAddress" ve "photoUrl" yanıtları gelmiyor

benim kodu aracılığıyla API "https://classroom.googleapis.com/v1/courses/ {courseID}/öğrenci" URL'yi çağrı yaparken ben API çağrısında iki parametre (emailAddress ve photoUrl)

almıyorum.

Ben şu yanıtı alıyorum

:

{ 
    "students": [ 
    { 
     "courseId": "303431573", 
     "userId": "104377167089915657872", 
     "profile": { 
     "id": "104377167089915657872", 
     "name": { 
      "givenName": "student2", 
      "familyName": "User", 
      "fullName": "student2 User" 
     } 
     } 
    }, 
    { 
     "courseId": "303431573", 
     "userId": "104304056850029354748", 
     "profile": { 
     "id": "104304056850029354748", 
     "name": { 
      "givenName": "student1", 
      "familyName": "User", 
      "fullName": "student1 User" 
     } 
     } 
    } 
    ] 
} 

Ama aynı courseID geçerek Google Classroom geliştirici konsolunda çalıştırmak, ben cevabı alıyorum şöyle:

{ 
"students": [ 
    { 
    "courseId": "303431573", 
    "userId": "104377167089915657872", 
    "profile": { 
    "id": "104377167089915657872", 
    "name": { 
    "givenName": "student2", 
    "familyName": "User", 
    "fullName": "student2 User" 
    }, 
    "emailAddress": "[email protected]", 
    "photoUrl": "https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/photo.jpg" 
    } 
    }, 
    { 
    "courseId": "303431573", 
    "userId": "104304056850029354748", 
    "profile": { 
    "id": "104304056850029354748", 
    "name": { 
    "givenName": "student1", 
    "familyName": "User", 
    "fullName": "student1 User" 
    }, 
    *"emailAddress": "[email protected]", 
    "photoUrl": "https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/photo.jpg"* 
    } 
    } 
] 
} 

cevap

1

Praveen - emailAddress ve photoURL bilgilerine erişmek için aşağıdaki ek OAuth kapsamlarını talep etmeniz gerekir:

  • https://www.googleapis.com/auth/classroom.profile.photos
  • https://www.googleapis.com/auth/classroom.profile.emails

Kontrol dışarı daha fazla ayrıntı için https://developers.google.com/classroom/guides/auth.

İlgili konular