URL : https://demo.abcd.cloud/icr/service?cmd=UPLOAD&format=json[^]
Body message as bellow :
Below is my Text Visualizer of uploaddata string.
{Header: {WorkstationId: DC3397CC-A2B6-C704-032E-0154EC02C7E8}
,Request:{Command: Add,
Add: {
UploadType: 1,
MsgRequest: "
{
Header: {
WorkstationId: DC3397CC-A2B6-C704-032E-0154EC02C7E8 },
Request: {
SaleCodeExt: 29CPQRSW,
WorkstationId: DC3397CC-A2B6-C704-032E-0154EC02C7E8,
AccountId: 42E6B6C1-6CF2-0788-033B-0154EC06FD9B,
ShipAccountId: 42E6B6C1-6CF2-0788-033B-0154EC06FD9B,
TransactionDateTime: 2016-05-31T11:36:43.264+0200 ,
TransactionType: 1,
Approved: true,
Paid: true,
Encoded: true,
Printed: true,
Validated: true,
SendOrderConfirmation: false,
CreateOrderConfirmation: false,
OrderDocTemplateId: null,
IncludeOrderConfirmationTickets: false,
PortfolioList: [{
WalletDeposit: 0,
PortfolioGroup: PF1 ,
MediaList: [{
MediaStatus: 0,
MediaType: 0,
MediaSerial: 1,
EncodeDateTime: 2016-05-31T11:36:43.264+0200 ,
EncodeFiscalDate: 2016-05-31 ,
ExclusiveUse: true,
MediaCodeList: [{
MediaCode: 1835EY41EP2PE8 ,
MediaCodeType: 0
}]
}]
}],
TaxInInvoice: false,
SaleItemList: [{
ChargeToWallet: false,
Quantity: 1,
UnitRawPrice: 100,
ProductId: C683CF77-8C88-B8F9-0F95-0150050EDE6B ,
UnitAmount: 100,
TotalAmount: 100,
TotalTax: 0,
GroupTicketOption: 1,
PerformanceTypeId: null,
TaxCalcType: 1,
PresaleUnitAmount: 0,
UnitTax: 0,
SaleItemDetailList: [{
Position: 1,
PortfolioGroup: PF1
}]
}],
PaymentList: [{
PaymentType: 2,
PaymentStatus: 2,
PaymentAmount: 100
}]
}
}"
}
}
}
System answer :
{"Answer":{"Add":{"UploadId":"E3EE30DF-0401-AB90-0244-015507753E3E"}},"Header":{"Ver":"8.3.11.7","RequestCode":"UPLOAD","ETime":62,"SystemTimestamp":"2016-05-31T17:36:12.141+0200","StatusCode":200,"Session":"EFEE7BA6BCE479477A7FE18294DDE203"}}
The target is to upload the data to the system which is on cloud.
Though status code is 200 (success)
Error is coming header part which is inside.
Error message in back office of system is :
Expected a ',' or '}' at 514 [character 515 line 1]
{ Header: { WorkstationId: DC3397CC-A2B6-C704-032E-0154EC02C7E8 },
I have tried with other examples and if there is only single header with request code is executing without any error in back office.
What I have tried:
below code i have tried:
System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
client.BaseAddress = new System.Uri(SnAPIUrl);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
System.Net.Http.HttpContent content1 = new StringContent(DATAUpload,UTF8Encoding.UTF8,"application/json");
HttpResponseMessage messge = client.PostAsync(SnAPIUrl, content1).Result;
if (messge.IsSuccessStatusCode)
{
string result = messge.Content.ReadAsStringAsync().Result;
Response.Write(result);
//return result;
}