question

PedroMonte-2137 avatar image
0 Votes"
PedroMonte-2137 asked SharadSharma-5461 answered

Education Graph API getResourcesFolderUrl Deprecated

Hello,

I saw that getResourcesFolderUrl endpoint will be deprecated on May 31, 2021 (https://docs.microsoft.com/en-us/graph/api/educationassignment-getresourcesfolderurl?view=graph-rest-beta&tabs=http)

at this moment is not working, giving me the error

"code": "invalidRequest",
"message": "The request is malformed or incorrect.",

I use this endpoint to create and get the URL of the Assigment resources folder so I can deploy the resources on my deployment process

On the documentation it says that I should used the resourcesFolderUrl but is null when I create a new assignment or when I get the assignment info.

At this moment I don't know how can I create this folder automatically. Someone have an idea how can use other endpoint to create and get the folder URL?

microsoft-graph-teamworkmicrosoft-graph-sdkmicrosoft-graph-explorermicrosoft-graph-education
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@PedroMonte-2137 I am experiencing the same issue. No way to create or link the resourceFolderUrl to an assignment.

1 Vote 1 ·


I found this blog post that the changes was roll out yesterday May 17

https://developer.microsoft.com/en-us/microsoft-365/blogs/breaking-changes-to-the-microsoft-graph-assignments-api-beta/

But on the end of the article they say "We are working on details of the new APIs that will allow setting up the resource folders. We will be publishing those details in an upcoming blog post. Until then, no action is needed."

I don't know where I can find also the new details

0 Votes 0 ·
TonyBear-0233 avatar image
0 Votes"
TonyBear-0233 answered PedroMonte-2137 edited

just saw this page :)

https://docs.microsoft.com/en-us/graph/api/educationassignment-setupresourcesfolder?view=graph-rest-beta

going to run some test today to see if it works

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Finally what I was expecting and waiting :)

The documentation changed on May 22 :P

Just test it and it works, the folder is created and returns the resourcesFolderUrl

Just a note: On the body send an empty JSON message {}

1 Vote 1 ·
DianaWanjuhi-1579 avatar image
0 Votes"
DianaWanjuhi-1579 answered PedroMonte-2137 commented

Hello @PedroMonte-2137 if you know the OneDrive folder into which file-based resources should be placed to be part of an assignment resource kindly pass it in in the resourcesFolderUrl property as part of the create assignment request. Alternatively, you can update an existing assignment with the folder link once it is created.

You can create this folder on your one drive if it does not exist, then use that url in the request above.

Kindly let me know if this helps and if you have further questions,

Diana.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @DianaWanjuhi-1579 thank you for the answer

I did what you said using the API to create a folder for the new assignment on Class Files/Assignments.
Then when updating the assignment with the folder driveitem URL I got an error, so I can't set the URL of the folder to the assignment. So there is no way to create a resources folder and link it to the assignment at this moment to TEAMS assume the assignment folder.


 PATCH https://graph.microsoft.com/beta/education/classes/{class-id}/assignments/{id}

 {
     "resourcesFolderUrl": "https://graph.microsoft.com/v1.0/drives/{driveid}/items/{item-id}"
 }

RESPONSE

     "code": "20243",
     "message": "Invalid request body. ResourcesFolderUrl is read-only and may not be specified in the request.",

1 Vote 1 ·
JanSchmidt-5828 avatar image
0 Votes"
JanSchmidt-5828 answered JosephRaj-0806 commented

I found a new Graph Call in the documentation here: https://docs.microsoft.com/en-us/graph/api/educationsubmission-setupresourcesfolder
It is a new call to create the resource folder for a submission.

If you find submission.resourcesFolderUrl == null you can now just call "/education/classes/{id}/assignments/{id}/submissions/{id}/setUpResourcesFolder" to create the folder.
If you request the submission again afterwards, submission.resourcesFolderUrl is set and you can use it to upload files.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you JanSchmidt for your answer, didn't saw on submissions that because we don't use the submissions API.

But I looked at the assignment documentation and don't have any related endpoint for "setupresourcesfolder".
Anyways I tested on Graph explorer on a recently created assignment the endpoint without the submission parameters, like "/education/classes/{id}/assignments/{id}/setUpResourcesFolder" and this is not available to Assignments

     "code": "BadRequest",
     "message": "Resource not found for the segment 'setupresourcesfolder'."

I will try other options to see if i can create the assignment folder without using the submissions endpoints

0 Votes 0 ·

Sorry I did not realize your problem is about the assignment resources and not the submission resources.

1 Vote 1 ·

The problem exists for submissions resources as well. There is no way I can find an existing resource (attachment) of a submission and update it back

0 Votes 0 ·
SharadSharma-5461 avatar image
0 Votes"
SharadSharma-5461 answered

Please refer to the official documentation - education-upload-resource-overview


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.