Compiler error(s) encountered processing expression: within HTTP request activity

We are facing an issue with the “body” attribute within “HTTP request” activity in UiPath Studio. We are providing the JSON format within the body as a string and have changed the “BodyFormat” to “application/json”

Do you guys have any insights into what can be done to to fix this issue?

The following format we are providing the JSON in:

“{
““ShipmentRequest””: {
““Request””: {
““SubVersion””: ““1801"”,
““RequestOption””: ““nonvalidate””,
““TransactionReference””: {
““CustomerContext””: “”””
}
},
““Shipment””: {
““Description””: ““Ship WS test””,
““Shipper””: {
““Name””: ““XYZ””,
““AttentionName””: ““ShipperZs Attn Name””,
““TaxIdentificationNumber””: "“123456"”,
““Phone””: {
““Number””: "“1115554758"”,
““Extension””: “” “”
},
““ShipperNumber””: ““XXXXX””,
““FaxNumber””: "“8002222222"”,
““Address””: {
““AddressLine””: ““123 W Street””,
““City””: ““City””,
““StateProvinceCode””: ““ST””,
““PostalCode””: "“00000"”,
““CountryCode””: ““US””
}
},
““ShipTo””: {
““Name””: ““John Doe””,
““AttentionName””: "“1160b_74"”,
““Phone””: {
““Number””: "“9225377171"”
},
““Address””: {
““AddressLine””: ““123 N Street””,
““City””: ““City””,
““StateProvinceCode””: ““ST””,
““PostalCode””: "“00000"”,
““CountryCode””: ““US””
},
““Residential””: “” “”
},
““ShipFrom””: {
““Name””: ““BCU””,
““AttentionName””: "“1160b_74"”,
““Phone””: {
““Number””: "“1234567890"”
},
““FaxNumber””: "“1234567890"”,
““Address””: {
““AddressLine””: ““123 W Street””,
““City””: ““City””,
““StateProvinceCode””: ““ST””,
““PostalCode””: "“00000"”,
““CountryCode””: ““US””
}
},
““PaymentInformation””: {
““ShipmentCharge””: {
““Type””: "“01"”,
““BillShipper””: {
““AccountNumber””: ““XXXXXX””
}
}
},
““Service””: {
““Code””: "“03"”,
““Description””: ““Express””
},
““Package””: {
““Description””: ““Test Package””,
““Packaging””: {
““Code””: "“02"”,
““Description””: ““Nails””
},
““Dimensions””: {
““UnitOfMeasurement””: {
““Code””: ““IN””,
““Description””: ““Inches””
},
““Length””: "“10"”,
““Width””: "“30"”,
““Height””: "“45"”
},
““PackageWeight””: {
““UnitOfMeasurement””: {
““Code””: ““LBS””,
““Description””: ““Pounds””
},
““Weight””: "“5"”
}
}
},
““LabelSpecification””: {
““LabelImageFormat””: {
““Code””: ““GIF””,
““Description””: ““GIF””
},
““HTTPUserAgent””: ““Mozilla/4.5"”
}
}
}”

Hey @asitmsingh
I noticed that JSON contains “smart quotes (“ ”) instead of standard quotes ("). These curly quotes are not valid in JSON, which is why the API fails to process it.
I fixed it, so try using this version of the JSON as a string in UiPath:

“{”“ShipmentRequest”“:{”“Request”“:{”“SubVersion”“:”“1801"”,““RequestOption””:““nonvalidate””,““TransactionReference””:{““CustomerContext””:“”“”}},““Shipment””:{““Description””:““Ship WS test””,““Shipper””:{““Name””:““XYZ””,““AttentionName””:““ShipperZs Attn Name””,““TaxIdentificationNumber””:““123456"”,”“Phone”“:{”“Number”“:”“1115554758"”,““Extension””:“”“”},““ShipperNumber””:““XXXXX””,““FaxNumber””:““8002222222"”,”“Address”“:{”“AddressLine”“:”“123 W Street”“,”“City”“:”“City”“,”“StateProvinceCode”“:”“ST”“,”“PostalCode”“:”“00000"”,““CountryCode””:““US””}},““ShipTo””:{““Name””:““John Doe””,““AttentionName””:““1160b_74"”,”“Phone”“:{”“Number”“:”“9225377171"”},““Address””:{““AddressLine””:““123 N Street””,““City””:““City””,““StateProvinceCode””:““ST””,““PostalCode””:““00000"”,”“CountryCode”“:”“US”“},”“Residential”“:”“”“},”“ShipFrom”“:{”“Name”“:”“BCU”“,”“AttentionName”“:”“1160b_74"”,““Phone””:{““Number””:““1234567890"”},”“FaxNumber”“:”“1234567890"”,““Address””:{““AddressLine””:““123 W Street””,““City””:““City””,““StateProvinceCode””:““ST””,““PostalCode””:““00000"”,”“CountryCode”“:”“US”“}},”“PaymentInformation”“:{”“ShipmentCharge”“:{”“Type”“:”“01"”,““BillShipper””:{““AccountNumber””:““XXXXXX””}}},““Service””:{““Code””:““03"”,”“Description”“:”“Express”“},”“Package”“:{”“Description”“:”“Test Package”“,”“Packaging”“:{”“Code”“:”“02"”,““Description””:““Nails””},““Dimensions””:{““UnitOfMeasurement””:{““Code””:““IN””,““Description””:““Inches””},““Length””:““10"”,”“Width”“:”“30"”,““Height””:““45"”},”“PackageWeight”“:{”“UnitOfMeasurement”“:{”“Code”“:”“LBS”“,”“Description”“:”“Pounds”“},”“Weight”“:”“5"”}}},““LabelSpecification””:{““LabelImageFormat””:{““Code””:““GIF””,““Description””:““GIF””},““HTTPUserAgent””:““Mozilla/4.5"”}}”