How can I extract the "link" attribute from a EducationSubmissionResource in java?

Mark Rensen 1 Reputation point
2023-01-05T19:43:30.433+00:00

My students submit github pr's. I want to extract those in java. I can see the "link" attribute when i look at the submission in GraphExplorer with the request
https://graph.microsoft.com/v1.0/education/classes/{id}/assignments/{id}/submissions/{id}/submittedresources.

Here's an image of what i see in Graph Explorer: 276560-image.png

However, when I use the java Graph API, I can't seem to get the "link" attribute:
276681-image.png
As you can see, "link" is red, because it doesn't exist. In stead I can use "displayName". 276580-image.png
The display name is the same as the "link" by default, but students do have the option to give a custom "displayName" when they hand in their assignment (github link) in teams: 276691-image.png

So, getting the "displayName" will work in some cases, but it's risky.

Is there any way to get the actual "link" attribute in my java application?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mark Rensen 1 Reputation point
    2023-01-14T15:39:47.1466667+00:00

    I solved it myself.
    You can cast the EducationResource to an EducationLinkResource
    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.