authoredNote を作成する
-
[アーティクル]
-
-
名前空間: microsoft.graph
新しい authoredNote オブジェクトを 作成します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
| アクセス許可の種類 |
アクセス許可 (特権の小さいものから大きいものへ) |
| 委任 (職場または学校のアカウント) |
SubjectRightsRequest.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
| アプリケーション |
サポートされていません。 |
HTTP 要求
POST /privacy/subjectRightsRequests/{subjectRightsRequestId}/notes
| 名前 |
説明 |
| Authorization |
ベアラー {token}。必須。 |
| Content-Type |
application/json. Required. |
要求本文
要求本文で、 authoredNote オブジェクトの JSON 表現を指定します。
次の表に、 authoredNote を作成するときに必要なプロパティを示します。
応答
成功した場合、このメソッドは 201 Created 応答コードと応答本文に authoredNote オブジェクトを返します。
例
要求
要求の例を次に示します。
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);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const authoredNote = {
content:
{
content: 'String',
contentType: 'text'
}
};
await client.api('/privacy/subjectRightsRequests/{subjectRightsRequestId}/notes')
.post(authoredNote);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
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];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
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);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
//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)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
応答の例を次に示します。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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"
}
}