Open API for TrapNZ would be very useful

#1

Could an open API be made available for TrapNZ, so that request could be made with a key. XML or JSON would be fine.

That would enable other uses to be made of trapping data. For example, I would like to be able to use the API to get trap data for my project and use it with other applications.

1 Like
#2

Hi @mikepeters

This post has some info on getting data ins as XML and other formats. An “All trap records” layer has been added. It uses basic auth rather than a key, however.

There will be an API for public map feeds, and we plan to switch to using that for private feeds like the ones above. We’ll make an announcement when this becomes available.

#3

Please could you clarify the way that the url needs to be entered for basic auth on something like Arcgis online?
Would it be in the form:
https://username:password@trap.nz/wms/features/000000
I’m attempting this simply in a web browser and i get redirected to https://trap.nz/wms/features/0000000
and it returns:
<result>Access denied for user anonymous</result>

#4

Hi @root
Many thanks - an open API with a key would enable other non GIS uses that people might think of. For example - Connecting trap data to google calendar. Connecting with project management systems etc. The key would be additional to projectID. Each key would be unique to a user.

Xero has great documentation and examples of how their API works as does Google. So far there are 20,000 other open API’s available and growing daily

#5

No mind. The username/password prefix doesn’t seem to work, you need a client that can send basic authentication like QGIS (which is free vs Arcgis)
An API key as @mikepeters mentions would be handy too.

#6

Thanks Mike - we do have an open API and will document the feeds as they become available.

#7

Cheers David - yes modern browsers don’t let you do the username/password prefix any more!