Body of an HTTP Post Request - Escape quotes

Hi everyone!

I want to assign the following to a Body String Variable

“projectkey”: “testProject”,
“requestid”: “daily”,
“timezone”: “Europe/London”,
“datatype”: “daily”,
“dataunits”:
{
“availability.inverter”: “”,
“irradiation”: “KWh/m2”,
“specific_production.inverter”: “KWh/KWp”,
“production.inverter”: “KWh”,
“pr.inverter”: “”,
},
“data”:
{
“2019-05-01T00:00:00”:
{
“availability.inverter”: 1,
“irradiation”: 5.3934,
“specific_production.inverter”: 4.62,
“production.inverter”: 84961.323,
“pr.inverter”: 0.8571,
}
}
}

I tried to escape the quotes as follow:

"
““projectkey””: ““supernova””,
““requestid””: ““SNA_20190628_daily””,
““timezone””: ““Europe/London””,
““datatype””: ““daily””,
““dataunits””:
{
““availability.inverter””: “”“”,
““irradiation””: ““KWh/m2"”,
““specific_production.inverter””: ““KWh/KWp””,
““production.inverter””: ““KWh””,
““pr.inverter””: “””",
},
““data””:
{
"“2019-05-01T00:00:00"”:
{
““availability.inverter””: 1,
““irradiation””: 5.3934,
““specific_production.inverter””: 4.62,
““production.inverter””: 84961.323,
““pr.inverter””: 0.8571,
}
}
}
"

But i have this error:

[The last line says: “String Constants should end with quotes”]

I can’t catch the error, can somebody spot where the error is?

" <> ”, “
it means that " is not the same as ”, “.
:slight_smile:

Input text:

"""projectkey"": ""testProject"",""requestid"": ""daily"",""timezone"": ""Europe/London"",""datatype"": ""daily"",""dataunits"":{""availability.inverter"": """",""irradiation"": ""KWh/m2"",""specific_production.inverter"": ""KWh/KWp"",""production.inverter"": ""KWh"",""pr.inverter"": """",},""data"":{""2019-05-01T00:00:00"":{""availability.inverter"": 1,""irradiation"": 5.3934,""specific_production.inverter"": 4.62,""production.inverter"": 84961.323,""pr.inverter"": 0.8571,}}}"

You can verify syntax eg. in Notepad++

It seems the problem was the \newline

Thank you

1 Like

You can build Json string basing on this workflow:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.