L-P-G
Member
Sorry to ask again, but I am stuck.
Why does that not work? It is copied from the API docs php sample:
Code:$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://owner-api.teslamotors.com/api/1/vehicles/".$VEHICLE_ID."/command/honk_horn"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Authorization: Bearer $token" )); $response = curl_exec($ch); curl_close($ch); var_dump($response);
I just get a 404 back. All the request-type functions work, but all the command ones don't.
I don't know much PHP, but is this actually sending the colon as well?
Code:
"Authorization: Bearer $token"