I’m a rookie when it comes to writing API commands. My goal is to improve an app that uses a forscam’s motion detector. In that effort I have to figure out just how the APIs work. I’m hoping to get help here on this super simple program and get it up and running.
definition(
name: "Test API.",
namespace: "Home",
author: "Craig via SmartThings",
description: "can't get APIs to work...",
category: "My Apps",
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/photo-burst-when.png",
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/photo-burst-when@2x.png"
)
preferences {
section("Take a burst of pictures") {
input "camera", "capability.imageCapture"
input "burst", "number", title: "How many? (default 5)", defaultValue:5, required: true
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
subscribeToEvents()
}
def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
}
mappings {
path("/camera") {
action: [
GET: "getCamera"
]
}
}
def getCamera() {
log.info "it worked"
}
I went through the basic steps on this page: ST API Documentation. I ended up with this URL: https://graph.api.smartthings.com/api/smartapps/installations/APP_ID/camera/ON?OATH_KEY
First Problem: I’m getting this error:
{“error”:true,“type”:“AccessDenied”,“message”:“You are not authorized to perform the requested operation.”}