2015-10-30 6 views
5

मेरे पास छात्रों के पाठ्यक्रमों के प्रतिक्रिया के बारे में एक प्रश्न है।Google कक्षा एपीआई - छात्र की "ईमेल एड्रेस" और "फोटो यूआरएल" प्रतिक्रिया में नहीं आ रही हैं

मैं (EmailAddress और photoUrl) API कॉल में दो पैरामीटर

एपीआई "https://classroom.googleapis.com/v1/courses/ {courseId}/छात्रों" करने के लिए यूआरएल बुला जबकि मेरे कोड के माध्यम से नहीं मिल रहा है।

मैं निम्नलिखित प्रतिक्रिया हो रही है:

{ 
    "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" 
     } 
     } 
    } 
    ] 
} 

लेकिन, जब मैं एक ही courseId पास करके Google कक्षा के डेवलपर कंसोल में निष्पादित, मैं प्रतिक्रिया हो रही है इस प्रकार है:

{ 
"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"* 
    } 
    } 
] 
} 

उत्तर

1

प्रवीण - ईमेल एड्रेस और photoURL तक पहुंचने के लिए आपको निम्नलिखित अतिरिक्त ओएथ स्कॉप्स का अनुरोध करने की आवश्यकता होगी:

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

चेक बाहर अधिक जानकारी के लिए https://developers.google.com/classroom/guides/auth

संबंधित मुद्दे