You had a literal for ID
and that’s the reason why I wrote the above exactly the way I wrote it and not any other way
The way you wrote it would just result in ...?ID=id&...
If you want to have a variable you need to use a variable in that statement and not another string literal.
char data[256];
char id[24] = "IWATTWIL26";
char pwd[] = "xxxxxxxx";
int humidity = 90;
snprintf(data, sizeof(data)
,"{\"id\":\"%s\""
",\"pwd\":\"%s\""
",\"dt\":\"%s\""
",\"hum\":%d"
"}"
,id
,pwd
,"now"
,humidity
);