Hello! I am unable to add a hostname to the javascript app we have registered using PHP curl.
This code has been working up until recently, is there something I am doing wrong?
Thank you in advance
$flyiotoken = "{our-fly-token}";
$edgeapp = "https://fly.io/api/v1/apps/{our-app-name}/hostnames";
$route_data = [
"data" => [
"attributes" => [
"hostname" => 'www.addinghostname.com'
]
]
];
$headers = array(
'Content-type: application/json',
'Authorization: Bearer ' . $flyiotoken,
);
$route_ch = curl_init();
curl_setopt($route_ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($route_ch, CURLOPT_URL, $edgeapp);
curl_setopt($route_ch, CURLOPT_POST, 1);
curl_setopt($route_ch, CURLOPT_POSTFIELDS, json_encode($route_data));
curl_setopt($route_ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($route_ch);
curl_close($route_ch);