-
Notifications
You must be signed in to change notification settings - Fork 2
spec api
David E. Wheeler edited this page Mar 23, 2017
·
6 revisions
-
Name:
spec
-
Returns:
text/plain; charset=utf-8
-
URI Template Variables:
{format}
- Availability: Mirror Server, API Server
Returns the contents of the version of the PGXN Meta Spec used by the network.
This document describes the data that must and can be included in the
META.json
files in releases uploaded to the network. The canonical copy may
be found here; an HTML rendition is
published here.
The single URI template variable is {spec}
. It may have one of two values:
-
txt
: Returns the spec formatted as plain text. -
html
: Returns the spec formatted as HTML. Available from API servers only.
Assuming you have retrieved the JSON document from the index API
and stored the data in the $table
hash, you can fetch the contents of the
PGXN Meta Spec like so:
use URI::Template;
use HTTP::Tiny;
my $tmpl = URI::Template->new($table->{spec});
my $uri = $tmpl->process({ format => 'txt' });
my $req = HTTP::Tiny->new;
my $res = $req->get('https://master.pgxn.org' . $uri);
say $res->{content};
If you have any questions about the PGXN Mirror and API Server APIs, please post them to the PGXN Users list. If you find any bugs in the API, please report them. To follow news about PGXN, subscribe to the blog and the Mastodon stream.