Endpoint null is blacklisted

Hello SmartPeople

I’m developing a SmartApp for HoneyWells Total Connect integration here and I have seem to have hit road block on a key process that I would like this app to have.

I always get the message

error java.lang.SecurityException: Endpoint null is blacklisted. @ line 69

and line 69 is httpPost call below. I don’t understand why is this backlisted. All the other API call in this App are executed in similar manner. Any pointers?

By the way, this is basically doing this call - https://rs.alarmnet.com/tc21api/tc2.asmx?op=GetZonesListInState

       def getZonesListInState = [
		uri: "https://rs.alarmnet.com/TC21API/TC2.asmx/GetZonesListInState",
		body: [ SessionID: token, LocationID: locationID, PartitionID: 1, ListIdentifierID: 1]
		]
		httpPost(getZoneListInState) { responseZoneListInState ->
							 log.debug responseZoneListInState.data

		} 
1 Like

normally when i see error java.lang.SecurityException: Endpoint null is blacklisted there is a url in the error, in your case you have null. sounds like something (URL) is not being passed correctly.

2 Likes

try splitting uri and path…

url: “https://rs.alarmnet.com”,
path: “/TC21API/TC2.asmx/GetZonesListInState”,

You also might want to set the content type or do a httpPostJson() if it’s a json post.

1 Like

Thanks for all your suggestions guys.

I tried splitting the URI & PATH (below), still no dice. Im doing everything to replicate the HTTP Post call listed here - https://rs.alarmnet.com/TC21API/TC2.asmx?op=GetZonesListInState, but still I end up getting endpoint “null” backlisted. Open for other suggestions. Thanks

def getZonesListInState = [
		uri: "https://rs.alarmnet.com",
        path: "/TC21API/TC2.asmx/GetZonesListInState",
        contentType: "application/x-www-form-urlencoded",
		body: [ SessionID: token, LocationID: b.locationId, PartitionID: 1, ListIdentifierID: 1]
		]
		httpPost(getZoneListInState) { responseZoneListInState ->
							 log.debug responseZoneListInState.data

		}

Looks like you have a typo.

Variable name is getZonesListInState
Passed variable name is getZoneListInState (note the missing z in Zones)

2 Likes

Holy c**. Im going to beat my self if this works now

1 Like

Let me know if this fixes it.

We’ve all been there. I’ve had at least two of these kinds of issues in the just the last week.

That works.

1 Like

[quote=“Dianoga, post:6, topic:21376”]
Looks like you have a typo
[/quote]This is why we can’t have nice things. Or rather this is why you want a real language, or at least a complier that warns you helpfully “variable so and so used without being set” - because static code analysis could tell you this :wink:

Sorry I missed the more obvious bug too.

1 Like

So you got this working? Every time I try to make this call I get
groovyx.net.http.HttpResponseException: Internal Server Error @ line 137
Did they change something since August?

I think I virtually stole your code. I really want to be able to read the status of a few of my zones, so I can do things like check if the alarm door sensor is closed before attempting to lock the door.

Map panelZonesList(token, locationId) {
def getZonesListInState = [
uri: “https://rs.alarmnet.com/TC21API/TC2.asmx/GetZonesListInState”,
body: [ SessionID: token, LocationID: locationID, PartitionID: 1, ListIdentifierID: 1]
]
httpPost(getZonesListInState) { responseZoneListInState ->
log.debug responseZoneListInState.data

    }

}