Hi,
it´s my first try with JSon at all. I get from a platform like Digistore24 a call to a PHP-file, which includes the sales data, which I store within variables like $email.
Now I create the call like this:
$JSONString = ‘{ “email”: $email, “locale”: “de”, “fields:” [ { “Vorname”: “string”, “value”: $vorname }, { “Nachname”: “string”, “value”: $nachname }, { “Tag”: “string”, “value”: $tag } ] }’;
$JSONData = json_decode($JSONString, true);echo $JSONData;
$JSONCall = “curl -X POST ‘https://api.systeme.io/api/contacts’ -H ‘Content-Type: application/json’ -H ‘X-API-Key: MYAPIKEY’ -d '” . $JSONData . “'”;
$json = file_get_contents($JSONCall);
print_r($json);
And I get this message:
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 2 of the JSON data
Any idea, what´s wrong with my code?
Thanks for any hint!