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".