Basics

The REST URLs have the following format:

GET https://europe-west1-events66app.cloudfunctions.net/api/events/<eventID>/types/<contentType>/secret/<apiSecret>
Lists all objects.

GET https://europe-west1-events66app.cloudfunctions.net/apiv2/events/<eventID>/types/<contentType>/secret/<apiSecret>
Lists all objects only with whitelisted fields.

POST https://europe-west1-events66app.cloudfunctions.net/create
Creates a new object.

POST https://europe-west1-events66app.cloudfunctions.net/update
Updates a existing object

POST Headers
Every POST request has to use the following headers:

x-eventcode <your eventID (can be found in the general settings of your event)>
x-contenttype <the contenttype you want to access>
x-secret <the api secret you defined in the api settings>
Content-Type application/json

POST Body

The body is always build the same way, it’s a JSON object with top level key called „item“ with the data inside.
the data always uses the following syntax:
<fieldUID>: <value>

Note:
The fieldUID can be found in your content type settings.
The field title is required in every request.
If you want to post Images you have to put in inside of an „files“ key.

Example POST Request (create)

fetch(APIURL, {
    method: "post",
    headers: {
      "Content-Type": "application/json",
      "x-eventcode": YOUR_EVENTCODE,
      "x-contenttype": YOUR_CONTENTTYPE,
      "x-secret": YOUR_API_SECRET
    },
    body: JSON.stringify({ 
        item: {
            "title": "exhibitor", <----- required "files": { "logo": "http://www.logoURL.com", "profile": "http://www.profileURL.com" } "description": "exhibitor description", "hall": 1, "booth": "12c", "city": "cologne", } }) }) .then(res => res.json())
    .then(json => console.log(json))

Example POST Request (update)

fetch(APIURL, {
    method: "post",
    headers: {
      "Content-Type": "application/json",
      "x-eventcode": YOUR_EVENTCODE,
      "x-contenttype": YOUR_CONTENTTYPE,
      "x-secret": YOUR_API_SECRET
    },
    body: JSON.stringify({ 
        item: {
            "uid" : "123" <----- required
            "title": "exhibitor", <----- required "files": { "logo": "http://www.logoURL.com", "profile": "http://www.profileURL.com" } "description": "exhibitor description", "hall": 1, "booth": "12c", "city": "cologne", } }) }) .then(res => res.json())
    .then(json => console.log(json))

HTTP Status Codes

The REST API uses the standard HTTP status codes:

200 OK for a successfull GET or POST request
400 BAD REQUEST if something with your request ist wrong, e.g. you have no data in the POST request
404 NOT FOUND if the data you want to access is wrong or the access is denied

See Errorcodes for detailed error handling.

Standard JSON Response
All POST requests return a JSON object in the following format:

Example:

{
  status: 200,
  item: {
    title: 'exhibitor'
  }
}

Example:

{
   status: 404,
   error: 'The event has been deleted'
}

POST Request Error Codes

Missing item

Error Missing item in request.
HTTP Status 400
Description your request is missing an item or it is in the wrong format.
Solution Check „Post Body“ for information how to setup data in POST Requests

Missing title

Error Missing title field in item.
HTTP Status 400
Description Every Request needs the title field in the body.
Solution Add the title field to the item inside of the body.

Missing uid

Error Missing uid field in item.
HTTP Status 400
Description Every Request needs the uid field in the body.
Solution Add the uid field to the item inside of the body.

Event not found

Error Event not found
HTTP Status 404
Description No related event to the provided eventID found.
Solution Make sure you are using the right eventID

Event deleted

Error The event has been deleted
HTTP Status 404
Description The eventID you provided belongs to an event which is deleted.
Solution Make sure you are using the right eventID. If the error persists contact the support.

Wrong secret

Error Wrong api secret
HTTP Status 403
Description The api secret you provided is wrong.
Solution Use the api secret you chose at the top of the api settings.

Content type not found

Error The specified content type does not exists.
HTTP Status 404
Description The content type you provided was not found.
Solution The content type has to be an existing content type in your event.

Key could not be found

Error The specified file key could not be found (<key>).
HTTP Status 400
Description The given key in the error does not exist as a field in the content type.
Solution Create a field with the key or correct your key name.

Key not allowed

Error The specified key is not allowed in this API (<key>).
HTTP Status 400
Description The key you want to write is not whitelisted in the api settings.
Solution Whitelist the key in the api settings.

Wrong format

Error Please provide <fieldname> in the format <fieldformat>.
HTTP Status 400
Description You are trying to write data to a field that is not formatted correctly.
Solution Provide the data in the required format