Getting "subject" value of course by API Google Classroom - google-classroom

How can I get or update the "subject" value for a course in the API? I did not find any information on this in the documentation
https://developers.google.com/classroom/reference/rest/v1/courses/get?authuser=1

EDIT
There is a separate subject field when you are filling out a course as R1KO pointed out.
However, as can be seen by the full response of the courses object below, there is no such field in the API.
I have called further endpoints to see if it was buried somewhere else but I cannot find it. Looking on the Issue Tracker however, revealed this Feature Request:
Add Subject to Course
https://issuetracker.google.com/156289085
So it seems like the best thing you can do at this time is to go and click on the ☆ button in that feature to let Google know that you want this feature.
The 'subject' is the 'name' in the API
This is the whole courses object:
{
"id": string,
"name": string,
"section": string,
"descriptionHeading": string,
"description": string,
"room": string,
"ownerId": string,
"creationTime": string,
"updateTime": string,
"enrollmentCode": string,
"courseState": enum (CourseState),
"alternateLink": string,
"teacherGroupEmail": string,
"courseGroupEmail": string,
"teacherFolder": {
object (DriveFolder)
},
"courseMaterialSets": [
{
object (CourseMaterialSet)
}
],
"guardiansEnabled": boolean,
"calendarId": string
}
The description of the name field is as follows:
Name of the course. For example, "10th Grade Biology". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string.
https://developers.google.com/classroom/reference/rest/v1/courses
You can get this with the GET request:
https://developers.google.com/classroom/reference/rest/v1/courses/get
To get all the fields listed above, make sure to include * as the fields parameter.
Update with the UPDATE or PATCH:
https://developers.google.com/classroom/reference/rest/v1/courses/update
https://developers.google.com/classroom/reference/rest/v1/courses/patch

Related

Can I create extended properties in Google People API and Task API?

I have added an extended property to a Google calendar entry and been able to read it back successfully. The format of the json is like this:
"extendedProperties": {
"private": {
"MyPropertyName": "yes"
}
},
I want to do the same thing to created Task entries and contact entries (via the People API). With the People API, trying to create the entry results in http 400. With the Task API, it accepts the json, but the property is not returned when I retrieve the task.
Is it possible to do what I want with the current versions of the People and Task API?
In People API extended properties are called ClientData
The json structure of the resouce is:
{
"metadata": {
object (FieldMetadata)
},
"key": string,
"value": string
}
with FieldMetadata:
{
"primary": boolean,
"sourcePrimary": boolean,
"verified": boolean,
"source": {
object (Source)
}
}

Google People API notes field

I'd like to know how to get the 'notes' field from the Google people API. There's no equivalent in documentation. I tried "biographies" but that didn't return any notes when I called the API for names, emails, etc.
I've seen this question asked a few years ago but I know the API has changed a bit and was hoping someone knows the answer.
Thanks!
Answer
The biographies field still representing the notes
How to check it?
Create a contact setting the notes with a concrete string, i.e. Hey, I'am a note
Call people.connections.list
resourceName = people/me
personFields = names
Get the resourceName to use it later
Call people.get
resourceName = resource from point 3
personFields = biographies
Check the biographies field, it will look something like:
"biographies": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "randomId"
}
},
"value": "Hey, I'am a note",
"contentType": "TEXT_PLAIN"
}
References
people.connections.list
people.get

Logic Apps and Outlook embedded images

I want to copy embedded images from an outlook email to my blob storage. I have a step to run a For Each over the email attachments (the embedded images are recognized as attachments). But the when I look at the raw input for the email message, the attachment[0].contentBytes is Null. And the error I get when trying to create the blob using setting the blob content to "Attachments Content" is:
"InvalidTemplate. Unable to process template language expressions in action 'Create_blob' inputs at line '1' and column '3316': 'The template language function 'base64ToBinary' expects its parameter to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#base64ToBinary for usage details.'."
Here is the Raw Input to the "When new email arrives" step:
"Attachments": [
{
"#odata.type": "#Microsoft.OutlookServices.FileAttachment",
"Id": "12345",
"LastModifiedDateTime": "2020-11-22T07:38:19+00:00",
"Name": "footer.jpg",
"ContentType": "image/jpeg",
"Size": 13969,
"IsInline": false,
"ContentBytes": null
}
]
Any help with these steps is much appreciated. Thanks!
Please click Add new parameter and choose Include Attachments. select Yes for Include Attachments:

How to track user activity data on google docs

I wonder if it is possible to track user activity data on google docs. My goal is to know what changes the users did (e.g., adding a new paragraph) and when. At the end, I want to visualize the changes made by each user on a document per each day. I could not find a google drive api method. I found Drive Activity API, but not sure if this is what I am looking.
As a backup plan, I am thinking to include the google doc inside an iframe within my web application to store the key strokes. I appreciate any suggestions.
I believe what you are lookging for is revisions.list I am not sure how much of the information you are looking for is actually returned but it does return some information about the changes that where made.
{
"kind": "drive#revisionList",
"nextPageToken": string,
"revisions": [
revisions Resource
]
}
revision
{
"kind": "drive#revision",
"id": string,
"mimeType": string,
"modifiedTime": datetime,
"keepForever": boolean,
"published": boolean,
"publishAuto": boolean,
"publishedOutsideDomain": boolean,
"lastModifyingUser": {
"kind": "drive#user",
"displayName": string,
"photoLink": string,
"me": boolean,
"permissionId": string,
"emailAddress": string
},
"originalFilename": string,
"md5Checksum": string,
"size": long,
"exportLinks": {
(key): string
}
}

Ability to CRUD Topic attribute in Google::Apis::ClassroomV1::CourseWork class?

I was wondering if there is a way via the Ruby API doc to modify a Topic for the following class:
Google::Apis::ClassroomV1::CourseWork
Topics were introduced in August 2016 as far as I can tell as a way for teachers to organize their stream:
https://support.google.com/edu/classroom/answer/6149237?hl=en
Does anyone know of a way? I'm okay with making a REST call as well if necessary.
Thanks!
Looking at the JSON response https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.
It doesnt look like they have added the functionality to update a Topic through courses.CourseWork
JSON representation
{
"courseId": string,
"id": string,
"title": string,
"description": string,
"materials": [
{
object(Material)
}
],
"state": enum(CourseWorkState),
"alternateLink": string,
"creationTime": string,
"updateTime": string,
"dueDate": {
object(Date)
},
"dueTime": {
object(TimeOfDay)
},
"maxPoints": number,
"workType": enum(CourseWorkType),
"associatedWithDeveloper": boolean,
"submissionModificationMode": enum(SubmissionModificationMode),
// Union field details can be only one of the following:
"assignment": {
object(Assignment)
},
"multipleChoiceQuestion": {
object(MultipleChoiceQuestion)
},
// End of list of possible types for union field details.
}

Resources