-
Notifications
You must be signed in to change notification settings - Fork 7
REST APIv3 Documentation
To prevent tracking of API calls during tests and development, use the "X-Integreat-Development" header. Example:
curl -H "X-Integreat-Development: true" \
https://cms.integreat-app.de/testumgebung/de/wp-json/extensions/v3/pages
Get all locations (both live and hidden)
GET /wp-json/extensions/v3/sites HTTP/1.1
Host: web.integreat-app.de[
{
"id": Number, // id of location
"name": String, // prefix + name of location
"icon": String, // url to icon
"cover_image": String, // url to cover_image
"color": String, // hex-representation of main color (currently #FFA000)
"path": String, // path to site (without host)
"description": String, // description of location
"live": Boolean, // determines if the location is live or hidden
"prefix": String|null, // prefix of location name, e.g. "Stadt"
"name_without_prefix": String, // location name without prefix
"plz": Number|null, // plz (Postleitzahl/ZIP) of location
"extras": Boolean, // true if at least one extra is enabled
"events": Boolean, // true if events are enabled
"pois": Boolean, // true if points of interest are enabled
"push_notifications": Boolean, // true if push-notifications are enabled
"tunews": Boolean, // true if TüNews are enabled
"longitude": Number|null, // longitude of the geographic center of the city/county
"latitude": Number|null, // latitude of the geographic center of the city/county
"aliases": null|{ // value can also be NULL
"alias1": { // name of a city alias (smaller municipality within a county)
"longitude": Number, // longitude of the geographic center of the city/county alias
"latitude": Number, // latitude of the geographic center of the city/county alias
},
...
}
},
...
]Get all live or hidden sites
GET /wp-json/extensions/v3/sites/{live|hidden} HTTP/1.1
Host: web.integreat-app.de[
{
"id": Number, // id of location
"name": String, // prefix + name of location
"icon": String, // url to icon
"cover_image": String, // url to cover_image
"color": String, // hex-representation of main color (currently #FFA000)
"path": String, // path to site (without host)
"description": String // usually the same as "name"
"prefix": String|null // prefix of location name, e.g. "Stadt"
"name_without_prefix": String // location name without prefix
"plz": Number|null // plz (Postleitzahl/ZIP) of location
"extras": Boolean // true if at least one extra is enabled
"events": Boolean // true if events are enabled
"push-notifications": Boolean // true if push-notifications are enabled
},
...
]Get all available languages of a location
GET /{site}/de/wp-json/extensions/v3/languages HTTP/1.1
Host: web.integreat-app.de[
{
"id": Number,
"code": String, // language-code, e.g. "de" or "en"
"native_name": String,
"country_flag_url": String, // url to flag-image
"dir": String // reading direction {"ltr"|"rtl"}
},
...
]Get all pages/events/locations/disclaimer
GET /{site}/{language}/wp-json/extensions/v3/{pages|events|locations|disclaimer} HTTP/1.1
Host: web.integreat-app.de[
{
"id": Number,
"url": String, // url to post
"path": String, // path to post (url without host)
"title": String,
"modified_gmt": String, // date and time of the last modification ("YYYY-MM-DD HH:MM:SS")
"excerpt": String, // post summary (usually the first paragraph of the content without html tags)
"content": String,
"parent": {
"id": Number, // id of parent post
"url": String // URL of parent post
},
"order": Number,
"available_languages": {
String: { // language code of available language
"id": Number, // id of translated post
"url": String // url of translated post
},
...
},
"thumbnail": String,
"event": { // only present on event-endpoint
"id": Number,
"start_date": String, // YYYY-MM-DD
"end_date": String, // YYYY-MM-DD
"all_day": Boolean,
"start_time": String, // HH:MM:SS local time
"end_time": String, // HH:MM:SS local time
"recurrence_id": Number|null,
"timezone": String // Olson timezone or UTC manual offset
},
"location": { // only present on event- or location-endpoint
"id": Number|null,
"name": String|null,
"address": String|null,
"town": String|null,
"state": String|null,
"postcode": String|null,
"region": String|null,
"country": String|null,
"latitude": String|null,
"longitude": String|null
},
"hash": String // MD5-hash of post
},
...
]Note: The disclaimer-endpoint will only return one post, not a list of posts.
Get only pages/events/disclaimer, which have been modified (includes created) or deleted (send the ids/paths and hashes of all local pages as json). Either ids or paths are required, but cannot be mixed in the same request.
POST /{site}/{language}/wp-json/extensions/v3/{pages|events|disclaimer} HTTP/1.1
Host: web.integreat-app.de
Content-Type: application/json[
{
"id": Number | "path": String,
"hash": String
},
...
]{
"deleted": [
{
"id": Number | "path": String
},
...
],
"changed": [
{
... (see GET-request above for details to the parameters of a post)
},
...
]
}Get a single post by id or url (only one of both parameters is required)
GET /{site}/{language}/wp-json/extensions/v3/post?id={id}&url={url} HTTP/1.1
Host: web.integreat-app.de{
... (see request above for details to the parameters of a post)
}Get all (direct) children of a post by id or url (only one of both parameters is required)
GET /{site}/{language}/wp-json/extensions/v3/children?id={id}&url={url} HTTP/1.1
Host: web.integreat-app.de[
{
... (see request above for details to the parameters of a post)
},
...
]Get all (up to the root-page) parents of a post by id or url (only one of both parameters is required)
GET /{site}/{language}/wp-json/extensions/v3/parents?id={id}&url={url} HTTP/1.1
Host: web.integreat-app.de[
{
... (see request above for details to the parameters of a post)
},
...
]Get all enabled extras for a specific location
GET /{site}/{language}/wp-json/extensions/v3/extras HTTP/1.1
Host: web.integreat-app.de[
{
"name": String, // name of extra
"alias": String, // alias of extra
"url": String, // url to extra
"post": { // post-data (key & value pairs) for url (if needed) as json-object
String: String,
...
}|null,
"thumbnail": String, // url of thumbnail
},
...
]This is a legacy endpoint. Use the endpoints for page, event, imprint page resp. Feedback about a single page, event or disclaimer (also called "imprint page")
POST /{site}/{language}/wp-json/extensions/v3/feedback HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"permalink": String|null, // permalink of the page/event (required)
"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback about a single page
POST /{site}/{language}/wp-json/extensions/v3/feedback/page HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"slug": String|null, // slug of the page (required)
"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback about an event
POST /{site}/{language}/wp-json/extensions/v3/feedback/event HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"slug": String|null, // slug of the event (required)
"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback about an imprint page
POST /{site}/{language}/wp-json/extensions/v3/feedback HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback to a specific extra (also called "offer")
POST /{site}/{language}/wp-json/extensions/v3/feedback/extra HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"alias": String, // alias of the extra you want to comment on (required)
"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback about a search result
POST /{site}/{language}/wp-json/extensions/v3/feedback/search HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"query": String, // query string of the search you want to comment on (required)
"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback to all available cities/ about the city-list (also called "regions", "region list")
POST /wp-json/extensions/v3/feedback/cities HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback to the main categories of a city (also called "region"), e.g. which category is missing
POST /{site}/{language}/wp-json/extensions/v3/feedback/categories HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback to all available extras (also called "offers"), e.g. which extra is missing
POST /{site}/{language}/wp-json/extensions/v3/feedback/extras HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Feedback to all available events, e.g. which type of events are missing
POST /{site}/{language}/wp-json/extensions/v3/feedback/events HTTP/1.1
Host: web.integreat-app.de
Content-Type: multipart/form-data or application/x-www-form-urlencoded"comment": String, // your message (either comment or rating is required)
"rating": 'up'|'down'|null, // up- or downvote (either comment or rating is required)
"category": String|null, // comment category ("Technisches Feedback" or null; any other string is treated like null)Retrieve messages that were sent with Google Firebase Cloud Messaging.
The topic for FCM messages is in the format /topics/{blog-id}-{language-code}-{channel}
Without the channel variable, messages for all channels will be included. Filtering with HTTP GET variables by filter and single message id is supported.
GET /{site}/{language}/wp-json/extensions/v3/fcm?channel={channel}&id={id} HTTP/1.1
Host: web.integreat-app.de
Content-Type: application/json[
{
"id": Integer, // message ID
"title": String, // message title
"message": String, // message body
"timestamp": String, // YYYY-MM-DD HH:MM:SS
"channel": String // channel name
},
...
]Push content into the Integreat CMS
POST /{site}/{language}/wp-json/extensions/v3/pushpage HTTP/1.1
Host: web.integreat-app.de
Content-Type: application/json{
"page_id": Integer, // The ID of the page that should be updated
"content": String, // The content for the page, can be HTML
"token": String // The token can be obtained from the push content box in the page editing GUI
}{
"status": String //"success", "error", "denied"
}
To use any API URL with the WebApp, use the following JavaScript console command:
window.localStorage.setItem('api-url', 'your test api url')