Depends on how you want to use it... display it in the app configuration, write it to the logs and copy it from there, post it to another local server, etc.
Here's an example rendering it out into an app preference (configuration) as a paragraph:
preferences(){
page(name: "setupScreen")
}
def setupScreen(){
if(!state.accessToken){
createAccessToken() //be sure to enable OAuth in the app settings or this call will fail
}
def localUri = getFullLocalApiServerUrl("optional/path") + "/?access_token=${state.accessToken}"
return dynamicPage(name: "setupScreen", uninstall: true, install: true){
section(){
paragraph("Use the following URI to access the endpoint:<br />Local: <a href='${localUri}'>Local URL</a>")
}
}
}
So after much banging my head against the wall I went the password auth route and all is well.
From what I read this is a how parameters are read from the url. When a key is passed more than once the second key:value pairs overwrite the first. So Hubitat doesnt accept the call. I then cannot save the access token trying to be passed in.
So just a quick question to @chuck.schwer can an alternate key name easily be added so we can pass the access token with a different key?
I am thinking this is a very edge case. However it drove me nuts for a few days.