Skip to main content

Publisher API

The Publisher API is tailored to bulk-upload publishers.

Get a list of publishers

Perform a GET request

/api/publishers

GET /api/publishers

It will return a list of all the publishers, together with their ID, their parent ID, the (company) name, the active flag and the quote.

Upload a list of publishers

We have two options here, with CSV and with JSON.
To retrieve the new ID (s) of the new publisher(s), perform a new GET request or check the interface. This means that in order to add a tree, you need to make a new request per layer, fetch the new assigned ID, and set that as the parent ID for the lower layer.

CSV

Perform a POST request

/api/publishers/csv

with a reference to a CSV file.

POST /api/publishers/csv -X 'POST' -F 'file=@/full/path/to/new_publishers.csv'

The syntax of the CSV file consists of one or more lines (no headers) of

<parentId>;<publisherName>

JSON

Perform a POST request

/api/publishers/json

with the JSON data embedded.

POST /api/publishers/json -X 'POST' -H 'Content-Type: application/json'  -d '[{"parentId":1,"companyName":"Sub publisher"}]'

Take note that the syntax for JSON is an array of objects with a parentId and a companyName field:

[{"parentId":1,"companyName":"Sub publisher"}, {...}]