Only for API calls you will get headers back that you can act on but SmartApps themselves are not executed so you can’t act on the rate limiting.
When a SmartApp is actually executed, can I see the state of current time window, how many seconds remaining and the current event count?
As Ryan said above it is not available in our current implementation. The only place that exposes the rate limit details at this time are the headers.
So, is the only way to query the remaining allowance is for a SmartApp to make a request to itself and analyze the headers?
This seems a bit… inconvenient.
I didn’t know Device Handlers are exposing any web APIs. Could someone point me to documentation for that?
Is this it? In the cloud connected device types doc:
No, there is no mention of exposing web APIs. It only documents some outbound HTTP commands.
Device handlers can expose endpoints via a mappings
block like SmartApps. The SmartApp Web Services guide applies to device handlers as well, in that they can define a mappings block to expose endpoints.
It’s not clearly documented that this applies to device handlers, or why you would need to do this, at the moment. It’s on the list. Sorry.
If I could expose device handlers endpoints, how would I enable OAuth for a device handler to get client id/secret?
If I can’t then why is there a limit on something that can’t be done?
OAuth is for authentication, not API calls. You don’t need OAuth to make web calls. It makes perfect sense for them to also rate limit that.
I thought one would need to authenticate in order to be able to call APIs on a device.
Either way, I would like to know what the mechanism is and where it is documented.
Authentication can be done elsewhere and passed to the handler or not at all.
Where’s the API doc for this functionality? Samples? Anything?
We don’t have good documentation at the moment for using mappings
in a device handler specificaly. You can find some information about configuring the mappings
to handle inbound requests in the SmartApp Web Services guide. There’s also an example SmartApp that exposes web APIs [here][2]
.
We do have in our backlog work to document web services better overall, including in device handlers.
@Jim, is there any documentation or sample for using mappings
in a device handler?
Once I stick mappings
in a device handler, how do I interface with it?
You keep referring me to SmartApp web services guide.
Andrew, you are such a tease! You know something and you are not telling.
No. There is no documentation currently for specifically using the mappings
in a device handler. We are aware of that gap and it is in our documentation backlog to address.
@Jim, is the time window synchronous across the cloud?
Hello @April, with this new policy, is there a limit on the number of http requests a smartapp or device can send?
I now get the following error message sometimes:
groovyx.net.http.HttpResponseException: Too Many Requests
Please let me know.
Regards.
There are no limits on outbound requests. You may want to check the rate limiting policy on the API you are calling to see if that’s being hit.