提到
MSDN
这个
BookRequest
消息预期
Appointment
像
Target
.
Book
行动也是如此。
// Create the ActivityParty instance.
ActivityParty party = new ActivityParty
{
PartyId = new EntityReference(SystemUser.EntityLogicalName, userResponse.UserId)
};
// Create the appointment instance.
Appointment appointment = new Appointment
{
Subject = "Test Appointment",
Description = "Test Appointment created using the BookRequest Message.",
ScheduledStart = DateTime.Now.AddHours(1),
ScheduledEnd = DateTime.Now.AddHours(2),
Location = "Office",
RequiredAttendees = new ActivityParty[] { party },
Organizer = new ActivityParty[] { party }
};
// Use the Book request message.
BookRequest book = new BookRequest
{
Target = appointment
};
提到
MSDN
,webapi请求可能如下所示:(正在使用现有约会记录,仍收到400个错误请求)
POST [Organization URI]/api/data/v8.2/Book HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0
{
"Target": {
"activityid": "59ae8258-4878-e511-80d4-00155d2a68d1",
"@odata.type": "Microsoft.Dynamics.CRM.appointment"
}
}