SmartApp OAuth token not working on external REST API's

Where did you get the REST API for the camera image?

Typically a successful call to /api/smartapps/endpoints (with a proper OAuth access token) will result in something like:

Response:
200 OK
[
  {
  "oauthClient": {
    "clientId": "myclient",
    "authorizedGrantTypes": "authorization_code"
  },
  "url": "/api/smartapps/installations/8a2aa0cd3df1a718013df1ca2e3f000c"
  }
]

Then using the URL provided in the endpoints response, you would query one of the endpoints you defined in the mappings of your SmartApp:

mappings {
  path("/switches") {
	action: [
	  GET: "listSwitches",
	  PUT: "updateSwitches"
	]
  }
  path("/switches/:id") {
	action: [
	  GET: "showSwitch",
	  PUT: "updateSwitch"
	]
  }
}

Ninja Edit: For anyone else who finds this, I see that this appears to be a follow up to this question:

1 Like