ClientApi documentation

Client Api
https://clientapi.epublisher.world
Getting Started

Some basic information

  • Unless communicated differently, the base url for all calls in this documentation is https://clientapi.epublisher.world
  • All requests are case sensitive
  • Every call fo this API must be authorized with the Creator username and password as Basic Auth headers or a token as Bearer Token header
  • All calls are JSON based, unless something else is specifically mentioned

Revisions

  • 2021 new documentation format

ePublisher

Contact: Eelco van Delft

dev@epublisher-world.com

Authentication

All calls to the ClientAPI are done using Basic Auth with your Creator login or clientapi token

The login data is the same as your Creator username and password. Since version 1.2 we support the use if ClientApi tokens which can be sent as Bearer Token

  • If this data is not known for your account, then please contact your sales manager.
  • All login data is case sensitive
Articles

Articles info hier

GET /articles/{userid}/{startdate}/{enddate}/{amount}/{page}
GET /articles/{startdate}/{enddate}
POST /article/{storekey}/{feedid}
GET /deletearticle/{storekey}/{feedid}/{articleid}
Get Articles
GET /articles/{userid}/{startdate}/{enddate}/{amount}/{page}

Authentication

Creator Login

get all articles for the logged in account (or child account)

  • amount and page are required
  • When passing a userid, your Creator account needs to have access to the given userid, please check with your accountmanager, he will give you the userid if you do not already have it
  • When using dates, always enter both start and end dates
  • please keep in mind that longer date gaps and higher amounts will slow the responsetime of this call.

Path variables

userid
string optional

when your account allows this, pass a child userid

startdate
string optional

when set, must be used with enddate

Pattern: yyyy-mm-dd
enddate
string optional

when set, must be used with startdate

Pattern: yyyy-mm-dd
amount
integer required

amount of results per page

Min: 0
Max: 100
page
integer required

index of current page

Min: 1

Responses

200 Article Query Response
Example 1
Example 2
Example 3

get 50 items between 2020-01-01 and 2020-01-02 (1 returned)

GET https://clientapi.epublisher.world/articles/2020-01-01/2020-01-02/50/1 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "valid": true,
    "pages": 0,
    "pagesize": 50,
    "page": 1,
    "results": [
        {
            "id": 436015,
            "issuedate": "20191121",
            "title": "txt 1",
            "author": "",
            "content": "<p>HIGHLIGHTS</p><p>...text.</p>",
            "intro": "",
            "pagepreviewurl": "https://content.epublisher.world/Magazines/27733/background_1.jpg",
            "pagenumber": 1,
            "date": "2020-01-01T09:17:30",
            "editiontitle": "test",
            "editionid": 27733
        }
    ]
}

get 10 articles for user_id 123

GET https://clientapi.epublisher.world/articles/123/10/1 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "valid": true,
    "pages": 0,
    "pagesize": 10,
    "page": 1,
    "results": [
        {
            "id": 436015,
            "issuedate": "20191121",
            "title": "txt 1",
            "author": "",
            "content": "<p>HIGHLIGHTS</p><p>...text.</p>",
            "intro": "",
            "pagepreviewurl": "https://content.epublisher.world/Magazines/27733/background_1.jpg",
            "pagenumber": 1,
            "date": "2020-01-01T09:17:30",
            "editiontitle": "test",
            "editionid": 27733
        }
    ]
}

user has no access for user_id 111

GET https://clientapi.epublisher.world/articles/111/10/1 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "valid": false,
    "pages": 0,
    "pagesize": 0,
    "page": 0,
    "results": []
}
Get Article Archive
GET /articles/{startdate}/{enddate}

Authentication

Creator Login

Instead of getting articles as article objects in the api, it is possible to get all the data archived per edition

This call will generate and link downloadable zip files with all the content, this might take some time to be completed

Path variables

startdate
string required
Pattern: yyyy-mm-dd
enddate
string required
Pattern: yyyy-mm-dd

