hi there,
I'm creating new phone call activity record using the Dynamics CRM web API(OData) using System.Net.Http.HttpClient. This code is working fine given below:
#region Create a entity // Create PhoneCall Activity using the early-bound class. PhoneCall call = new PhoneCall(); call.subject = "Contoso"; call.description = "555-5555"; // It is a best practice to refresh the access token before every message request is sent. Doing so // avoids having to check the expiration date/time of the token. This operation is quick. httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", auth.AcquireToken().AccessToken); // Send the request, and then check the response for success. // POST api/data/accounts HttpResponseMessage response = await HttpClientExtensions.SendAsJsonAsync<PhoneCall>(httpClient, HttpMethod.Post, "api/data/phonecalls", call); if (response.IsSuccessStatusCode) Console.WriteLine("PhoneCall Activity '{0}' created.", call.subject); else throw new Exception(String.Format("Failed to create PhoneCall Activity '{0}', reason is '{1}'.", call.subject, response.ReasonPhrase), new CrmHttpResponseException(response.Content)); #endregion Create a entity
Now my question is that, how i can create activityparty reference using the web api preview?
call.to = ? call.from = ?
your response will be appreciated.
thanks.