Add an Archive
You can add a new archive using the POST method on the archives endpoint. You need a token with write privileges, otherwise a 401 or 403 will be sent back. There are two ways to create a filing: a full import of an XBRL instance and taxonomy out of a ZIP file, or a new empty filing with a JSON object containing its metadata.
Import an XBRL instance and taxonomy
When submitting an XBRL instance and taxonomy, a full import is performed. This will import all the facts from the instance, as well as the taxonomy schema and linkbases.
POST http://host.28.io/v1/_queries/public/api/archives?token=c3049752-4d35-43da-82a2-f89f1b06f7a4
[ZIP-Deflate-compressed XBRL filing]
Create a new Filing
The mandatory information for a new archive the entity to which it belongs (EID) as well as an Archive ID (AID).
POST http://host.28.io/v1/_queries/public/api/archives?token=c3049752-4d35-43da-82a2-f89f1b06f7a4
{
"AID" : "my-archive",
"Entity" : "http://www.example.com 001"
}
If the archive contains information about several entities, you can use an array field Entities instead of Entity.
POST http://host.28.io/v1/_queries/public/api/archives?token=c3049752-4d35-43da-82a2-f89f1b06f7a4
{
"AID" : "my-archive",
"Entities" : [ "http://www.example.com 001" ]
}
Namespaces
Namespace bindings can be added as a Namespace object:
POST http://host.28.io/v1/_queries/public/api/archives?token=c3049752-4d35-43da-82a2-f89f1b06f7a4
{
"AID" : "my-archive",
"Entity" : "http://www.example.com 001",
"Namespaces" : {
"us-gaap" : "http://fasb.org/us-gaap/2015-01-31"
}
}
By default, the following bindings will be added implicitly:
Prefix | Namespace |
---|---|
iso4217 | http://www.xbrl.org/2003/iso4217 |
xbrli | http://www.xbrl.org/2003/instance |
nonnum | http://www.xbrl.org/dtr/type/non-numeric |
num | http://www.xbrl.org/dtr/type/numeric |
xs | http://www.w3.org/2001/XMLSchema |
xbrldt | http://xbrl.org/2005/xbrldt |
link | http://www.xbrl.org/2003/linkbase |
xbrl | http://www.28.io/namespaces/xbrl |
xbrl28 | http://www.28.io/namespaces/xbrl28 |
In case of success, the response body contains a copy of the archive objects as they have been stored, after post-processing.
Further fields
In general, any object output by a GET on the archives endpoint will be accepted in a POST, so further fields such as InstanceURL are accepted and will be ignored.
You can post several archives at a time by sending them concatenated, with no comma separator.
Further reference
The reference for the REST API including the JSound schema for the input is documented here.