Receiving multiple endpoints for a single web service smart app

oauth
webservices

(Moiz Hayder) #1

Hey guyz,

My account has 3 locations: (Home, Office and Test Location). I created a web service smart app and installed it at Home location. When I called https://graph.api.smartthings.com/api/smartapps/endpoints from Postman using the API token listed in the simulator, I got 3 duplicate instances of the endpoint instead of one. It appears to me that the endpoint instances are somehow getting multiplied with the locations because when I created another location (Test Location 2), the endpoints call now returns 4 duplicate instances.

Why is this happening ?

Here is the response of the endpoints call I got:

[
{
“oauthClient”: {
“clientSecret”: “[client_secret]”,
“clientId”: “[client_id]”
},
“uri”: “https://graph.api.smartthings.com:443/api/smartapps/installations/96f0e207-d390-4e46-8d35-58495a8fc0eb”,
“base_url”: “https://graph.api.smartthings.com:443”,
“url”: “/api/smartapps/installations/96f0e207-d390-4e46-8d35-58495a8fc0eb”
},
{
“oauthClient”: {
“clientSecret”: “[client_secret]”,
“clientId”: “[client_id]”
},
“uri”: “https://graph.api.smartthings.com:443/api/smartapps/installations/96f0e207-d390-4e46-8d35-58495a8fc0eb”,
“base_url”: “https://graph.api.smartthings.com:443”,
“url”: “/api/smartapps/installations/96f0e207-d390-4e46-8d35-58495a8fc0eb”
},
{
“oauthClient”: {
“clientSecret”: “[client_secret]”,
“clientId”: “[client_id]”
},
“uri”: “https://graph.api.smartthings.com:443/api/smartapps/installations/96f0e207-d390-4e46-8d35-58495a8fc0eb”,
“base_url”: “https://graph.api.smartthings.com:443”,
“url”: “/api/smartapps/installations/96f0e207-d390-4e46-8d35-58495a8fc0eb”
},
{
“oauthClient”: {
“clientSecret”: “[client_secret]”,
“clientId”: “[client_id]”
},
“uri”: “https://graph.api.smartthings.com:443/api/smartapps/installations/96f0e207-d390-4e46-8d35-58495a8fc0eb”,
“base_url”: “https://graph.api.smartthings.com:443”,
“url”: “/api/smartapps/installations/96f0e207-d390-4e46-8d35-58495a8fc0eb”
}
]


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

I don’t know what’s happening, but I’m pretty certain that @625alex and I have experienced this.

Be sure to tag @slagle and @jody.albritton, as this requires Developer Advocate Support.

Meanwhile, I’ll try to remember if we did anything to resolve this, or if it didn’t matter, or went away on its own…


(Alex) #3

I suspect that endpoints call returns duplicates per each shard. I brought this up with @Jim last week, but maybe we need to escalate this.

@Moiz_Hayder, at this moment I doubt you can do anything about it. Just iterate over the list of distinct URIs and do what you do per each of the endpoints.


(Jim Anderson) #4

Yes, there is a ticket to address this issue. I have seen the duplicates be returned for a SmartApp installed into a single shard, all with the same URI.