authoredNote erstellen
Artikel
07/18/2022
2 Minuten Lesedauer
3 Mitwirkende
In diesem Artikel
Namespace: microsoft.graph
Erstellen Sie ein neues authoredNote-Objekt .
Berechtigungen
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 .
Berechtigungstyp
Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)
Delegiert (Geschäfts-, Schul- oder Unikonto)
SubjectRightsRequest.ReadWrite.All
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Anwendung
Nicht unterstützt
HTTP-Anforderung
POST /privacy/subjectRightsRequests/{subjectRightsRequestId}/notes
Name
Beschreibung
Authorization
Bearer {token}. Erforderlich.
Content-Type
application/json. Erforderlich.
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des authoredNote-Objekts an .
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die zum Erstellen von authoredNote erforderlich sind.
Antwort
Bei erfolgreicher Ausführung gibt die Methode den 201 Created Antwortcode und ein authoredNote-Objekt im Antworttext zurück.
Beispiele
Anforderung
Nachfolgend ist ein Beispiel für eine Anforderung dargestellt.
POST https://graph.microsoft.com/v1.0/privacy/subjectRightsRequests/{subjectRightsRequestId}/notes
Content-Type: application/json
{
"content":
{
"content": "String",
"contentType": "text"
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var authoredNote = new AuthoredNote
{
Content = new ItemBody
{
Content = "String",
ContentType = BodyType.Text
}
};
await graphClient.Privacy.SubjectRightsRequests["{subjectRightsRequest-id}"].Notes
.Request()
.AddAsync(authoredNote);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
const options = {
authProvider,
};
const client = Client.init(options);
const authoredNote = {
content:
{
content: 'String',
contentType: 'text'
}
};
await client.api('/privacy/subjectRightsRequests/{subjectRightsRequestId}/notes')
.post(authoredNote);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/privacy/subjectRightsRequests/{subjectRightsRequestId}/notes"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphAuthoredNote *authoredNote = [[MSGraphAuthoredNote alloc] init];
MSGraphItemBody *content = [[MSGraphItemBody alloc] init];
[content setContent:@"String"];
[content setContentType: [MSGraphBodyType text]];
[authoredNote setContent:content];
NSError *error;
NSData *authoredNoteData = [authoredNote getSerializedDataWithError:&error];
[urlRequest setHTTPBody:authoredNoteData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
AuthoredNote authoredNote = new AuthoredNote();
ItemBody content = new ItemBody();
content.content = "String";
content.contentType = BodyType.TEXT;
authoredNote.content = content1;
graphClient.privacy().subjectRightsRequests("{subjectRightsRequestId}").notes()
.buildRequest()
.post(authoredNote);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewAuthoredNote()
content := msgraphsdk.NewItemBody()
requestBody.SetContent(content)
content := "String"
content.SetContent(&content)
contentType := "text"
content.SetContentType(&contentType)
subjectRightsRequestId := "subjectRightsRequest-id"
result, err := graphClient.Privacy().SubjectRightsRequestsById(&subjectRightsRequestId).Notes().Post(requestBody)
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
Antwort
Nachfolgend sehen Sie ein Beispiel der Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "String (identifier)",
"createdDateTime": "String (timestamp)",
"author": { "@odata.type": "microsoft.graph.identitySet"},
"content": {
"@odata.type": "microsoft.graph.itemBody"
}
}