I want to avoid sending the default data of a Microsoft Teams event or, even better, be able to change them and work with them.

Julián José López Arellano 20 Reputation points
2025-02-12T14:06:15.8733333+00:00

When I create an event with the Graph API, this data arrives at the end of the request body. How can I prevent it from being sent or, preferably, modify it and work with it? And if I want it to be in Spanish, what options do I have to change this information?User's image

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,877 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,049 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,558 questions
0 comments No comments
{count} votes

Accepted answer
  1. Gao Chen 6,855 Reputation points Microsoft Vendor
    2025-02-12T14:12:39.15+00:00

    Hello Julián José López Arellano

    Welcome to Microsoft Q&A!

    I understand that you want to manage the data in the request body when creating an event with the Microsoft Graph API, you can follow these steps:

    Preventing or Modifying Data in the Request Body

    Modify the Request Body: When creating an event, you can customize the JSON representation of the event object in the request body. Only include the properties you want to set or update. Here's an example of how to create an event with specific properties:

    POST https://graph.microsoft.com/v1.0/me/events
    Content-type: application/json
    
    {
        "subject": "Meeting",
        "body": {
            "contentType": "HTML",
            "content": "Let's discuss the project."
        },
        "start": {
            "dateTime": "2025-02-15T09:00:00",
            "timeZone": "Pacific Standard Time"
        },
        "end": {
            "dateTime": "2025-02-15T10:00:00",
            "timeZone": "Pacific Standard Time"
        },
        "location": {
            "displayName": "Conference Room"
        },
        "attendees": [
            {
                "emailAddress": {
                    "address": "john.doe@example.com",
                    "name": "John Doe"
                },
                "type": "required"
            }
        ]
    }
    

    Update an Existing Event: If you need to modify an existing event, use the PATCH method to update only the properties you want to change. Here's an example:

    PATCH https://graph.microsoft.com/v1.0/me/events/{event-id}
    Content-type: application/json
    
    {
        "subject": "Updated Meeting",
        "body": {
            "content": "Updated content for the meeting."
        }
    }
    

    Changing Language to Spanish

    To change the language of the event information to Spanish, you can update the user's regional and language settings. This can be done using the regionalAndLanguageSettings resource. Here's how you can update these settings:

    Update Regional and Language Settings:

    PATCH https://graph.microsoft.com/beta/me/settings/regionalAndLanguageSettings
    Content-type: application/json
    
    {
        "defaultDisplayLanguage": {
            "locale": "es-ES"
        },
        "authoringLanguages": [
            {
                "locale": "es-ES"
            }
        ],
        "defaultTranslationLanguage": {
            "locale": "es-ES"
        },
        "defaultSpeechInputLanguage": {
            "locale": "es-ES"
        },
        "defaultRegionalFormat": {
            "locale": "es-ES"
        }
    }
    

    This will set the default display language, authoring language, translation language, speech input language, and regional format to Spanish (Spain).

    Let me know if the information provided was useful!

    Regards,

    Gao


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


0 additional answers

Sort by: Most helpful

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.