Server side API
#
Retrieving the debate summary codeLogora provides an API route to retrieve the debate summary server side. This API route returns the full HTML code of the debate summary (including CSS and scripts), that you can insert into your page template. This method replaces the insertion of the Logora script in your pages.
This API is also used by the Logora Javascript code to display the debate summary.
#
QueryBase URL :
https://render.logora.fr/synthesis
for the debate summaryhttps://render.logora.fr/widget
for the widget
Method : POST
Header : Content-Type: application/json
URL parameters :
shortname
(required): name of your application available in your administration panel
uid
(required): unique page identifier (it is the same identifier that is inserted on the client side)
insertType
(optional) : insertion mode, do not add in case of standard insertion. Indicate amp for an insertion on an AMP page or iframe for an insertion in iframe.
Request body: The request body must contain metadata about the page, in JSON format.
Examples of query URLs:
The
source_url
parameter must have a domain name identical to one of the authorized domains of your application (editable in Configuration > General), otherwise the source sent will not be taken into account.
For performance reasons, sources published before January 1st 2019 are not taken into account.
#
ResponseThe response returned follows this format:
The returned HTML code has the following container at its root:
#
Retrieving the list of articles (advanced usage)In order to avoid making unnecessary calls and to load the debate summary only on the pages where a debate is linked, you can use the route provided by the Logora API to retrieve the list of articles linked to a debate.
#
QueryBase URL :
https://app.logora.fr/api/v1/updated_sources
Method : GET
Header : Content-Type: application/json
URL parameters :
shortname
(required): name of your application available in your administration paneltimestamp
required): date from which you want to retrieve article updates (if a debate is associated or not), in Unix timestamp format (seconds).page
(optional): page numberper_page
(optional) : number of items per page, by default 10
The route returns the set of items that have had an association change to a debate since the date passed in parameter.
#
ResponseResponse headers:
total
: total number of items (not including pagination)total-pages
: number of pages in the response