Back to top

POST - Introduction

The EILAPI let you post data to the eventsinluxembourg database. It's a RESTful Web Service API, based ont the REST API in Drupal 8, that apps and websites can use to programmatically submit events.

Basics

  • The event must be submitted in JSON format.
  • To submit events you need to include an API key accessible in your MyEvents account on the API page.

How to submit an Event to the EILAPI?

To post the data to the API the following URL has to be called using a HTTP library, such as cURL and urllib.

This is the schema which has to be used:
https://eventsinluxembourg.lu/node?_format=[json OR xml]&api-key=[API key]

 

Which values can be send?

Permissions

  • An API key is needed

Fields

Name Description Format Possible values
Type Type of content "type":[{"target_id":"event"}]  
Title name of the event "title":[ { "value": "[TITLE]" } ] (mandatory) String
Subtitle subtitle of the event "field_subtitle":[ { "value": "[SUBTITLE]" } ] String
Pictures pictures of the event "field_pictures":[ { "target_id": 23861} ] (multiple values)

to get the target_id you have to POST the file to the API in a seperate request:
https://drupal.stackexchange.com/questions/118106/how-to-send-files-to-…
String (URL)
Event type type of the event "field_event_type":[ { "value": "1" } ] 1|Single or several dates
2|Regularly recurring event
3|Long or permanent event
Dates and timings
List
list of dates and timing of the event "field_date":[ { "value": "[DATEFROM]", "end_value": "[DATETO]", "timezone": "[TIMEZONE]", "rrule": "[RRULE]", "infinite": [true OR false] } ] (multiple values, mandatory) Dates and timings in format
YYYY-MM-DD\THH:MM:SS

Dates and timings
Opening hours

Opening hours in case of a long or permanent event "field_opening_hours":[ { "day": [DAY], "starthours": [STARTHOURS], "endhours": [ENDHOURS] }] (multiple values)

Day 1-7 (1 = Monday)

Integer (ex. 20h00 => 2000)

Dates and timings
Exeptionnally closed
Dates on which the long or permanent event is closed "field_exceptionally_closed_on":[ { "value": "2018-10-25" } ] (multiple values) Dates in format
YYYY-MM-DD\THH:MM:SS

Venues

list of venue IDs of the event

"field_location":[ { "target_id": [ID] } ] (multiple values)

Specifications are available on the API reference venues page.

Reference ID
No fix location the event has no fix location "field_no_fix_location":[ { "value": [true OR false] } ] Boolean
Prices entrance fees for the event "field_prices":[ { "first": "[DESCRIPTION]", "second": [PRICE] } ] String, Float
Free of charge no entrance fees for the event "field_freeofcharge":[ { "value": [true OR false] } ] Boolean
Description DE German event description "field_description_de":[ {"value": "[HTML]"} ] HTML text
Description FR French event description "field_description_fr":[ {"value": "[HTML]"} ] HTML text
Description EN English event description "field_description_en":[ {"value": "[HTML]"} ] HTML text
Description LU Luxembourgish event description "field_description_lu":[ {"value": "[HTML]"} ] HTML text
Main category event category

"field_categories":[ {"target_id": [ID]} ]

Specifications are available on the API reference category page.

Reference ID

Secondary category event category

"field_secondary_category":[ {"target_id": [ID]} ]

Specifications are available on the API reference category page.

Reference ID
Audience event audience

"field_type":[ { "target_id": [ID] } ]

Specifications are available on the API reference audience page.

Reference ID

Tags keywords describing the event   "field_tags_rest": [
    {
      "value": "[tag1],[tag2],[tag3]"
    }
  ],
string
Contact email Public contact or support email addresses "field_contact_email":[ { "first": "[EMAIL]", "second": null } ], email address
Contact phone number Public contact or support phone number "field_contact_phonenumber":[ { "first": "[PHONE]", "second": null } ], string
Websites Websites of the event field_websites":[ { "uri": "[URL]", "title": "[LINKTITLE]"} ], string (URL)
Online tickets Links to an online ticket shop "field_tickets_online":[ { "datetime": "[DATE]", "link": "[LINK]", "id": [ID] } ] (multiple values)
  • Dates in format
    YYYY-MM-DD\THH:MM:SS
  • string (URL)
  • integer
Sales email address Sales email address for the event "field_sales_email_address":[ { "value": "[EMAIL]" } ], email address
Sales phone number Sales phone number for the event "field_sales_phone_number":[ { "value": "[PHONE]" } ] string
Sales start date Sales start date for the tickets field_sales_start_date":[ { "value": "[DATE]" } ] string
Sales organisation Sales organisation for this event field_tickets_sold_by":[ { "value": "[ORGANISATION]" } ] string
Sales website Link for more information "field_url":[ { "uri": "[URL]" } ] string (URL)
Organizer Name of the organizer "field_organizer":[ { "value": "[NAME]" } ], string
State State of the event field_state":[ { "value": "[STATE]" } ],

string

  • scheduled
  • canceled
  • deleted
User email address Account e-mail address of the acting user field_email_address":[ { "value": "[EMAIL]" } ],  

 

More information and examples

https://www.drupal.org/docs/8/core/modules/rest/3-post-for-creating-con…

Example: Add a picture

example-POST-file
{

"_links": {

"type": {

  "href": "https://eventsinluxembourg.lu/rest/type/file/image"

}

},
"uri":[
  {
     "value":"public://favicon-32x32.png"}
],

"filename": [
{

  "value": "favicon-32x32.png"

}

],

"filemime": [

{

  "value": "image/png"

}

],

"filesize": [

{

  "value": "488"

}

],

"type": [

{

  "target_id": "image"

}

],

"data": [

{

  "value": "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAkUExURUxpcSOq4SOq4SOq4SOq4SOq4SOq4SOq4SOq4SOq4SOq4SOq4U0m8UcAAAAMdFJOUwD/EvAm2qhTPMRrkl4CMYAAAAE1SURBVCjPXZG/S8NQEMePR7Ehnb48khC7BEFFnYJD6/aWOLilVBy6WBVc648/oCii1KlFKDrFwV2tqH+edy9Rk7zh8e7Dfe++944oP5dUO59RDQyPqrFK/WqKCzxUwA30oJyymervlVK8PsVBOd85hh6pyflfhwXg024cjguwBqCjhsCsSOAn+k4MBGpUWAB6Tb6W1VxAgv+MfcPgWUBgazjxoYwlQLrsmBa6MhbH3hep2yu6QJuowWL9Yfs1U4QRSbWOjRts0DMCdEbqjl8s1kYkPqmX7YGRfgy4aJe2IB+0wZJI2s7ojEGbWtJejL1aL55h+wGDVWTWix47+cAug6kAycjs+LkkjFzku0h6dC3D01KxCmdOLrt7pyQ0+Z/tRXT/eEr0dvL7y6zkrbhPtYVPrOAHKZQ53IyepQMAAAAASUVORK5CYII="

}]}