sinricpro / non-sdk-issues

Report non sdk related issues here (Alexa, Google Home, SmartThings, IFTTT, API)
2 stars 0 forks source link

api logout is broken #55

Closed Geromatic closed 1 year ago

Geromatic commented 1 year ago

Sample code

Some code omitted - converted nodejs to arduino http

  http.setURL("/api/v1/logout");
  http.addHeader("Content-Type", "application/json");
  int httpResponseCode = http.GET();
  Serial.print("HTTP Response code: ");
  Serial.println(httpResponseCode);

  String jsonString = http.getString();
  Serial.println(jsonString);

Expect

returns success=true

Result

HTTP Response code: 404

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /api/v1/logout</pre>
</body>
</html>
kakopappa commented 1 year ago

Hi @Geromatic

/v1/auth/logout is an HTTP POST call. HTTP Response code 404 - Not found.

Geromatic commented 1 year ago

some of your api documentation needs to be fix

logout example is missing the header authorization token and uses GET