Working with Assignment Graph endpoints for a Class Team

Ivan Wilson 126 Reputation points
2023-04-18T07:20:57.8466667+00:00

I'm working with a government education department. They are not using the rostering/schools/classroom functionality in Microsoft 365, however, they do want to use the Assignments functionality available in Microsoft Teams. I can create a Team site using the Classroom template via graph using the https://graph.microsoft.com/v1.0/teams endpoint and specifying the educationClass template. Through the user interface, I can add/update/delete assignments for this Team. However, I don't know how to do this via graph. I've tried using /education/classes/{groupId}/assignments and /teams/{groupId}/assignments endpoints, but neither work. Any suggestions?

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

2 answers

Sort by: Most helpful
  1. CharanyaB-MSFT 1,891 Reputation points
    2023-04-18T11:49:29.84+00:00

    Hello @Ivan Wilson,

    Thanks for reaching out!

    You can create assignment using POST /education/classes/{class-id}/assignments API. Assignments start in the Draft state, which means that students will not see the assignment until publication.

    Please use publish API for the assignment to be available in the class: POST /education/classes/{id}/assignments/{id}/publish

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


  2. Ivan Wilson 126 Reputation points
    2023-04-29T01:41:48.7866667+00:00

    OK, it looks like I can just create a class, assign a teacher and create an assignment via the /education endpoints.

    I was concerned that the tenant needed to be configured using the School Data Sync (SDS) before any of these endpoints would work. However I was able to get classes and assignments working on an Education tenant with no SDS configured.

    One point that helped me a lot was that the /users and /education/users endpoints use the same accounts in the tenant. I thought that we would have to set up separate users to represent teachers, but that is not the case.

    When creating the assignment, I needed to authenticate to the graph using the teacher account and delegated permissions.

    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.