APIs

From Redazione
Jump to navigation Jump to search
Line 57: Line 57:
  
 
==wikipages==
 
==wikipages==
The following endpoint retrieves one or more wiki pages under a specific path.
+
The following endpoint retrieves one or more wiki pages under a specific path. If more than one pages are captured, the endpoint can return a structured index (to be required among the options)
Options:
 
  
  
Line 74: Line 73:
 
retrieve_index: Boolean (if multiple pages, return a structured index),
 
retrieve_index: Boolean (if multiple pages, return a structured index),
 
organization_information:  Boolean (if the page belongs to an organization, return organization's data)
 
organization_information:  Boolean (if the page belongs to an organization, return organization's data)
 +
retrieve_data: Boolean (if on, return all the related data for each page)
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 16:05, 18 June 2020


sendemail

The following endpoint allows to send an email message, using one of the templates available on the site, to arbitrary lists of recipients including users belonging to groups of the related mediawiki.

endpoint

	https://culturaitaliana.org/api/sendemail


json request (POST)

{
	'path': String (url of related wiki),
	'username': String (username of bot or admin account),
	'password': String (password of bot or admin account),

	'template': String (name of used "pug" template),
	'to' or Array: String (list of recipients, can include one or more wiki groups),
	'cc': String or Array (list of recipients, can include one or more wiki groups),
	'bcc': String or Array (list of recipients, can include one or more wiki groups),
	'locals': Object (keys to be interpolated with values in the related template),

}


sendcode

The following endpoint sends a pin code at the provided email address held by a given property name.

endpoint

	https://culturaitaliana.org/api/sendcode


json request (POST)

{
	'email': String (email address),
	'property':  String (semantic property holding the value)
}


wikipages

The following endpoint retrieves one or more wiki pages under a specific path. If more than one pages are captured, the endpoint can return a structured index (to be required among the options)


endpoint

	https://culturaitaliana.org/api/wikipages


urlencoded request (GET)

	title: page title,
	retrieve_index: Boolean (if multiple pages, return a structured index),
	organization_information:  Boolean (if the page belongs to an organization, return organization's data)
	retrieve_data: Boolean (if on, return all the related data for each page)