Hi,
I want to send a fax with the platform Api.
This is the example code:
`ConversationsApi faxApi = new ConversationsApi();
FaxSendRequest bodyFax = new FaxSendRequest(Addresses: new List<string>() { "+49xxxxxxxxxxx" });
bodyFax.ContentType = FaxSendRequest.ContentTypeEnum.Applicationpdf;
bodyFax.Name = "test.pdf";
bodyFax.TimeZoneOffsetMinutes = 120;
var result = faxApi.PostFaxes(bodyFax);
var json = bodyFax.ToJson();
HttpClient httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("bearer", Configuration.Default.AccessToken);
MultipartFormDataContent form = new MultipartFormDataContent();
byte[] array = File.ReadAllBytes(@"C:\temp\test.pdf");
form.Add(new StringContent("test.pdf"), "name");
form.Add(new ByteArrayContent(array, 0, array.Count()), "file", "test.pdf");
HttpResponseMessage response = httpClient.PostAsync(result.UploadDestinationUri, form).Result;
response.EnsureSuccessStatusCode();
httpClient.Dispose();
string sd = response.Content.ReadAsStringAsync().Result;`
I don't get any error messages, but the fax wasn't send and I don't get a fax conversation. I think there is a problem with the file upload. If I send a fax from mypurecloud.ie I can see the pdf file in the document section. The ones which I send with my code, I cant see.
Regards,
Sven