Add a Section
You can add a new section using the POST method on the sections endpoint. You need a token with write privileges, otherwise a 401 or 403 will be sent back.
Section Format
The mandatory information for a new section is the archive to which it belongs (AID) as well as a section URI and a user-friendly label.
POST http://host.28.io/v1/_queries/public/api/sections?token=c3049752-4d35-43da-82a2-f89f1b06f7a4
{
"Archive" : "my-archive",
"SectionURI" : "http://www.example.com/my-section",
"Section" : "0001 - A new section"
}
You can post several sections at a time by sending them concatenated, with no comma separator.
POST http://host.28.io/v1/_queries/public/api/sections?token=c3049752-4d35-43da-82a2-f89f1b06f7a4
{
"Archive" : "my-archive",
"SectionURI" : "http://www.example.com/my-section",
"Section" : "0001 - A new section"
}
{
"Archive" : "my-archive2",
"SectionURI" : "http://www.example.com/my-section2",
"Section" : "0002 - A new section"
}
In case of success, the response body contains a copy of the section objects as they have been stored, after post-processing.
Further reference
The reference for the REST API including a complete description of all fields allowed or required in the input is documented here