Hubitat App Object - Api returns App Exception, not found

Hi,

I'm using two methods from the App Object methods outlined here:

https://docs.hubitat.com/index.php?title=App_Object

I'm using:
getFullApiServerUrl

and
createAccessToken

and I've added a path to attempt to run an app command.

This debugs, in my logs to:

https://cloud.hubitat.com/api/[HUB-ID]/apps/[APP-ID]/oauth/webhook?access_token=[TOKEN]

I've tried to hit the url with Postman and I see

{"error": true, "type": "AppException", "message": "Not Found"}

I would say I was trying to point to an app that doesn't exist but considering this comes from debugging the app object method I'm stuck.

Can anyone suggest anything?

This error happens if the app doesn't have a mapping for the specified path.

Do you have a mappings defined in your app code for the /oauth/webook path?

You would need something like this:

 mappings {
 	path("/oauth/webhook") { action: [GET: "webhookHandler"] }
 }
2 Likes

Thank you Tony. That's exactly what the problem was. The mapping was missing.

1 Like