Skip to content

The API feedback function

stuckyb edited this page Apr 8, 2014 · 1 revision

The VertNet API feedback function is actually just a URL for submitting a GitHub issue for a particular record via the VertNet portal. This makes it super straight forward to submit data issues without needing to authenticate API access to GitHub.

Given a record received through the VertNet Search API, the URL can be created like this:

var keyname = record['keyname'];
var tokens = keyname.split('/');
var publisher = tokens[0];
var resource = tokens[1];
var occurrence = tokens.splice(2).join('/');
var path = [publisher, resource].join('/') + '?id=' + occurrence;
var url = 'http://portal.vertnet.org/o/' + path; // URL for submitting a GitHub issue