Hello
Unfortunately I can't get any further
I have an API call (CURL) which should return a JSON and store the response in a variable $resp
with a var_dump($resp); I get this displayed
This also seems to contain a JSON but how do I get it?
The first part of the text does not seem to be part of the JSON. Can anyone help?
i need the JSON
string(529) "{"status":"SUCCESS","statuses":[{"id":35012,"name":"Neue Bestellungen","name_for_customer":"Neue Bestellung angenommen","color":"#69b6fa"},{"id":35013,"name":"Zum Senden","name_for_customer":"Bereit zum Versenden","color":"#EA864D"},{"id":35014,"name":"abgeschickt","name_for_customer":"Produkte wurden versendet","color":"#22A564"},{"id":35015,"name":"storniert","name_for_customer":"Die Bestellung wurde storniert","color":"#D54839"},{"id":35016,"name":"Beispielstatus","name_for_customer":"Beispielstatus","color":"#4E565F"}]}"
the PHP:
$methodParams = '[]';
$apiParams = [
"method" => "getOrders",
"parameters" => $methodParams
];
$curl = curl_init("https://xxxxx");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [xxx]);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($apiParams));
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Tranbslate by deepl
Unfortunately I can't get any further
I have an API call (CURL) which should return a JSON and store the response in a variable $resp
with a var_dump($resp); I get this displayed
This also seems to contain a JSON but how do I get it?
The first part of the text does not seem to be part of the JSON. Can anyone help?
i need the JSON
string(529) "{"status":"SUCCESS","statuses":[{"id":35012,"name":"Neue Bestellungen","name_for_customer":"Neue Bestellung angenommen","color":"#69b6fa"},{"id":35013,"name":"Zum Senden","name_for_customer":"Bereit zum Versenden","color":"#EA864D"},{"id":35014,"name":"abgeschickt","name_for_customer":"Produkte wurden versendet","color":"#22A564"},{"id":35015,"name":"storniert","name_for_customer":"Die Bestellung wurde storniert","color":"#D54839"},{"id":35016,"name":"Beispielstatus","name_for_customer":"Beispielstatus","color":"#4E565F"}]}"
the PHP:
$methodParams = '[]';
$apiParams = [
"method" => "getOrders",
"parameters" => $methodParams
];
$curl = curl_init("https://xxxxx");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, [xxx]);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($apiParams));
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
Tranbslate by deepl