Erstellen der Outlook-KategorieCreate Outlook category
Namespace: microsoft.graphNamespace: microsoft.graph
Wichtig
APIs unter der /beta
Version in Microsoft Graph können geändert werden.APIs under the /beta
version in Microsoft Graph are subject to change. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt.Use of these APIs in production applications is not supported. Verwenden Sie die Versionsauswahl, um zu ermitteln, ob eine API in Version 1.0 verfügbar ist.To determine whether an API is available in v1.0, use the Version selector.
Erstellen eines outlookCategory-Objekts in der Masterliste von Kategorien.Create an outlookCategory object in the user's master list of categories.
BerechtigungenPermissions
Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie im Artikel zum Thema Berechtigungen.One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
BerechtigungstypPermission type | Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)Permissions (from least to most privileged) |
---|---|
Delegiert (Geschäfts-, Schul- oder Unikonto)Delegated (work or school account) | MailboxSettings.ReadWriteMailboxSettings.ReadWrite |
Delegiert (persönliches Microsoft-Konto)Delegated (personal Microsoft account) | MailboxSettings.ReadWriteMailboxSettings.ReadWrite |
AnwendungApplication | MailboxSettings.ReadWriteMailboxSettings.ReadWrite |
HTTP-AnforderungHTTP request
POST /me/outlook/masterCategories
POST /users/{id|userPrincipalName}/outlook/masterCategories
AnforderungsheaderRequest headers
NameName | BeschreibungDescription |
---|---|
AuthorizationAuthorization | Bearer {token}. Erforderlich.Bearer {token}. Required. |
AnforderungstextRequest body
Geben Sie im Anforderungstext eine JSON-Darstellung des outlookCategory-Objekts an.In the request body, supply a JSON representation of outlookCategory object.
AntwortResponse
Wenn die Methode erfolgreich verläuft, werden der Antwortcode 201 Created
und ein outlookCategory-Objekt im Antworttext zurückgegeben.If successful, this method returns 201 Created
response code and outlookCategory object in the response body.
BeispielExample
AnforderungRequest
Nachfolgend sehen Sie ein Beispiel der Anforderung.Here is an example of the request.
POST https://graph.microsoft.com/beta/me/outlook/masterCategories
Content-type: application/json
Content-Length: 70
{
"displayName":"Project expenses",
"color":"preset9"
}
Geben Sie im Anforderungstext eine JSON-Darstellung des outlookCategory-Objekts an.In the request body, supply a JSON representation of outlookCategory object.
AntwortResponse
Nachfolgend sehen Sie ein Beispiel der Antwort. Hinweis: Das hier gezeigte Antwortobjekt ist möglicherweise aus Platzgründen abgeschnitten. Von einem tatsächlichen Aufruf werden alle Eigenschaften zurückgegeben.Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.
HTTP/1.1 201 Created
Content-type: application/json
Content-length: 250
{
"@odata.context":"https://graph.microsoft.com/beta/$metadata#users('8ae6f565-0d7f-4ead-853e-7db94c912a1f')/outlook/masterCategories/$entity",
"id":"bac262b7-485d-4739-b436-e31467d64fac",
"displayName":"Project expenses",
"color":"preset9"
}