Trigger the creation of the SharePoint resource folder where all file-based resources (Word, Excel, and so on) should be uploaded for a given submission. Only teachers and students can perform this operation.
Note that files must be located in this folder in order to be added as resources. Only a student in the class can determine what files to upload in a given submission-level resource folder.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
EduAssignments.ReadBasic, EduAssignments.Read
Delegated (personal Microsoft account)
Not supported.
Application
Not supported.
HTTP request
POST /education/classes/{id}/assignments/{id}/submissions/{id}/setUpResourcesFolder
Request headers
Header
Value
Authorization
Bearer {token}. Required.
Request body
Provide an empty json {} as request body for this method.
Response
If successful, this method returns a 200 OK response code. The body will contain the submission model.
If the assignment is already in submitted state or if the assignment is no longer open for submission, this method returns a 400 Bad Request response code.
Examples
Example 1: Set up a resource folder for a submission
Request
The following is an example of a request that triggers the creation of a SharePoint resource folder for a submission.
Example 1: Set up a resource folder for a submission
Request
The following is an example of a request that triggers the creation of a SharePoint resource folder for a submission.
POST https://graph.microsoft.com/v1.0/education/classes/b07edbef-7420-4b3d-8f7c-d599cf21e069/assignments/222bd-b7d2-4d64-8a22-74b722ce2fc6/submissions/803fb5dd-3553-455f-3d94-f79fb54a1003/setUpResourcesFolder
Content-type: application/json
{
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Education.Classes.Item.Assignments.Item.Submissions.Item.SetUpResourcesFolder.SetUpResourcesFolderPostRequestBody
{
};
var result = await graphClient.Education.Classes["{educationClass-id}"].Assignments["{educationAssignment-id}"].Submissions["{educationSubmission-id}"].SetUpResourcesFolder.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new SetUpResourcesFolderPostRequestBody();
$result = $graphServiceClient->education()->classes()->byClasseId('educationClass-id')->assignments()->byAssignmentId('educationAssignment-id')->submissions()->bySubmissionId('educationSubmission-id')->setUpResourcesFolder()->post($requestBody);
Example 2: Set up a resource folder when the assignment is no longer open for submission
Request
The following is an example of a request that tries to set up a resource folder but fails with a 400 Bad Request response code because the assignment is no longer open for submission.
POST https://graph.microsoft.com/v1.0/education/classes/b07edbef-7420-4b3d-8f7c-d599cf21e069/assignments/1e5222bd-b7d2-4d64-8a22-74b722ce2fc6/submissions/803fb5dd-3553-455f-3d94-f79fb54a1003/setUpResourcesFolder
Content-type: application/json
{
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Education.Classes.Item.Assignments.Item.Submissions.Item.SetUpResourcesFolder.SetUpResourcesFolderPostRequestBody
{
};
var result = await graphClient.Education.Classes["{educationClass-id}"].Assignments["{educationAssignment-id}"].Submissions["{educationSubmission-id}"].SetUpResourcesFolder.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new SetUpResourcesFolderPostRequestBody();
$result = $graphServiceClient->education()->classes()->byClasseId('educationClass-id')->assignments()->byAssignmentId('educationAssignment-id')->submissions()->bySubmissionId('educationSubmission-id')->setUpResourcesFolder()->post($requestBody);
HTTP/1.1 400 Bad Request
Content-type: application/json
{
"error": {
"code": "badRequest",
"message": "Bad request.",
"innerError": {
"code": "assignmentHasBeenSubmitted",
"message": "Resource folder cannot be set up for assignments that are no longer open for submissions."
}
}
}
Example 3: Set up a resource folder when the assignment is already in submitted state
Request
The following is an example of a request that tries to set up a resource folder but fails with a 400 Bad Request response code because the assignment has already been submitted.
POST https://graph.microsoft.com/v1.0/education/classes/b07edbef-7420-4b3d-8f7c-d599cf21e069/assignments/1e5222bd-b7d2-4d64-8a22-74b722ce2fc6/submissions/803fb5dd-3553-455f-3d94-f79fb54a1003/setUpResourcesFolder
Content-type: application/json
{
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Education.Classes.Item.Assignments.Item.Submissions.Item.SetUpResourcesFolder.SetUpResourcesFolderPostRequestBody
{
};
var result = await graphClient.Education.Classes["{educationClass-id}"].Assignments["{educationAssignment-id}"].Submissions["{educationSubmission-id}"].SetUpResourcesFolder.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new SetUpResourcesFolderPostRequestBody();
$result = $graphServiceClient->education()->classes()->byClasseId('educationClass-id')->assignments()->byAssignmentId('educationAssignment-id')->submissions()->bySubmissionId('educationSubmission-id')->setUpResourcesFolder()->post($requestBody);
HTTP/1.1 400 Bad Request
Content-type: application/json
{
"error": {
"code": "badRequest",
"message": "Bad request.",
"innerError": {
"code": "assignmentHasBeenSubmitted",
"message": "Resource folder cannot be set up while the submission is in the submitted state."
}
}
}