Publications

The available operations are: Upload, modification and removal.

Upload

API endpoint: POST

https://tenant-url/integration-api/v1/dashboard/issues/

  • name
  • publication_date: Y-m-d 2018-07-27
  • free (optional): boolean
  • file: epub or pdf, up to 256mb
  • external_id
  • table_of_contents:

Multipart format

Endpoint:

https://tenant-url/integration-api/v1/dashboard/issues/?user_token=77d0b904-3b46-4e1a-8fde-2596375270b8

In case of failure it returns a 422 error with details on the error. In case of success returns a 201 with the created object.

$response = $client->request(
    'POST',
    'https://tenant-url/integration-api/v1/dashboard/issues/?user_token=77d0b904-3b46-4e1a-8fde-2596375270b8',
    [
        'multipart' => [
            [
                'name' => 'publication_date',
                'contents' => $this->date->format('Y-m-d')
            ],
            [
                'name' => 'name',
                'contents' => $this->humanReadableDate()
            ],
            [
                'name' => 'description',
                'contents' => $this->humanReadableDate()
            ],
            [
                'name' => 'free',
                'contents' => 0
            ],
            [
                'name' => 'table_of_contents',
                'contents' => file_get_contents($this->mergedLocation . 'tableOfContents.json'),
            ],
            [
                'name' => 'file',
                'contents' => file_get_contents($this->mergedLocation . 'merged.pdf'),
                'filename' => 'merged.pdf',
            ]
        ]
    ]
);

Removal

API endpoint: DELETE

https://tenant-url/integration-api/v1/dashboard/issues/{issue.id}?user_token=77d0b904-3b46-4e1a-8fde-2596375270b8

The endpoint uses as identifier the publication ID or external_id