Responses

200 OK
Example 1
GET https://clientapi.epublisher.world/articles/2019-05-15/2019-07-22 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

[
    "https://content.epublisher.world/Generated/1234.zip",
    "https://content.epublisher.world/Generated/1235.zip",
    "https://content.epublisher.world/Generated/1236.zip"

]
Create Article
POST /article/{storekey}/{feedid}

Authentication

Creator Login

Creating or adding articles is an open system.

This means that there is no preset format for the data that you post. This can be XML or a json string.

Path variables

storekey
string required

unique identifier of the store to create the article in

feedid
integer required

unique identifier of the feed to create the article in

Request body

There is no set format for the body of this post Here are some samples of what could be possible, but this needs to be set validated and configured by your accountmanager When an item with the same ID already exists, this will be updated.

Object
ID
integer
Title
string
Text
string
Date
string
Image
string
Example 1
Example 2

A very basic JSON object

POST https://clientapi.epublisher.world/article/{storekey}/{feedid} HTTP/1.1 

Content-Type: application/json

{
    "ID": 1,
    "Title": "My lovely message",
    "Text": "My lovely long text that can contain all kinds of long text and html",
    "Date": "2020-01-01 12:12:12",
    "Image" : "https://mysite.com/images/1.jpg"
}

A very basic XML object

<item>
    <ID>1</ID>
    <Title>My lovely message</Title>
    <Text><![CDATA[My lovely long text that can contain all kinds og long text and html]]></Text>
    <Date>2020-01-01 12:12:12</Date>
    <Image>https://mysite.com/images/1.jpg</Image>
</item>
Delete Article
GET /deletearticle/{storekey}/{feedid}/{articleid}

Authentication

Creator Login

Delete an article, based on the remote (non epublisher) ID, which is passed as articleid

Path variables

storekey
string required
feedid
string required
articleid
string required

Responses

200 OK
Example 1
Example 2

valid call, but article 123454321 not found returns 0 updated items

GET https://clientapi.epublisher.world/deletearticle//90eee79f-46ee-4f7c-b75f-ce016a4f4bc6/2/123454321 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: text/plain

0

valid call, but article 123454321 found and updated 1 item

GET https://clientapi.epublisher.world/deletearticle//90eee79f-46ee-4f7c-b75f-ce016a4f4bc6/2/123454321 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: text/plain

1
Objects related to articles
Article Object
Object
Example:
{
    "id": 436015,
    "issuedate": "20191121",
    "title": "txt 1",
    "author": "",
    "content": "<p>HIGHLIGHTS</p><p>Korte berichten uit praktijk, wetenschap en onderzoek</p><p>Vlerick</p><p>VLERICK van wind- en zonnestroomparken.</p>",
    "intro": "",
    "pagepreviewurl": "https://content.epublisher.world/Magazines/27733/background_1.jpg",
    "pagenumber": 1,
    "date": "2019-10-25T09:17:30",
    "editiontitle": "test knowly",
    "editionid": 27733
}
id
integer
Example:
436015
issuedate
string
Example:
20191121
title
string
Example:
txt 1
author
string
content
string
Example:
<p>HIGHLIGHTS</p><p>Korte berichten uit praktijk, wetenschap en onderzoek</p><p>Vlerick</p><p>VLERICK van wind- en zonnestroomparken.</p>
intro
string
pagepreviewurl
string
Example:
https://content.epublisher.world/Magazines/27733/background_1.jpg
pagenumber
integer
Example:
1
date
string
Example:
2019-10-25T09:17:30
editiontitle
string
Example:
test knowly
editionid
integer
Example:
27733
200 Article Query Response
Body
Object
valid
boolean

returns if response is valid (data was found and the user has access)

Example:
true
pages
integer

amount of pages with results

Example:
2
pagesize
integer

amount of items per page

Example:
50
page
integer

current page

Example:
1
results
Array of Article Object

array of articles