# Welcome to Eventmaker for developers

INTEGRATE, EXTEND, and BUILD ON Eventmaker PRODUCTS Develop apps and integrations for 5000+ Event Professionals

{% content-ref url="/pages/-MPmYRI5lRZNKZaVXSFZ" %}
[Rest APIs](https://developers.eventmaker.io/rest-apis/get-your-api-access-token)
{% endcontent-ref %}

{% content-ref url="/pages/-MPmbJsIRwKHCD2qibw6" %}
[Configuration](https://developers.eventmaker.io/configuration/creating-an-oauth-app)
{% endcontent-ref %}

{% content-ref url="/pages/-MPmYU83JC2x2Rw4BCO3" %}
[Liquid Documentation](https://developers.eventmaker.io/liquid-documentation/campaign-email)
{% endcontent-ref %}


# Get your API access token

If you would like to use our API our 3rd party integration, your will need to provide your access token.&#x20;

Access token is strictly personal. It grants you to access all your data on [eventmaker.io.](http://eventmaker.io/)&#x20;

In order to get it, you need to click on the user icon on the top right hand corner, and then click on Profile.

![](https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MPmbvegqDNzYsX22l-H%2F-MPmcdf1kS-ygvrE709u%2Fimage.png?alt=media\&token=501089c0-a5ee-4907-b2e0-a913048d96f5)

The Auth Token will be displayed in the API section.&#x20;

![](https://downloads.intercomcdn.com/i/o/58989464/00eaa2135530504aa95cecb8/image.png)


# Eventmaker Rest API

Eventmaker API documentation - version 1

The [Eventmaker](http://www.eventmaker.io/) API is implemented as vanilla JSON and XML over HTTP using all four verbs (GET/POST/PUT/DELETE). Every resource, like Event, Guest, or Check-in, has their own URL and are manipulated in isolation. In other words, we’ve tried to make the API follow the REST principles.

You can explore the view part of the API (everything that’s fetched with GET) through a regular browser. Using Firefox for this is particularly nice as it has a good, simple XML renderer. You can also get a nice view of the JSON version of the API by installing [JSON View](https://addons.mozilla.org/fr/firefox/addon/jsonview/).

## Testing the API

### With curl

You can test Eventmaker API using the command line tool `curl`. If you need to update (`PUT`) or create (`POST`) a JSON resource, use the following template:

```
curl -X PUT  -H "Content-Type: application/json" -d "{json_resource}" {url}.json?auth_token=YOUR_API_TOKEN
curl -X POST -H "Content-Type: application/json" -d "{json_resource}" {url}.json?auth_token=YOUR_API_TOKEN
```

Where the `{json_resource}` is the payload to send to the API to create/update a resource.

### With a REST client

If you prefer to test the API with a more visual tool, you can use [REST Client](http://restclient.net/), an open-source debugger for RESTful web services, like Eventmaker API! A handy [Firefox add-on](https://addons.mozilla.org/firefox/addon/restclient) is available, and the Chrome and Safari extensions are on the way.

## API Endpoints

**A Swagger documentation is available here:** [**https://app.eventmaker.io/swagger**](https://app.eventmaker.io/swagger)

## Authentication

When you’re using the API, it’s always through an existing user in Eventmaker. There’s no special API user. So when you use the API as “<john@company.org>”, you get to see and work with what John is allowed to. Authenticating is done with an authentication token, which you’ll found in your user profil (you must be logged in).

Then you just need to append the `auth_token` as a query parameter of the URL. For instance, you can retrieve a JSON array of all the events you manage by issuing the following request:

```
GET /api/v1/events.json?auth_token=YOUR_API_TOKEN
```

## Format

The Eventmaker API supports both XML and JSON. You can choose the format you prefer by simply appending `.xml` or `.json` at the end of the resource URL you query.

```
Request
  GET /api/v1/events.json?auth_token=YOUR_API_TOKEN

Response
  HTTP/1.1 200 OK
  Content-Type: application/json; charset=utf-8
```

And for the XML version:

```
Request
  GET /api/v1/events.xml?auth_token=YOUR_API_TOKEN

Response
  HTTP/1.1 200 OK
  Content-Type: application/xml; charset=utf-8
```

In the endpoints documentation, we’ll use `.format` to refer to `.xml` or `.json`.

When you want to write some data to the API with `POST` (creation) or `PUT` (update), you’ll need to specify a content-type request header.

```
Request
  POST /api/v1/events/{event_id}/guests.json?auth_token=YOUR_API_TOKEN
  Content-Type: application/json; charset=utf-8

Response
  HTTP/1.1 201 Created
  Content-Type: application/json; charset=utf-8
```

And for the XML version, you get the idead.

## API Return Codes

The API uses the following HTTP status code in the response. Pay attention to them as they will tell you if an error occurred.

* [200](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) OK - For any `GET` method which succeds.
* [201](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2) Created - For any `POST` method which succeds.
* [204](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5) No Content - For any `PUT` or `DELETE` method which succeds.
* [400](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) Bad Request - Check your request body.
* [403](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4) Forbidden - You might have forgotten the `auth_token`.
* [404](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) Not Found - The resource does not exist.
* [406](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) Not Acceptable - You might have forgotten the `.format` or the request `Content-Type`.
* 422 Unprocessable Entity - Check your request body, the JSON or XML might be malformed.

## Error messages

If you don’t receive a `2xx` HTTP status code in the response, it means that there is an error. You can look at the response body to get more insight about why your API call was not successful.

### JSON

If there is a general error, we’ll send you this:

```
DELETE /api/v1/events.json
```

```
// 404 Not Found
{
  "error": "No API endpoint found at /api/v1/events and method DELETE"
}
```

Now if there is an error with the payload provided to create (`POST`) or update (`PUT`) a resource, we’ll detail the validation errors like this:

### HTTP Request

```
POST /api/v1/events/{event_id}.json
Content-Type: application/json; charset=utf-8

{ "first_name": "Sébastien", "company_name": "Eventmaker" }
```

```
// 422 Unprocessable Entity
{
  "errors":
  {
    "uid":
    [
      "is invalid",
      "can't be blank"
    ],
    "guest_category_id":
    [
      "can't be blank"
    ],
    "last_name":
    [
      "should be set, or at least one other element of identity: email, company or uid."
    ]
  }
}
```

### XML

For the same exemple above, you will have the following responses:

```
<!-- 404 Not Found -->
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>No API endpoint found at /api/v1/events and method DELETE</error>
</errors>
```

```
<!-- 422 Unprocessable Entity -->
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Guest Uid is invalid</error>
  <error>Guest Uid can't be blank</error>
  <error>Guest Category can't be blank</error>
  <error>Last Name should be set, or at least one other element of identity: email, company or uid.</error>
</errors>
```


# Events

## Events

### Retrieve the list of events

#### JSON

You can easily get a JSON array of all the events you manage with the following `GET` request.

**Request**

```
GET /api/v1/events.json?auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
[
  {
    // the first event
  },
  {
    // the second event
  }
]
```

#### XML

**Request**

```
GET /api/v1/events.xml?auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<?xml version="1.0" encoding="UTF-8"?>
<events type="array">
  <event>
    [...]
  </event>
  <event>
    [...]
  </event>
</events>
```

### Get information about a given event

#### JSON

If you are interested in only one event and already have his `id`, you can issue the following `GET` request. You will receive a JSON object representing your event.

**Request**

```
GET /api/v1/events/{event_id}.json?auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
{
  "_id": "{event_id}",
  "badge_complete_hook_url": null,
  "description": "Sheldon Cooper and Amy Farrah Fowler are throwing a celebration party for reaching their tenth watcher.",
  "end_date": "2012-11-22T05:00:00+00:00",
  "locale": "en",
  "mobinetwork_enabled": false,
  "organizer": "Sheldon Cooper",
  "plan": "pro",
  "start_date": "2012-11-22T03:00:00+00:00",
  "timezone": "Pacific Time (US &amp; Canada)",
  "title": "Fun with Flags Party",
  "reply_to_email": "sheldon@cooper.org",
  "guest_count": 12,
  "check_in_count": 422
}
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}.xml?auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<event>
  <_id>{event_id}</_id>
  <title>Fun with Flags Party</title>
  <description>Sheldon Cooper and Amy Farrah Fowler are throwing a celebration party for reaching their tenth watcher.</description>
  <locale>en</locale>
  <organizer>Sheldon Cooper</organizer>
  <plan>pro</plan>
  <start-date type="datetime">2012-11-22T03:00:00Z</start-date>
  <end-date type="datetime">2012-11-22T05:00:00Z</end-date>
  <timezone>Pacific Time (US & Canada)</timezone>
  <mobinetwork-enabled type="boolean">false</mobinetwork-enabled>
  <reply-to-email>sheldon@cooper.org</reply-to-email>
  <badge-complete-hook-url nil="true"/>
  <guest-count type="integer">12</guest-count>
  <check-in-count type="integer">422</check-in-count>
</event>
```

### Updating an event

#### JSON

**Request**

```
PUT /api/v1/events/{event_id}.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  // Fields that can be updated. You can include only fields you want to update.
  "title": "Fun with Flags Party",
  "description": "Sheldon Cooper and Amy Farrah Fowler are throwing a celebration party for reaching their tenth watcher.",
  "locale": "en",
  "mobinetwork_enabled": false,
  "organizer": "Sheldon Cooper",
  "start_date": "2012-11-22T03:00:00+00:00",
  "end_date": "2012-11-22T05:00:00+00:00",
  "timezone": "Pacific Time (US &amp; Canada)",
  "badge_complete_hook_url": "http://my.company.org/handle_mobicheckin_guest_created.json",
  "reply_to_email": "your.email@company.org"
}
```

**Response**

```
// 204 No Content
```

#### XML

**Request**

```
PUT /api/v1/events/{event_id}.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<event>
  <!-- Fields that can be updated. You can include only fields you want to update. -->
  <title>Fun with Flags Party</title>
  <description>Sheldon Cooper and Amy Farrah Fowler are throwing a celebration party for reaching their tenth watcher.</description>
  <locale>en</locale>
  <organizer>Sheldon Cooper</organizer>
  <plan>pro</plan>
  <start-date type="datetime">2012-11-22T03:00:00Z</start-date>
  <end-date type="datetime">2012-11-22T05:00:00Z</end-date>
  <timezone>Pacific Time (US & Canada)</timezone>
  <mobinetwork-enabled type="boolean">false</mobinetwork-enabled>
  <badge-complete-hook-url>http://my.company.org/handle_mobicheckin_guest_created.json</badge-complete-hook-url>
  <reply-to-email>your.email@company.org</reply-to-email>
</event>
```

**Response**

```
<!-- 204 No Content -->
```


# Guests

## Guests

### Retrieve the list of guests

MobiCheckin provides a paginaged API to retrieve the list of guests of your event. Starts at `page=1`. Paginate every 500 guests. If you want to know how many guests registered to your event, you should query `GET /api/v1/events/{id}.format` and look at the property `guest_count`.

Optional query parameters are:

1. `?uid=%s`: Search a guest by his/her uid. Will return an array of 0 or 1 guest.
2. `?search=%s`: Full-text search in the guest list.
3. `?category[]=%s&category[]=%s`: Filter by the given guest category ids.

You can compound these filter parameters

#### JSON

**Request**

```
GET /api/v1/events/{event_id}/guests.json?page=1&auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
[
  {
    // the first guest
  },
  {
    // the second guest
  }
]
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}/guests.xml?page=1&auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<?xml version="1.0" encoding="UTF-8"?>
<guests type="array">
  <guest>
    <!-- [...] -->
  </guest>
  <guest>
    <!-- [...] -->
  </guest>
</guest>
```

You can increment the `page` query string parameter until you get an empty array.

### Create a new guest

You can add a new person to your event guest list.

#### JSON

**Request**

```
POST /api/v1/events/{event_id}/guests.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  "guest_category_id": "{guest_category_id}",
  "email":             "john.smith@acme.org",
  "first_name":        "John",
  "last_name":         "Smith",
  "company_name":      "Acme Inc.",
  "position":          "CEO",
  "phone_number":      "001122334455",

  // Use this field if you want to choose your owns ids for your guests.
  "uid": {your_custom_id},

  // Use this field if you want a message that appear on the iOS device when the guest is checked-in.
  "message": "Vegan lunch",

  // You can pass any other information abotu the guest in this array.
  "guest_metadata": [
    { "name": "Has a dog",  "value": "Yes" },
    { "name": "Birth year", "value": "1960" }
  ]

  // You can pass an array of access privileges for specific check-in points
  "access_privileges_attributes": [
    { "access_once": true,  "accesspoint_id": "{workshop_foo_id}" },
    { "access_once": false, "accesspoint_id": "{vip_room_id}" },
  ]
}
```

**Response**

```
// 201 Created
{
   "badge_completed": false,
   "rsvp_status": "not_replied",
   "_id": "50af6426bbfa805f760005ac",
   "guest_category_id": "{guest_category_id}",
   "email": "john.smith@acme.org",
   "first_name": "John",
   "last_name": "Smith",
   "company_name": "Acme Inc.",
   "position": "CEO",
   "phone_number": "001122334455",
   "message": "Vegan lunch",
   "event_id": "{event_id}",
   "uid": "9vts5v3nqs",
   "updated_at": "2012-11-23T11:55:18Z",
   "created_at": "2012-11-23T11:55:18Z",
   "badge_url": null,
   "qrcode_url": null,
   "guest_metadata":
   [
      { "name": "Has a dog",  "value": "Yes" },
      { "name": "Birth year", "value": "1960" }
   ],
   "access_privileges":
   [
     // Array of all access privileges
   ]
}
```

#### XML

**Request**

```
POST /api/v1/events/{event_id}/guests.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<guest>
  <guest-category-id>{guest_category_id}</guest-category-id>
  <email>john.smith@acme.org</email>
  <first-name>John</first-name>
  <last-name>Smith</last-name>
  <company-name>Acme Inc.</company-name>
  <position>CEO</position>
  <phone-number>001122334455</phone-number>

  <!-- Use this field if you want to choose your owns ids for your guests. -->
  <uid>9vts5v3nqs</uid>

  <!-- Use this field if you want a message that appear on the iOS device when the guest is checked-in. -->
  <message>Vegan lunch</message>

  <!-- You can pass any other information abotu the guest in this hash. -->
  <guest-metadata type="array">
    <guest-metadatum>
      <name>Has a dog</name>
      <value>Yes</value>
    </guest-metadatum>
    <guest-metadatum>
      <name>Birth year</name>
      <value>1960</value>
    </guest-metadatum>
  </guest-metadata>

  <!-- You can pass an array of access privileges if the guest can access specific check-in points -->
  <access-privileges-attributes type="array">
    <access-privilege>
      <access-once type="boolean">true</access-once>
      <accesspoint-id>{workshop_foo_id}</accesspoint-id>
    </access-privilege>
    <access-privilege>
      <access-once type="boolean">false</access-once>
      <accesspoint-id>{vip_room_id}</accesspoint-id>
    </access-privilege>
  </access-privileges-attributes>
</guest>
```

**Response**

```
<!-- 201 Created -->
<?xml version="1.0" encoding="UTF-8"?>
<guest>
  <_id>50af6426bbfa805f760005ac</_id>
  <badge-completed type="boolean">false</badge-completed>
  <badge-url></badge-url>
  <company-name>Acme Inc.</company-name>
  <email>john.smith@acme.org</email>
  <event-id>{event_id}</event-id>
  <first-name>John</first-name>
  <guest-category-id>{guest_category_id}</guest-category-id>
  <last-name>Smith</last-name>
  <message>Vegan lunch</message>
  <phone-number>001122334455</phone-number>
  <position>CEO</position>
  <rsvp-status>not_replied</rsvp-status>
  <uid>9vts5v3nqs</uid>
  <created-at type="datetime">2012-11-23T11:55:18Z</created-at>
  <updated-at type="datetime">2012-11-23T11:55:18Z</updated-at>
  <access-privileges type="array">
    <access-privilege>
      <!-- [...] -->
    <access-privilege>
    </access-privilege>
      <!-- [...] -->
    </access-privilege>
  </access-privileges>
  <guest-metadata type="array">
    <guest-metadatum>
      <name>Has a dog</name>
      <value>Yes</value>
    </guest-metadatum>
    <guest-metadatum>
      <name>Birth year</name>
      <value>1960</value>
    </guest-metadatum>
  </guest-metadata>
</guest>
```

### Retrieve information about a guest

With the `id` of a guest, you can details about him. We provide 2 optional parameters to pass as query string parameters:

* `guest_metadata=true` will put the `guest_metadata` array in the object returned
* `qrcode_url=true` will put the `qrcode_url` string in the object returned
* `badges=true` will provide an array of the guest badges
* `files=true` will provide an array of attached files

#### JSON

**Request**

```
GET /api/v1/events/{event_id}/guests/{id}.json?auth_token=YOUR_API_TOKEN
GET /api/v1/events/{event_id}/guests/{id}.json?auth_token=YOUR_API_TOKEN&qrcode_url=true
GET /api/v1/events/{event_id}/guests/{id}.json?auth_token=YOUR_API_TOKEN&guest_metadata=true
GET /api/v1/events/{event_id}/guests/{id}.json?auth_token=YOUR_API_TOKEN&files=true
```

**Response**

```
// 200 OK
{
   "_id": "{id}",
   "guest_category_id": "{guest_category_id}",
   "first_name": "John",
   "last_name": "Smith",
   // [...]
}
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}/guests/{id}.xml?auth_token=YOUR_API_TOKEN
GET /api/v1/events/{event_id}/guests/{id}.xml?auth_token=YOUR_API_TOKEN&qrcode_url=true
GET /api/v1/events/{event_id}/guests/{id}.xml?auth_token=YOUR_API_TOKEN&guest_metadata=true
```

**Response**

```
<!-- 200 OK -->
<?xml version="1.0" encoding="UTF-8"?>
<guest>
  <_id>{id}</_id>
  <guest-category-id>{guest_category_id}</guest-category-id>
  <first-name>John</first-name>
  <last-name>Smith</last-name>
  <!-- [...] -->
</guest>
```

### Update a guest

You can add complementary information, update or delete your guests fields. Be careful that these modifications are done in place, not concatenated to existing fields. For instance, if you provide a `guest_metadata` array in your request, they won't be appended to existing entries in the guest, but will replace them.

#### JSON

**Request**

```
PUT /api/v1/events/{event_id}/guests/{id}.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  // Fields to update (View the POST request for a complete list of fields)
}
```

#### Response

```
// 204 No Content
```

#### XML

**Request**

```
PUT /api/v1/events/{event_id}/guests/{id}.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<guest>
  <!-- Fields to update (View the POST request for a complete list of fields) -->
</guest>
```

#### Response

```
<!-- 204 No Content -->
```

### Delete a guest

You can delete guests (which is irreversible).

#### JSON

**Request**

```
DELETE /api/v1/events/{event_id}/guests/{id}.json?auth_token=YOUR_API_TOKEN
```

#### Response

```
// 204 No Content
```

#### XML

**Request**

```
DELETE /api/v1/events/{event_id}/guests/{id}.xml?auth_token=YOUR_API_TOKEN
```

#### Response

```
<!-- 204 No Content -->
```


# Guest Categories

## Guest Categories

Each guest belongs to a guest category. A lot of MobiCheckin settings ar bound to it.

### Retrieve the list of guest categories

#### JSON

**Request**

```
GET /api/v1/events/{event_id}/guest_categories.json?auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
[
  {
    // the first guest category
  },
  {
    // the second guest category
  }
]
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}/guest_categories.xml?auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<?xml version="1.0" encoding="UTF-8"?>
<guest-categories type="array">
  <guest-category>
    <!-- [...] -->
  </guest-category>
  <guest-category>
    <!-- [...] -->
  </guest-category>
</guest-categories>
```

### Get information about a given guest category

If you want to know if the badge is enabled for a guest category, or which check-in points a guest in this guest category can access, use this:

#### JSON

**Request**

```
GET /api/v1/events/{event_id}/guest_categories/{id}.json?auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
{
  "_id": "{id}",
  "badge_enabled": true,
  "badge_qr_code_enabled": true,
  "badge_ecard_in_qr_code_enabled": true,
  "confirmation_email_enabled": false,
  "rsvp_enabled": false,
  "moderated_registrations_enabled": false,
  "wufoo_identity_mapping": { },
  "wufoo_checkin_point_mapping": { },
  "name": "VIPs",
  "event_id": "{event_id}",
  "updated_at": "2012-11-22T15:07:24Z",
  "created_at": "2012-11-22T15:07:24Z",
  "guest_category_accesspoints": [
    {
      "access_once": false,
      "accesspoint_id": "{vip_room_id}",
    }
  ]
}
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}/guest_categories/{id}.xml?auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<guest-category>
  <_id>{id}</_id>
  <badge-enabled type="boolean">true</badge-enabled>
  <badge-qr-code-enabled type="boolean">true</badge-qr-code-enabled>
  <badge-ecard-in-qr-code-enabled type="boolean">true</badge-ecard-in-qr-code-enabled>
  <confirmation-email-enabled type="boolean">false</confirmation-email-enabled>
  <rsvp-enabled type="boolean">false</rsvp-enabled>
  <moderated-registrations-enabled type="boolean">false</moderated-registrations-enabled>
  <wufoo-identity-mapping/>
  <wufoo-checkin-point-mapping/>
  <name>VIPs</name>
  <event-id>{event_id}</event-id>
  <updated-at type="datetime">2012-11-22T15:07:24Z</updated-at>
  <created-at type="datetime">2012-11-22T15:07:24Z</created-at>
  <guest-category-accesspoints type="array">
    <guest-category-accesspoint>
      <access-once type="boolean">false</access-once>
      <accesspoint-id>{vip_room_id}</accesspoint-id>
    </guest-category-accesspoint>
  </guest-category-accesspoints>
</guest-category>
```

### Create a guest category

#### JSON

**Request**

```
POST /api/v1/events/{event_id}/guest_categories.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  // Fields of the guest category to create (see GET request for a complete list)
}
```

**Response**

```
// 201 Created
{
   // Your newly created guest category as a JSON object
}
```

#### XML

**Request**

```
POST /api/v1/{event_id}/guest_category.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<guest-category>
  <!-- Fields of the guest category to create (see GET request for a complete list) -->
</guest-category>
```

**Response**

```
<!-- 201 Created -->
<?xml version="1.0" encoding="UTF-8"?>
<guest-category>
  <!-- Your newly created guest category as a JSON object -->
</guest>
```

### Update a guest category

#### JSON

**Request**

```
PUT /api/v1/events/{event_id}/guest_categories/{id}.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  // Fields of the guest category to update (see GET request for a complete list)
}
```

**Response**

```
// 204 No Content
```

#### XML

**Request**

```
PUT /api/v1/events/{event_id}/guest_categories/{id}.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<guest-category>
  <!-- Fields of the guest category to update (see GET request for a complete list) -->
</guest-category>
```

**Response**

```
<!-- 204 No Content -->
```


# Check-in points

## Check-in points

A check-in point is a place where you will check-in [guests](https://github.com/applidget/mobicheckin-api-documentation/blob/master/sections/guests.md). It can be physical (Entrance, Exit, VIP Room) or represent an activity (Workshop, Conference, ...).

### Retrieve the list of Check-in points

#### JSON

**Request**

```
GET /api/v1/events/{event_id}/accesspoints.json?auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
[
  {
    // the first check-in point
  },
  {
    // the second check-in point
  }
]
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}/accesspoints.xml?auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<?xml version="1.0" encoding="UTF-8"?>
<accesspoints type="array">
  <accesspoint>
    <!-- [...] -->
  </accesspoint>
  <accesspoint>
    <!-- [...] -->
  </accesspoint>
</accesspoints>
```

### Get information about a given check-in point

#### JSON

**Request**

```
GET /api/v1/events/{event_id}/accesspoints/{id}.json?auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
{
  "_id": "{id}",
  "name": "VIP Room",
  "event_id": "{event_id}",
  "created_at": "2012-11-28T10:09:35+01:00",
  "updated_at": "2012-11-28T10:09:35+01:00",
  "guest_category_accesspoints": [
    {
      "access_once": false,
      "guest_category_id": "{vip_guest_category_id}"
    }
  ]
}
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}/accesspoints/{id}.xml?auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<accesspoint>
  <_id>{id}</_id>
  <name>VIP Room</name>
  <event-id>{event_id}</event-id>
  <created-at type="datetime">2012-11-28T09:09:35Z</created-at>
  <updated-at type="datetime">2012-11-28T09:09:35Z</updated-at>
  <guest-category-accesspoints type="array">
    <guest-category-accesspoint>
      <access-once type="boolean">false</access-once>
      <accesspoint-id>{id}</accesspoint-id>
      <guest-category-id>{vip_guest_category_id}</guest-category-id>
    </guest-category-accesspoint>
  </guest-category-accesspoints>
</accesspoint>
```

### Create a new check-in point

#### JSON

**Request**

```
POST /api/v1/{event_id}/accesspoints.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  // Fields of the check-in point to create (see GET request for a complete list)
}
```

**Response**

```
// 201 Created
{
   // Your newly created guest category as a JSON object
}
```

#### XML

**Request**

```
POST /api/v1/{event_id}/accesspoints.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<accesspoint>
  <!-- Fields of the check-in point to create (see GET request for a complete list) -->
</accesspoint>
```

**Response**

```
<!-- 201 Created -->
<?xml version="1.0" encoding="UTF-8"?>
<accesspoint>
  <!-- Your newly created guest category as a JSON object -->
</accesspoint>
```

### Update a check-in point

#### JSON

**Request**

```
PUT /api/v1/events/{event_id}/accesspoints/{id}.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  // Fields of the check-in point to update (see GET request for a complete list)
}
```

**Response**

```
// 204 No Content
```

#### XML

**Request**

```
PUT /api/v1/events/{event_id}/accesspoints/{id}.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<guest-category>
  <!-- Fields of the check-in point to update (see GET request for a complete list) -->
</guest-category>
```

**Response**

```
<!-- 204 No Content -->
```


# Check-ins

## Check-ins

### Retrieve the list of check-ins

MobiCheckin provides a paginaged API to retrieve the list of check-ins of your event. Starts at `page=1`. Paginate every 500 check-ins. If you want to know how many check-ins took place at your event, you should query `GET /api/v1/events/{id}.format` and look at the property `check_in_count`.

#### JSON

**Request**

```
GET /api/v1/events/{event_id}/access_controls.json?page=1&auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
[
  {
    "_id": "{id}",

    // When did the check-in took place? (UTC, use event.timezone for display purposes)
    "access_stamp": "2012-11-26T15:44:44+01:00",

    // The UID found in the scanned QR code. Beware, guest.uid != guest.id
    "guest_uid": "68vju8yxgl",

    // ACCESS_GRANTED = 0, GUEST_UNKNOWN = 1, NOT_AUTHORIZED = 2, TOO_MANY_CHECK_INS = 3
    "access_status": 0,

    // The check-in point where the check-in took place
    "accesspoint_id": "{check_in_point_id}",

    "event_id": "{event_id}",
    "created_at": "2012-11-26T15:44:44+01:00",
    "updated_at": "2012-11-26T15:44:44+01:00"

  },
  {
    "_id": "{id}",
    "access_stamp": "2012-11-26T15:44:44+01:00",
    "guest_uid": "5ch0b30mnc",
    "access_status": 0,
    "accesspoint_id": "{check_in_point_id}",
    "event_id": "{event_id}",
    "created_at": "2012-11-26T15:44:44+01:00",
    "updated_at": "2012-11-26T15:44:44+01:00"
  },
  // ...
]
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}/access_controls.xml?page=1&auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<?xml version="1.0" encoding="UTF-8"?>
<access-controls type="array">
  <access-control>
    <_id>{id}</_id>
    <access-stamp type="datetime">2012-11-26T14:44:44Z</access-stamp>
    <access-status type="integer">0</access-status>
    <guest-uid>68vju8yxgl</guest-uid>
    <accesspoint-id>{check_in_point_id}</accesspoint-id>
    <event-id>{event_id}</event-id>
    <created-at type="datetime">2012-11-26T14:44:44Z</created-at>
    <updated-at type="datetime">2012-11-26T14:44:44Z</updated-at>
  </access-control>
  <access-control>
    <_id>{id}</_id>
    <access-stamp type="datetime">2012-11-26T14:44:44Z</access-stamp>
    <access-status type="integer">0</access-status>
    <guest-uid>5ch0b30mnc</guest-uid>
    <accesspoint-id>{check_in_point_id}</accesspoint-id>
    <event-id>{event_id}</event-id>
    <created-at type="datetime">2012-11-26T14:44:44Z</created-at>
    <updated-at type="datetime">2012-11-26T14:44:44Z</updated-at>
  </access-control>
</access-controls>
```

You can increment the `page` query string parameter until you get an empty array.

### Check-in someone

This is basically the method called by our [iPad guest list app](https://itunes.apple.com/app/mobicheckin/id510125877?mt=8). each time you check-in someone (touching the list or scanning a QR code).

#### JSON

**Request**

```
POST /api/v1/{event_id}/access_controls.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  // Where did the check-in took place?
  "accesspoint_id":    "{check_in_point_id}",

  // For which UID?
  "guest_uid":         "19j38293ju",

  // When (UTC)? If you don't provide this, the server will set the access_stamp to DateTime.now
  "access_stamp":      "2012-11-26T14:44:44Z"
}
```

**Response**

```
// 201 Created
{
   // The check-in created. You can have a look at access_status, if 0 then
   // that was a "green" check-in. Otherwise it's red.
}
```

#### XML

**Request**

```
POST /api/v1/{event_id}/access_controls.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<access-control>
  <!-- Where did the check-in took place? -->
  <accesspoint-id>{check_in_point_id}"</accesspoint-id>

  <!-- For which UID? -->
  <guest-uid>19j38293ju</guest-uid>

  <!-- When (UTC)? If you don't provide this, the server will set the access_stamp to DateTime.now -->
  <access-stamp>2012-11-26T14:44:44Z"</access-stamp>
</access-control>
```

**Response**

```
<!-- 201 Created -->
<?xml version="1.0" encoding="UTF-8"?>
<access-control>
  <!-- The check-in created. You can have a look at access_status, if 0 then
       that was a "green" check-in. Otherwise it's red. -->
</access-control>
```

### Batch insert check-ins

Again, another method used by our [iPad guest list app](https://itunes.apple.com/app/mobicheckin/id510125877?mt=8). when in Offline mode, to sync up check-ins once the network is up again.

You must submit an array of check-ins to create. If all of them are valid, and insertion is completed successfully, you will receive a `201 Created` as answer. But if at least **one** of the check-ins fails to be inserted, then you will receieve a `422 Unprocessable Entity`. In that case, check out the body response, which will be an array of created check-ins an error report (in the same order as the array you submitted in the request payload).

#### JSON

**Request**

```
POST /api/v1/{event_id}/access_controls/batch_create.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
[
  {
    "accesspoint_id":    "{check_in_point_id}",
    "guest_uid":         "19j38293ju",
    // "access_stamp":   "2012-11-26T14:44:44Z"
  },
  {
    "accesspoint_id":    "{check_in_point_id}",
    "guest_uid":         "ieuwh8w7wn",
    // "access_stamp":   "2012-11-26T15:44:44Z"
  }
}
```

**Response**

```
// 201 Created
[
  {
    // The first check-in created
  },
  {
    // The second check-in created
  }
]
```

#### XML

**Request**

```
POST /api/v1/{event_id}/access_controls/batch_create.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<access-controls type="array">
  <access-control>
    <accesspoint-id><{check_in_point_id}/accesspoint-id>
    <guest-uid>19j38293ju</guest-uid>
    <!-- <access-stamp>2012-11-26T14:44:44Z</access-stamp> -->
  </access-control>
  <access-control>
    <accesspoint-id><{check_in_point_id}/accesspoint-id>
    <guest-uid>ieuwh8w7wn</guest-uid>
    <!-- <access-stamp>2012-11-26T15:44:44Z</access-stamp> -->
  </access-control>
</access-controls>
```

**Response**

```
<!-- 201 Created -->
<access-controls type="array">
  <access-control>
    <!-- The first check-in created -->
  </access-control>
  <access-control>
    <!-- The second check-in created -->
  </access-control>
</access-controls>
```

### Delete a check-in

You can delete guests (which is irreversible).

#### JSON

**Request**

```
DELETE /api/v1/{event_id}/access_controls/{id}.json?auth_token=YOUR_API_TOKEN
```

#### Response

```
// 204 No Content
```

#### XML

**Request**

```
DELETE /api/v1/{event_id}/access_controls/{id}.xml?auth_token=YOUR_API_TOKEN
```

#### Response

```
<!-- 204 No Content -->
```


# Signatures

## Signatures

### Retrieve the list of signatures

MobiCheckin provides a paginaged API to retrieve the list of guest signatures of your event. Starts at `page=1`. Paginate every 500 signatures. If you want to know how many signatures were gathered at your event, you should query `GET /api/v1/events/{id}.format` and look at the property `signature_count`.

#### JSON

**Request**

```
GET /api/v1/events/{event_id}/signatures.json?page=1&auth_token=YOUR_API_TOKEN
```

**Response**

```
// 200 OK
[
  {
    "_id": "{id}",

    // When did the signature took place? (UTC, use event.timezone for display purposes)
    "access_stamp": "2012-11-26T15:44:44+01:00",

    // The UID found in the scanned QR code. Beware, guest.uid != guest.id
    "guest_uid": "68vju8yxgl",

    // The check-in point where the signature took place
    "accesspoint_id": "{check_in_point_id}",

    // The SVG representation of the signature
    "points": {
      "width": "276",
      "height": "266",
      "lines": [
        {
          "x2": "250.625",
          "x1": "272",
          "stroke-width": "2.3333332538604736",
          "y2": "65.75",
          "y1": "92"
        },
        {
          "x2": "218.75",
          "x1": "250.625",
          "stroke-width": "1.7055554389953613",
          "y2": "42.375",
          "y1": "65.75"
        },
        // ...
      ]
    }

    "event_id": "{event_id}",
    "created_at": "2012-11-26T15:44:44+01:00",
    "updated_at": "2012-11-26T15:44:44+01:00"
  },
  {
    "_id": "{id}",
    "access_stamp": "2012-11-26T15:44:44+01:00",
    "guest_uid": "5ch0b30mnc",
    "accesspoint_id": "{check_in_point_id}",
    "event_id": "{event_id}",
    "created_at": "2012-11-26T15:44:44+01:00",
    "updated_at": "2012-11-26T15:44:44+01:00"
  },
  // ...
]
```

#### XML

**Request**

```
GET /api/v1/events/{event_id}/signatures.xml?page=1&auth_token=YOUR_API_TOKEN
```

**Response**

```
<!-- 200 OK -->
<?xml version="1.0" encoding="UTF-8"?>
<signatures type="array">
  <signature>
    <_id>{id}</_id>
    <access-stamp type="datetime">2012-11-26T14:44:44Z</access-stamp>
    <guest-uid>68vju8yxgl</guest-uid>
    <accesspoint-id>{check_in_point_id}</accesspoint-id>
    <event-id>{event_id}</event-id>
    <points>
      <width>276</width>
      <height>266</height>
      <lines type="array">
        <line>
          <x1>272</x1>
          <x2>250.625</x2>
          <stroke-width>2.3333332538604736</stroke-width>
          <y1>92</y1>
          <y2>65.75</y2>
        </line>
        <!-- [...] -->
      </lines>
    </points>
    <created-at type="datetime">2012-11-26T14:44:44Z</created-at>
    <updated-at type="datetime">2012-11-26T14:44:44Z</updated-at>
  </signature>
  <signature>
    <!-- [...] -->
  </signature>
</signatures>
```

You can increment the `page` query string parameter until you get an empty array.

### Register a new signature

This is basically the method called by our [iPad guest list app](https://itunes.apple.com/app/mobicheckin/id510125877?mt=8). each time a guest signs on the touch screen.

#### JSON

**Request**

```
POST /api/v1/{event_id}/signatures.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
{
  // Where did the signature took place?
  "accesspoint_id":    "{check_in_point_id}",

  // For which UID?
  "guest_uid":         "19j38293ju",

  // When (UTC)? If you don't provide this, the server will set the access_stamp to DateTime.now
  "access_stamp":      "2012-11-26T14:44:44Z"

  // The SVG representation of the signature
  "points": {
    "width": "276",
    "height": "266",
    "lines": [
      {
        "x2": "250.625",
        "x1": "272",
        "stroke-width": "2.3333332538604736",
        "y2": "65.75",
        "y1": "92"
      },
      {
        "x2": "218.75",
        "x1": "250.625",
        "stroke-width": "1.7055554389953613",
        "y2": "42.375",
        "y1": "65.75"
      },
      // ...
    ]
  }
}
```

**Response**

```
// 201 Created
{
   // The signature has been created.
}
```

#### XML

**Request**

```
POST /api/v1/{event_id}/signatures.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<signature>
  <!-- Where did the signature took place? -->
  <accesspoint-id>{check_in_point_id}"</accesspoint-id>

  <!-- For which UID? -->
  <guest-uid>19j38293ju</guest-uid>

  <!-- When (UTC)? If you don't provide this, the server will set the access_stamp to DateTime.now -->
  <access-stamp>2012-11-26T14:44:44Z"</access-stamp>

  <!-- The SVG representation of the signature -->
  <points>
    <width>276</width>
    <height>266</height>
    <lines type="array">
      <line>
        <x1>272</x1>
        <x2>250.625</x2>
        <stroke-width>2.3333332538604736</stroke-width>
        <y1>92</y1>
        <y2>65.75</y2>
      </line>
      <!-- [...] -->
    </lines>
  </points>
</signature>
```

**Response**

```
<!-- 201 Created -->
<?xml version="1.0" encoding="UTF-8"?>
<signature>
  <!-- The signature -->
</signature>
```

### Batch insert signatures

Again, another method used by our [iPad guest list app](https://itunes.apple.com/app/mobicheckin/id510125877?mt=8). when in Offline mode, to sync up signatures once the network is up again.

You must submit an array of signatures to create. If all of them are valid, and insertion is completed successfully, you will receive a `201 Created` as answer. But if at least **one** of the signatures fails to be inserted, then you will receieve a `422 Unprocessable Entity`. In that case, check out the body response, which will be an array of created signatures an error report (in the same order as the array you submitted in the request payload).

#### JSON

**Request**

```
POST /api/v1/{event_id}/signatures/batch_create.json?auth_token=YOUR_API_TOKEN
Content-Type: application/json; charset=utf-8
```

```
[
  {
    "accesspoint_id":    "{check_in_point_id}",
    "guest_uid":         "19j38293ju",
    "points": "[...]"
  },
  {
    "accesspoint_id":    "{check_in_point_id}",
    "guest_uid":         "ieuwh8w7wn",
    "points": "[...]"
  }
}
```

**Response**

```
// 201 Created
[
  {
    // The first signature created
  },
  {
    // The second signature created
  }
]
```

#### XML

**Request**

```
POST /api/v1/{event_id}/signatures/batch_create.xml?auth_token=YOUR_API_TOKEN
Content-Type: application/xml; charset=utf-8
```

```
<signatures type="array">
  <signature>
    <accesspoint-id>{check_in_point_id}</accesspoint-id>
    <guest-uid>19j38293ju</guest-uid>
    <points><!-- [...] --></points>
  </signature>
  <signature>
    <accesspoint-id>{check_in_point_id}</accesspoint-id>
    <guest-uid>ieuwh8w7wn</guest-uid>
    <points><!-- [...] --></points>
  </signature>
</signatures>
```

**Response**

```
<!-- 201 Created -->
<signatures type="array">
  <signature>
    <!-- The first signature created -->
  </signature>
  <signature>
    <!-- The second signature created -->
  </signature>
</signatures>
```


# Eventmaker Leads API

## Extracting a UID from the QR-Code

Before creating a lead you must first get the unique identifier of a guest (UID). This UID is available in a guest's QR-Code. Eventmaker QR-Codes contains [MeCard](https://en.wikipedia.org/wiki/MeCard_\(QR_code\)) that embeds data on the guest such as:

* the name (N)&#x20;
* the email (EMAIL)&#x20;
* the company name (ORG)&#x20;
* the position (TITLE)&#x20;
* the phone number (TEL)&#x20;
* the guest unique identifier (UID)&#x20;

⚠️Note that only the UID is **mandatory** in the MeCard. It's up to the event organizer for the other fields.

## Create one or more leads

With the UID you can then create the lead on the Eventmaker platform. This is done with the *batch\_create* API that allows you to create one or more leads for an exhibitor. Remember that the exhibitor is authenticated by its *access\_token* :\
\
**Example**

```
curl -X POST -H 'Content-Type: application/json' https://app.eventmaker.io/api/v1/devices/<access_token>/connections/batch_create.json -d @payload.json 
```

*💡replace \<access\_token> with the exhibitor access token*\
\
With *payload.json* :

```
{
    "connections": [
      {
        "guest_uid": "<guest_uid>",
        "author": "Robin"
      },
      {...}
    ]
  }
```

*💡replace \<guest\_uid> with the UID extracted in the MeCard*\
\
In the payload you must at least specify the *guest\_uid* and the *author.*\
\
Sample response :

```
[
    {
	"_id": "5c6c0c0af897748ba97644f2",
	"guest_uid": "guest uid",
	"exhibitor_id": "5c66dfdcf89774219591baa6",
	"updated_at": "2019-02-19T14:00:42.711Z",
	"created_at": "2019-02-19T14:00:42.672Z",
	"author": "Robin",
	"comments": [],
	"exhibitor_products": []
    },
    {...}
]
```

You can ignore the *comments* and *exhibitor\_products* fields.

## Get leads details

Creating a lead doesn't give you much information. You can get more data by requesting the *lead\_guests* API which returns a list of fields. These fields are related to the event and are whitelisted by the event organizer, meaning that they decide which fields get returned by this API.\
\
**Example**&#x20;

```
curl -X GET -H 'Content-Type: application/json' "https://app.eventmaker.io/api/v1/lead_guests/<guest_uid>.json?access_token=<access_token>" 
```

*💡replace \<access\_token> with the exhibitor access token*\
*💡replace \<guest\_uid> with the UID extracted in the MeCard*\
\
Sample response

```
{
    "email": "maria.hamilton@gmail.com",
    "first_name": "Maria",
    "last_name": "Hamilton", 
    "company_name": "Apple",
    "uid": "S61LMJY"
}
```

## Working with ciphered QR-Codes 🔐

Some events require ciphered QR-Codes. For these events, your app will need to get back a ciphering key and IV to decipher QR-Code before following the flow described previously.\
\
When QR-Code ciphering is enabled on an event you need to get back the ciphering key and IV using this API :

```
curl -X PUT -d '{ "signature": <signature>}' -H 'Content-Type: application/json' "https://app.eventmaker.io/api/v1/events/<event_id>/exhibitors/<access_token>/activate_license.json" 
```

*💡replace \<signature> with the signature (see below how to generate the signature)*\
*💡replace \<event\_id> with the event\_id*\
*💡replace \<access\_token> with the exhibitor access\_token*\
\
Sample response (when QR-Code ciphering is not enabled) :

```
{
  "qr_code_ciphering_enabled":false,
  "qr_code_ciphering_key":null,
  "qr_code_ciphering_iv":null,
  "app":"Leads Android"
}
```

Sample response (when QR-Code ciphering is enabled) :

```
{
  "qr_code_ciphering_enabled":true,
  "qr_code_ciphering_key":"kHxOFKTAq7xutc8MnAlmrUrQNAW/xXM8V1X5VgB444Q=",
  "qr_code_ciphering_iv":"JWEVPt7lhlNcnfNNyVtnOQ==",
  "app":"Leads Android"
}
```

If signature is incorrect you will get a 401 status code, 200 otherwise.\
\
**Computing the signature 🔏**\
First your app need to be registered into Eventmaker (contact us) and we will deliver you a secret.\
Then the *signing\_key* must be the concatenation of the secret and the *event\_id* :&#x20;

```
<secret><event_id>
```

Finally you need to sign the exhibitor access token with the signing key using *hmac-sha256* :

```
signing_key = <secret><event_id>
signature = HmacSha256(access_token, signing_key)
```

*Sample code iOS (objective-c) :*

```
#import <CommonCrypto/CommonHMAC.h>
[...]

NSString *key = [NSString stringWithFormat:@"%@%@", kSigningSecret, eventId];

const char *cKey  = [key cStringUsingEncoding:NSASCIIStringEncoding];
const char *cData = [toSign cStringUsingEncoding:NSASCIIStringEncoding];
unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH];
CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC);
NSData *HMACData = [NSData dataWithBytes:cHMAC length:sizeof(cHMAC)];

const unsigned char *buffer = (const unsigned char *)[HMACData bytes];
NSMutableString *signature = [NSMutableString stringWithCapacity:HMACData.length * 2];
for (int i = 0; i < HMACData.length; ++i){
  [signature appendFormat:@"%02x", buffer[i]];
}
```

*Sample code Android (java) :*

```
String signingKey = signingSecret + eventIdK;
String toSign = "...";

Mac hmacSHA256 = Mac.getInstance("HmacSHA256");
hmacSHA256.init(new SecretKeySpec(signingKey.getBytes(), "HmacSHA256"));
byte[] result = hmacSHA256.doFinal(toSign.getBytes());
StringBuilder sb = new StringBuilder(result.length * 2);
for(byte b: result)
  sb.append(String.format("%02x", b));
String signature = sb.toString();
```

**Deciphering QR-Code**\
When Eventmaker QR-Code are ciphered, their content will look like something:

```
E:somecipheredunreadablestuff
```

When you scan a QR-Code you should always look for the prefix *E:* and if found, you will need to decipher the content. The content is ciphered with AES 256 using the block cipher mode CBC. Keys, IV and real mecard content (everything after *E:*) is base 64 encoded and will need to be decoded first (before deciphering process).\
\
*⚠️ensure your app works with both ciphered and not ciphered QR-Code*\
\
*Sample code iOS (objective-c) :*

```
NSData *data = [[NSData alloc] initWithBase64EncodedString:content options:NSDataBase64DecodingIgnoreUnknownCharacters];
NSData *keyData = [[NSData alloc] initWithBase64EncodedString:key options:0];
NSData *ivData = [[NSData alloc] initWithBase64EncodedString:iv options:0];
    
CCCryptorRef cryptor = NULL;
CCCryptorStatus status = CCCryptorCreateWithMode(kCCDecrypt, kCCModeCBC, kCCAlgorithmAES, kCCOptionPKCS7Padding, ivData.bytes, keyData.bytes, kCCKeySizeAES256, NULL, 0, 0, 0, &cryptor);
          
size_t bufsize = CCCryptorGetOutputLength(cryptor, (size_t)[data length], true);
void * buf = malloc(bufsize);
size_t bufused = 0;
size_t bytesTotal = 0;
    
status = CCCryptorUpdate(cryptor, [data bytes], (size_t)[data length], buf, bufsize, &bufused);
bytesTotal += bufused;
      
status = CCCryptorFinal(cryptor, buf + bufused, bufsize - bufused, &bufused);      
bytesTotal += bufused;
    
NSData *decryptedData = [NSData dataWithBytesNoCopy:buf length:bytesTotal];
free(buf);
NSString *decipheredContent = [NSString stringWithUTF8String:[decryptedData bytes]];
```

*Sample code Android (java) :*

```
String contentWithoutPrefix = content.substring("E:".length());
byte[] key = Base64.decode(qrCodeCipheringKey, Base64.DEFAULT);
byte[] iv = Base64.decode(qrCodeCipheringIv, Base64.DEFAULT);
byte[] contentData = Base64.decode(contentWithoutPrefix, Base64.DEFAULT);

SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
IvParameterSpec ivSpec = new IvParameterSpec(iv)
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
String decodedContent = new String(cipher.doFinal(contentData));
```


# Creating an OAuth App

Eventmaker allows you to setup a [white label](https://en.wikipedia.org/wiki/White-label_product) [Single Sign On (SSO)](https://en.wikipedia.org/wiki/Single_sign-on).

## What is a SSO ?

SSO is an authentication / authorization flow through which a user can log into multiple services using the same credentials.\
\
Setting up a SSO make Eventmaker the main component for your **authentication** / **authorisation** system. We believe it's the perfect place since Eventmaker is where data of your contacts are stored.

When you build a website with Eventmaker it can easily become a service accessible through your SSO. Hence your contacts can connect to the websites of each one of your events using the same credentials and get back all their data of their previous registration(s).

The goal of this article is to get you started delegating the authentication and authorization of your **own website** (not one built with Eventmaker) to your Eventmaker powered SSO.

## Enabling the SSO of your Eventmaker account

This part is not accessible yet and must be configured by an Eventmaker admin. The outputs is a sign-in / register system on top of your Eventmaker contacts, that is accessible on your own domain and with your own branding.\
\
The **authorisation** part of an Eventmaker SSO use the [OAuth 2 protocol](https://oauth.net/2/).

## Web application flow

The flow to authorize contacts for your app is:

* 1️⃣From your app, contacts are redirected to request their identity on your SSO
* 2️⃣Contacts are redirected back to your site by Eventmaker
* 3️⃣You app accesses the Eventmaker API with the contact's access token and get back the contact data

### Registering an OAuth app

Before starting, you must register your app and provide a **name** and one or more **redirection URLs** (used in step 2 of the flow). Once done, you will get an application **UID** and a **secret** that will be used during the authorization flow.

This step is also only available to Eventmaker admins for now, so please contact us 😊.

### 1. Request one of your Eventmaker contact identity

```
GET https://<sso-domain>/oauth/authorize
```

Parameters:

* client\_id: the **UID** of your app you received from Eventmaker when you registered your app.
* redirect\_uri: the URL in your application where users will be sent after authorization. Must matches with one of the redirection URLs used when you registered your app.
* response\_type: code
* scope: public (the only scope currently available)
* state: an unguessable random string. It is used to protect against cross-site request forgery attacks.
* locale: optional, the locale to use (en, fr, es, de, pt, it + potential new languages supported by Eventmaker). The user will be able to change it once on the sign in interface.

Example:

```
http://my-sso.com/oauth/authorize?client_id=ccd2524cf6d3e8feb457dd912cd73f07c80a311875bb3fb0c776a29301626bc0&redirect_uri=https%3A%2F%2Fmy-app.com%2Fauth%2Foauth%2Fcallbac&scope=public&state=b6c7d807b564af9e63da5ce1484403d9
```

This will ask the contact to **authenticate** on your SSO and allow your app to access his data.

### 2. Users are redirected back to your site

If the contact accepts your request, your SSO redirects back to your site with a temporary code in a code parameter as well as the state you provided in the previous step in a state parameter. If the states don't match, then a third party created the request, and you should **abort the process**.

Exchange this code for an access token:

```
POST https://<sso-domain>/oauth/token
```

Parameters:

* client\_id: the **UID** of your app you received from Eventmaker when you registered your app.
* client\_secret: the **secret** of your app you received from Eventmaker when you registered your app.
* code: the code you received as a response to step 1️⃣.
* redirect\_uri: the URL in your application where users will be sent after authorization.
* code\_verifier: an unguessable random string
* grant\_type: authorization\_code

Response (JSON):

```
{
   "access_token": "d77f57f68cef725e2dba1fd106e237f027283c42f583c13bf308c65426fe51ab",
   "token_type": "Bearer",
   "expires_in": 7200,
   "scope": "public",
   "created_at": 1558633788
}
```

### 3. Use the access token to access the API

The access token allows you to make requests to the API on behalf of a contact.

```
Authorization: Bearer OAUTH-TOKEN
GET https://<sso-domain>/api/v1/me
```

Example using curl:

```
curl -H "Authorization: Bearer <token>" http://<sso-domain>/api/v1/me.json
```

This API call will provide contact data (email, first\_name, last\_name and all the fields you defined in Eventmaker).

## Sample application

We have setup a sample Ruby/Sinatra application that uses an Eventmaker powered SSO: <https://github.com/applidget/eventmaker-sso-client-demo>. You can test it [here](https://eventmaker-sso-client-demo.herokuapp.com/) (⚠️ free Heroku app, might take a few seconds to wake up). Read the sources to see how everything discussed previously can be implemented.

Note that there is probably an existing library to help you with this integration in your language. In the sample app we are using the [oauth2 gem](https://github.com/oauth-xx/oauth2).

## Working locally

The OAuth protocol requires secure endpoints (for the provider and the client), you will then need to have an HTTPS server running on your computer. The easiest way to achieve this is to use [serveo.net](https://serveo.net/). This will allow you to expose in one command line your locally running server to the internet and get a secure endpoint with it.

## Handling sign out

When signing out, the contact will always be signed in on the SSO, so signing-in again will automatically trigger the success callback and the contact will be automatically connected. To trigger a sign out from the SSO :

```
GET https://<sso-domain>/contacts/sign_out
```

Parameters:

* redirect\_uri: the URL in your application where users will be sent after sign out.


# Register your application on Zoho


# Enregistrer votre application sur zoho FR

Zoho CRM API est authentifié avec OAuth2 standards, il est donc obligatoire d'enregistrer et d'authentifier votre app client avec Zoho.&#x20;

## Navigateur

Pensez à vous déconnecter d'un autre compte Zoho ou à naviguer en privé avant d'opérer à l'enregistrement de l'application

## Pour s'enregistrer&#x20;

* Aller sur le site [***accounts.zoho.com/developerconsole***](https://api-console.zoho.com/)
* Cliquer sur **Add client ID**&#x20;

![Add client](https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MQl5JLeDzGextEOcsRq%2F-MQl7B29GtXuznLSD6E4%2FCapture%20d%E2%80%99e%CC%81cran%202021-01-11%20a%CC%80%2011.44.28.png?alt=media\&token=c403ae64-3363-4e42-8642-e6b22395e584)

* Sélectionner **Server-based Applications**

![](https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MQl5JLeDzGextEOcsRq%2F-MQlA0wd-BfFVKqvlC91%2FCapture%20d%E2%80%99e%CC%81cran%202021-01-11%20a%CC%80%2011.53.27.png?alt=media\&token=3b8b3fd7-4b7b-4367-92b1-a11849ce2e78)

* Remplir les champs suivant :&#x20;
  * **Client Name : Eventmaker**&#x20;
  * **Client Domain : <https://app.eventmaker.io>**
  * **Authorized Redirect ULR :** [**https://app.eventmaker.io/receive\_zoho\_grant\_token**](https://app.eventmaker.io/receive_zoho_grant_token)

<div align="center"><img src="https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MQl5JLeDzGextEOcsRq%2F-MQlCJLb7lSj1bBEsW8d%2FCapture%20d%E2%80%99e%CC%81cran%202021-01-11%20a%CC%80%2011.54.12.png?alt=media&amp;token=a37f3985-d1ca-4674-a823-1174a95b9801" alt=""></div>

* Cliquer sur **CREATE**
* Cliquer sur votre application afin de l'éditer et aller dans **Client secret**

![](https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MQl5JLeDzGextEOcsRq%2F-MQlGhy15y3ICmfzC9rq%2FCapture%20d%E2%80%99e%CC%81cran%202021-01-11%20a%CC%80%2012.47.09.png?alt=media\&token=d7def5dd-31b5-48f2-a130-082d06bc2fe1)

* Copier le **Client ID** et le **Client Secret**&#x20;
* Aller dans **Settings** et cocher la case suivante avant de vous rendre sur Eventmaker

![](https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MQppDBaERq7B5PS_Wrk%2F-MQpqG8tDIH8BsSZqJB6%2FCapture%20d%E2%80%99e%CC%81cran%202021-01-12%20a%CC%80%2010.06.46.png?alt=media\&token=8c86071b-962c-4f62-b2e9-564b3b7b63e6)

## Aller dans la plateforme Eventmaker afin d'autoriser cette application&#x20;

* Aller dans la **catégorie** de votre choix et ajouter le bloc **Facturation zoho**
* Sélectionner l'api v2 de l'authentification Zoho
* Coller le **Client ID** et le **Client Secret** précédemment copié dans ZOHO

![](https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MQl5JLeDzGextEOcsRq%2F-MQlIYoadUzkOsEGsyP7%2FCapture%20d%E2%80%99e%CC%81cran%202021-01-11%20a%CC%80%2012.55.49.png?alt=media\&token=5361d031-cacb-443c-8a58-59ce776f12f1)

* Cliquer sur **Générer un nouveau token** afin d'accepter que Eventmaker accède à vos données Zoho

![après avoir cliqué sur le bouton le token se générera automatiquement sur EM](https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MQl5JLeDzGextEOcsRq%2F-MQlMSKpAO4yddTLPq8-%2FCapture%20d%E2%80%99e%CC%81cran%202021-01-11%20a%CC%80%2013.13.19.png?alt=media\&token=3c4377f0-d884-443a-915a-f67e6685b1b9)

* **Accepter** avant d'être redirigé sur Eventmaker&#x20;

![](https://1581237976-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPmSp5tlnYwHa_JNzLf%2F-MQl5JLeDzGextEOcsRq%2F-MQlMrOZz4NLulQ5dD9H%2FCapture%20d%E2%80%99e%CC%81cran%202021-01-11%20a%CC%80%2013.10.47.png?alt=media\&token=95b20255-1eca-49a9-b84c-feef433b4e8b)

* Enregistrer vos modifications sur Eventmaker et vous avez terminé&#x20;

⚠️ Vous pouvez copier/ coller votre **Client ID, Client Secret et votre Token** sur les **autres catégories** de votre évènement afin d'éviter de répéter tout ce process.&#x20;


# Connect Eventmaker to hundreds of other apps with Zapier

[Zapier](https://zapier.com/zapbook/APP/) lets you connect Eventmaker to 1,000+ other web services. Automated connections called Zaps, set up in minutes with no coding, can automate your day-to-day tasks and build workflows between apps that otherwise wouldn't be possible.

Each Zap has one app as the **Trigger**, where your information comes from and which causes one or more **Actions** in other apps, where your data gets sent automatically.&#x20;

#### Getting Started with Zapier <a href="#h_e248754b4f" id="h_e248754b4f"></a>

Sign up for a free [Zapier](https://zapier.com/zapbook/APP) account, from there you can jump right in. To help you hit the ground running, you can find a list of popular pre-made Zaps in the "Connect" section in your event configuration.

#### How do I connect APP to Zapier? <a href="#h_daa564adbf" id="h_daa564adbf"></a>

1. Log in to your [Zapier account](https://zapier.com/sign-up) or create a new account.
2. Navigate to "Connected Accounts" from the top menu bar.
3. Now click on "Connect new account" and search for "APP"
4. Use your credentials to connect your APP account to Zapier.
5. Once that's done you can start creating an automation! Use a pre-made Zap or create your own with the Zap Editor. Creating a Zap requires no coding knowledge and you'll be walked step-by-step through the setup.&#x20;
6. Need inspiration? See everything that's possible with [APP and Zapier](https://zapier.com/zapbook/eventmaker).


# Campaign email

Eventmaker comes with a powerful language editor for your custom campaign emails. It’s derived from the markup language [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers). This page shows you how you can use the custom Eventmaker liquid tags and variables to build your campaign emails.

## Liquid variables

Here are the variables available to use in [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) for the campaign emails :

### {{ receiver }}

```
{
                      "_id" => "54da2651826b77b3770000e6",
               "created_at" => nil,
               "updated_at" => nil,
               "deleted_at" => nil,
                      "uid" => "TESTUID",
                "order_uid" => nil,
                    "email" => "john.smith@acme.com",
               "first_name" => "John",
                "last_name" => "Smith",
                 "position" => "Chief Technical Officer",
             "company_name" => "Acme Company Inc.",
             "phone_number" => "999 888 777",
                  "message" => nil,
          "invitation_code" => nil,
       "person_parent_type" => nil,
      "person_parent_field" => nil,
         "person_parent_id" => nil,
    "facebook_profile_link" => nil,
                 "event_id" => nil,
        "guest_category_id" => nil,
              "blacklisted" => false,
         "blacklist_reason" => nil,
               "registered" => false,
         "campaign_list_id" => nil,
           "guest_metadata" => {}
}
```

### {{ event }}

```
{
             "title" => "New Year's Eve 2015",
         "organizer" => "Eventmaker Developers",
       "description" => "This event has not begun yet",
          "timezone" => "Paris",
                "id" => "5408886b4f6905cb83000001",
             "photo" => nil,
    "photo_original" => nil,
        "start_date" => Wed, 31 Dec 2014 22:00:00 CET +01:00,
          "end_date" => Thu, 01 Jan 2015 07:00:00 CET +01:00
}
```

### {{ email\_url }}

```
"#fake_preview_email_url"
```

## Liquid tags

Along with the native liquid tags, some new ones have been made available for you to build your custom campaign emails.

### Create a new guest

Use this tag to create a new guest. The identifier below must be replaced with a guest category id.

```
{% registration_form_link "5408886b4f6905cb83000023" %}
```

**Important :**

* Will be not possible to use unique email in the event, or in the same category (invitee email already exists)
* You should be careful if you do a second emailing on the same database, because your invitee is still in your to\_be\_invited segment
* You can registered several guests
* Do not prefill the UID in your form

### Convert a guest

Use this tag to convert a guest. You can also transfer it to another category with the extension field below

```
{{ guest.registration_form_url }}&guest_category_id=5408886b4f6905cb83000023
```

**Important :**

* The guest is converted. It is not anymore in invitee
* You can registered only one guest

### Website

When using Eventmaker Website feature, you can offer your imported guests to register directly into your website with the following tag :

```
{% website_url 'registration' %}
```

With `registration` being the path to your website page. You can also use this tag to point to any of your website pages that don’t contain a registration form.

### Inline image url

inline attach in the mail the image passed as parameter.

```
<img src="{%inline_image_url "url_of_the_image" %}" />
```


# Confirmation email

Eventmaker comes with a powerful language editor for your custom emails. It’s derived from the markup language [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers). This page shows you how you can use the custom Eventmaker liquid tags and variables to build your confirmation emails.

## Liquid variables

Here are the variables available to use in [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) for the custom confirmation emails :

### {{ event }}

```
{
             "title" => "New Year's Eve 2015",
         "organizer" => "Eventmaker Developers",
       "description" => "This event has not begun yet",
          "timezone" => "Paris",
                "id" => "5408886b4f6905cb83000001",
             "photo" => nil,
    "photo_original" => nil,
        "start_date" => Wed, 31 Dec 2014 22:00:00 CET +01:00,
          "end_date" => Thu, 01 Jan 2015 07:00:00 CET +01:00
}
```

### {{ guest\_category }}

```
{
                 "name" => "Visitor",
        "badge_enabled" => true,
               "traits" => {},
                "price" => 0.0,
                  "vat" => 0.0,
    "price_without_vat" => 0.0,
       "price_with_vat" => 0.0,
           "vat_amount" => 0.0
}
```

### {{ guest }}

```
{
                                    "_id" => "54da19ae826b77b377000047",
                             "created_at" => nil,
                             "updated_at" => nil,
                             "deleted_at" => nil,
                                    "uid" => "TESTUID",
                              "order_uid" => nil,
                                  "email" => "john.smith@acme.com",
                             "first_name" => "John",
                              "last_name" => "Smith",
                               "position" => "Chief Technical Officer",
                           "company_name" => "Acme Company Inc.",
                           "phone_number" => "999 888 777",
                                "message" => nil,
                        "invitation_code" => nil,
                             "utm_source" => nil,
                             "utm_medium" => nil,
                           "utm_campaign" => nil,
                     "person_parent_type" => nil,
                    "person_parent_field" => nil,
                       "person_parent_id" => nil,
                  "facebook_profile_link" => nil,
                               "event_id" => "51f64612112710982f0006e9",
                      "guest_category_id" => "5419a085826b77608500000a",
                     "payment_promo_code" => nil,
    "send_email_on_guest_category_change" => nil,
                "confirmation_email_sent" => false,
                   "disable_update_email" => false,
                 "wait_for_linked_people" => false,
                            "rsvp_status" => "not_replied",
            "vip_notification_on_checkin" => nil,
                              "showed_up" => nil,
               "green_access_control_ids" => nil,
                 "red_access_control_ids" => nil,
                                     "id" => "54da19ae826b77b377000047",
                         "guest_metadata" => {
                                     "city" => "Paris",
                                  "country" => "France"
                              },
                                    "vat" => 0.0,
                        "unsubscribe_url" => "url to cancel event registration",
                              "badge_url" => "#fake_preview_badge_url",
                        "badge_completed" => false,
                      "access_privileges" => [],
                           "person_files" => [],
                                "tickets" => [],
                              "documents" => [],
                    "discount_percentage" => 0.0,
                "purchase_total_with_vat" => 0.0,
             "purchase_total_without_vat" => 0.0,
                           "purchase_vat" => 0.0,
                         "payment_status" => "FREE",
                       "payment_currency" => "EUR",
                        "last_cart_total" => 0.0,
          "last_cart_total_excluding_vat" => 0.0,
               "last_cart_payment_status" => "FREE",
                 "payment_transaction_id" => nil,
                  "payment_merchant_type" => nil,
                           "payment_date" => nil,
                        "payment_attempt" => 0,
                 "payment_gateway_status" => nil,
             "payment_wufoo_sync_blocked" => false,
                          "person_parent" => nil,
                                  "carts" => []
}
```

### {{ carts }}

```
  [
    {
      "total_incl_vat" => 0,
      "total_excl_vat" => 0,
      "adjustment" => 0,
      "balance" => 0,
      "has_promo_code" => false,
      "payment_currency" => "EUR",
      "payment_status" => "FREE",
      "payment_transaction_id" => "",
      "payment_merchant_type" => "",
      "payment_date" => "",
      "payment_attempt" => 0,
      "payment_gateway_status" => 0,
      "zoho_invoice_reference" => "",
      "zoho_invoice_id" => ""
      "cart_items" => []
    },
    {
      "total_incl_vat" => 0,
      "total_excl_vat" => 0,
      "adjustment" => 0,
      "balance" => 0,
      "has_promo_code" => false,
      "payment_currency" => "EUR",
      "payment_status" => "FREE",
      "payment_transaction_id" => "",
      "payment_merchant_type" => "",
      "payment_date" => "",
      "payment_attempt" => 0,
      "payment_gateway_status" => 0,
      "zoho_invoice_reference" => "",
      "zoho_invoice_id" => ""
      "cart_items" => []
    }
  ]
```

### {{ cart\_items }}

```
[
  {
    "price_incl_vat" => 0,
    "price_excl_vat" => 0,
    "vat" => 0,
    "promo_percent" => 0,
    "label" => "",
    "description" => ""
  },
  {
    "price_incl_vat" => 0,
    "price_excl_vat" => 0,
    "vat" => 0,
    "promo_percent" => 0,
    "label" => "",
    "description" => ""
  }
]
```

### {{ access\_privileges }}

```
[
    {
        "max_allowed_accesses" => -1,
            "accesspoint_name" => "Atelier 1",
              "accesspoint_id" => "545b4034826b774f9d0000ae",
           "price_without_vat" => 0.0,
                  "vat_amount" => 0.0,
              "price_with_vat" => 0.0,
                 "access_once" => false,
          "accesspoint_traits" => {
                           "type" => "atelier",
                          "label" => "Atelier Peinture"
                      }
    },
    {
        "max_allowed_accesses" => 1,
            "accesspoint_name" => "Atelier 2",
              "accesspoint_id" => "545b403f826b774f9d0000b9",
           "price_without_vat" => 0.0,
                  "vat_amount" => 0.0,
              "price_with_vat" => 0.0,
                 "access_once" => true,
          "accesspoint_traits" => {
                          "type" => "atelier"
                      }
    }
]
```

**Example**

```
  
    {% if guest.access_privileges %}
    <h2>Your conferences</h2>
    <h3>Tuesday</h3>
    <ul>
      {% for point in guest.access_privileges %}
        {% if point.accesspoint_traits.jour == "Tuesday" %}
          <li>{{ point.accesspoint_traits.label }}</li>
        {% endif %}
      {% endfor %}
    </ul>
    <h3>Wednesday</h3>
    <ul>
      {% for point in guest.access_privileges %}
        {% if point.accesspoint_traits.jour == "Wednesday" %}
          <li>{{ point.accesspoint_traits.label }}</li>
        {% endif %}
      {% endfor %}
    </ul>
    {% endif %}
```

### {{ linked\_guests }}

```
[]
```

**Example**

```
  {% for lg in linked_guests %}
    {% for access_privilege in lg.access_privileges %}
      {% if access_privilege.accesspoint_traits.jour == "Monday" %}
        <li>{{ access_privilege.accesspoint_traits.label }}</li>
      {% endif %}
    {% endfor %}
  {% endfor %}

  {% for lg in linked_guests %}
    Name : {{lg.first_name}}
    Invited by : {{lg.person_parent.first_name}}
  {% endfor %}
```

### {{ email\_url }}

```
"#fake_preview_email_url"
```

### {{ edit\_form\_url }}

```
"#fake_edit_form_url"
```

### {{ is\_update }}

```
false
```

### {{ qrcode\_image\_tag }}

```
"<img src=\"http://apps.eventmaker.io/en/events/51f64612112710982f0006e9/guest_categories/5419a085826b77608500000a/email_fake_qrcode\" alt=\"QR Code\" width=\"240\" style=\"image-rendering: -webkit-optimize-contrast; image-rendering: -moz-crisp-edges; image-rendering: -o-crisp-edges; image-rendering: crisp-edges; -ms-interpolation-mode: nearest-neighbor\" />"
```

### {{ qrcode\_image\_url }}

```
"http://apps.eventmaker.io/en/events/51f64612112710982f0006e9/guest_categories/5419a085826b77608500000a/email_fake_qrcode"
```

## Liquid tags

Along with the native liquid tags, some new ones have been made available for you to build your custom confirmation email.

### Documents

The identifier must be replaced with a document template id.

```
<a href="{% document_url '542c2c7c826b777071000001' %}">Document</a>
```

### Badges

The identifier must be replaced with a badge template id.

```
<a href="{% badge_url '5419a085826b77608500000d' %}">A4</a>
```

### inline image url

inline attach in the mail the image passed as parameter.

```
<img src="{%inline_image_url "url_of_the_image" %}" />
```

## Email Object

The email object supported Liquid language. You can use condition in it.

```
{% if guest.payment_merchant_type == 'ogone' %}You have pay online{% else %}You do not pay online{% endif %}
```


# Confirmation Page

Eventmaker comes with a powerful language editor for your custom registration form. It’s derived from the markup language [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers). This page shows you how you can use the custom Eventmaker liquid tags and variables to build your registration form. Please note that this form will embed the [Bootstrap CSS](http://twitter.github.com/bootstrap/base-css.html#forms) so that you can use any of the fancy classes on your fields.

## Liquid variables

Here are the variables available to use in [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) for the custom Registration Page :

### {{ standard\_confirmation\_options\_form }}

this tag display :

* donwload badge button if ebadge is enabled
* new registration button
* Twitter share button
* Facebook share button
* **Linkedin share button**

  Each button can be added or removed in the confirmation page configuration.

```
![Result](http://i.imgur.com/hgKa4C7.png)
```


# Direct message

Eventmaker comes with a powerful language editor for your direct message. It’s derived from the markup language [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers). This page shows you how you can use the custom Eventmaker liquid tags and variables to build your direct message.

## Liquid variables

Here are the variables available to use in [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) for the direct message :

### {{ direct\_mesage }}

```
{
      "title" => "Out of the event's scope",
       "body" => "We are sorry but you cannot come to our event",
    "default" => boolean
}
```

### {{ event }}

```
{
             "title" => "New Year's Eve 2015",
         "organizer" => "Eventmaker Developers",
       "description" => "This event has not begun yet",
          "timezone" => "Paris",
                "id" => "5408886b4f6905cb83000001",
             "photo" => nil,
    "photo_original" => nil,
        "start_date" => Wed, 31 Dec 2014 22:00:00 CET +01:00,
          "end_date" => Thu, 01 Jan 2015 07:00:00 CET +01:00
}
```

### {{ guest }}

```
{
                                    "_id" => "54da19ae826b77b377000047",
                             "created_at" => nil,
                             "updated_at" => nil,
                             "deleted_at" => nil,
                                    "uid" => "TESTUID",
                              "order_uid" => nil,
                                  "email" => "john.smith@acme.com",
                             "first_name" => "John",
                              "last_name" => "Smith",
                               "position" => "Chief Technical Officer",
                           "company_name" => "Acme Company Inc.",
                           "phone_number" => "999 888 777",
                                "message" => nil,
                        "invitation_code" => nil,
                             "utm_source" => nil,
                             "utm_medium" => nil,
                           "utm_campaign" => nil,
                     "person_parent_type" => nil,
                    "person_parent_field" => nil,
                       "person_parent_id" => nil,
                  "facebook_profile_link" => nil,
                               "event_id" => "51f64612112710982f0006e9",
                      "guest_category_id" => "5419a085826b77608500000a",
                     "payment_promo_code" => nil,
    "send_email_on_guest_category_change" => nil,
                "confirmation_email_sent" => false,
                   "disable_update_email" => false,
                 "wait_for_linked_people" => false,
                            "rsvp_status" => "not_replied",
            "vip_notification_on_checkin" => nil,
                              "showed_up" => nil,
               "green_access_control_ids" => nil,
                 "red_access_control_ids" => nil,
                                     "id" => "54da19ae826b77b377000047",
                         "guest_metadata" => {
                                     "city" => "Paris",
                                  "country" => "France"
                              },
                                    "vat" => 0.0,
                              "badge_url" => "#fake_preview_badge_url",
                        "badge_completed" => false,
                      "access_privileges" => [],
                           "person_files" => [],
                                "tickets" => [],
                              "documents" => [],
                    "discount_percentage" => 0.0,
                "purchase_total_with_vat" => 0.0,
             "purchase_total_without_vat" => 0.0,
                           "purchase_vat" => 0.0,
                         "payment_status" => "FREE",
                       "payment_currency" => "EUR",
                        "last_cart_total" => 0.0,
          "last_cart_total_excluding_vat" => 0.0,
               "last_cart_payment_status" => "FREE",
                 "payment_transaction_id" => nil,
                  "payment_merchant_type" => nil,
                           "payment_date" => nil,
                        "payment_attempt" => 0,
                 "payment_gateway_status" => nil,
             "payment_wufoo_sync_blocked" => false,
                          "person_parent" => nil
}
```


# Document template

Eventmaker comes with a powerful language editor for your custom documents. It’s derived from the markup language [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers). This page shows you how you can use the custom Eventmaker liquid tags and variables to build your document templates.

## Liquid variables

Here are the variables available to use in [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) for the document templates :

### {{ document\_template }}

```
{
    "name" => "Document"
}
```

### {{ event }}

```
{
             "title" => "New Year's Eve 2015",
         "organizer" => "Eventmaker Developers",
       "description" => "This event has not begun yet",
          "timezone" => "Paris",
                "id" => "5408886b4f6905cb83000001",
             "photo" => nil,
    "photo_original" => nil,
        "start_date" => Wed, 31 Dec 2014 22:00:00 CET +01:00,
          "end_date" => Thu, 01 Jan 2015 07:00:00 CET +01:00
}
```

### {{ guest\_category }}

```
{
                 "name" => "Visitor",
        "badge_enabled" => true,
               "traits" => {},
                "price" => 0.0,
                  "vat" => 0.0,
    "price_without_vat" => 0.0,
       "price_with_vat" => 0.0,
           "vat_amount" => 0.0
}
```

### {{ guest }}

```
{
                                    "_id" => "54da19ae826b77b377000047",
                             "created_at" => nil,
                             "updated_at" => nil,
                             "deleted_at" => nil,
                                    "uid" => "TESTUID",
                              "order_uid" => nil,
                                  "email" => "john.smith@acme.com",
                             "first_name" => "John",
                              "last_name" => "Smith",
                               "position" => "Chief Technical Officer",
                           "company_name" => "Acme Company Inc.",
                           "phone_number" => "999 888 777",
                                "message" => nil,
                        "invitation_code" => nil,
                             "utm_source" => nil,
                             "utm_medium" => nil,
                           "utm_campaign" => nil,
                     "person_parent_type" => nil,
                    "person_parent_field" => nil,
                       "person_parent_id" => nil,
                  "facebook_profile_link" => nil,
                               "event_id" => "51f64612112710982f0006e9",
                      "guest_category_id" => "5419a085826b77608500000a",
                     "payment_promo_code" => nil,
    "send_email_on_guest_category_change" => nil,
                "confirmation_email_sent" => false,
                   "disable_update_email" => false,
                 "wait_for_linked_people" => false,
                            "rsvp_status" => "not_replied",
            "vip_notification_on_checkin" => nil,
                              "showed_up" => nil,
               "green_access_control_ids" => nil,
                 "red_access_control_ids" => nil,
                                     "id" => "54da19ae826b77b377000047",
                         "guest_metadata" => {
                                     "city" => "Paris",
                                  "country" => "France"
                              },
                                    "vat" => 0.0,
                              "badge_url" => "#fake_preview_badge_url",
                        "badge_completed" => false,
                      "access_privileges" => [],
                           "person_files" => [],
                                "tickets" => [],
                              "documents" => [],
                    "discount_percentage" => 0.0,
                "purchase_total_with_vat" => 0.0,
             "purchase_total_without_vat" => 0.0,
                           "purchase_vat" => 0.0,
                         "payment_status" => "FREE",
                       "payment_currency" => "EUR",
                        "last_cart_total" => 0.0,
          "last_cart_total_excluding_vat" => 0.0,
               "last_cart_payment_status" => "FREE",
                 "payment_transaction_id" => nil,
                  "payment_merchant_type" => nil,
                           "payment_date" => nil,
                        "payment_attempt" => 0,
                 "payment_gateway_status" => nil,
             "payment_wufoo_sync_blocked" => false,
                          "person_parent" => nil
}
```

### {{ linked\_guests }}

```
[]
```

### {{ qrcode\_image\_tag }}

```
"<img src=\"http://apps.eventmaker.io/en/events/51f64612112710982f0006e9/guest_categories/5419a085826b77608500000a/email_fake_qrcode\" alt=\"QR Code\" width=\"240\" style=\"image-rendering: -webkit-optimize-contrast; image-rendering: -moz-crisp-edges; image-rendering: -o-crisp-edges; image-rendering: crisp-edges; -ms-interpolation-mode: nearest-neighbor\" />"
```

### {{ qrcode\_image\_url }}

```
"http://apps.eventmaker.io/en/events/51f64612112710982f0006e9/guest_categories/5419a085826b77608500000a/email
```


# Registration form

Eventmaker comes with a powerful language editor for your custom registration form. It’s derived from the markup language [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers). This page shows you how you can use the custom Eventmaker liquid tags and variables to build your registration form. Please note that this form will embed the [Bootstrap CSS](http://twitter.github.com/bootstrap/base-css.html#forms) so that you can use any of the fancy classes on your fields.

## Liquid variables

Here are the variables available to use in [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) for the custom Registration Form :

```
{{ event }}
{
             "title" => "New Year's Eve 2015",
         "organizer" => "Eventmaker Developers",
       "description" => "This event has not begun yet",
          "timezone" => "Paris",
                "id" => "5408886b4f6905cb83000001",
             "photo" => nil,
    "photo_original" => nil,
        "start_date" => Wed, 31 Dec 2014 22:00:00 CET +01:00,
          "end_date" => Thu, 01 Jan 2015 07:00:00 CET +01:00,
   "guest_categories" => "5408886b4f6905cb83000001, 0.0, 0.0, 0.0"
}
{{ guest_category }}
{
                 "name" => "Autre",
                   "id" => "5408886b4f6905cb83000002"
        "badge_enabled" => true,
               "traits" => {},
                "price" => 0.0,
                  "vat" => 0.0,
    "price_without_vat" => 0.0,
       "price_with_vat" => 0.0,
           "vat_amount" => 0.0
}
{{ checkin_points }}
[
    {
                     "name" => "Cher",
         "capacity_enabled" => false,
                    "price" => 400.0,
                   "traits" => {},
                      "vat" => 20.0,
                       "id" => "540991e44f69056609000002",
        "capacity_reached?" => false,
          "remaining_slots" => -1
    },
    {
                     "name" => "Moyen",
         "capacity_enabled" => false,
                    "price" => 250.0,
                   "traits" => {},
                      "vat" => 10.0,
                       "id" => "540992164f690552c7000004",
        "capacity_reached?" => false,
          "remaining_slots" => -1
    },
    {
                     "name" => "Test",
         "capacity_enabled" => false,
                    "price" => 400.0,
                   "traits" => {},
                      "vat" => 10.0,
                       "id" => "540f0cf24f6905a277000005",
        "capacity_reached?" => false,
          "remaining_slots" => -1
    }
]
{{ guest }}
{
                                "uid"   => "12345654324"
                              "email"   => "john.smith@gmail.com"
                          "first_name"  => "John"
                            "last_name" => "Smith"
                            "position"  => "Director"
                        "company_name"  => "Eventmaker"
                        "phone_number"  => "1234567890"
                        "country_name"  => "France"
                             "country"  => "FRA"
                              "message" => "Hello"
                  "payment_promo_code"  => "MY_PROMO_CODE"
                          "utm_source"  => ""
                          "utm_medium"  => ""
                        "utm_campaign"  => ""
                "facebook_profile_link" => ""
                            "event_id"  => "540f0cf24f6905a277000005"
                    "guest_category_id" => "540992164f690552c7000004"
                "has_access_privileges" => true
  "send_email_on_guest_category_change" => true
              "confirmation_email_sent" => true
              "zoho_invoice_reference"  => ""
                      "zoho_invoice_id" => "540992164f690552c7000004"
                          "rsvp_status" => ""
          "vip_notification_on_checkin" => false
                  "discount_code_label" => "My discount code label"
                       "price_incl_vat" => 120.00
                       "price_excl_vat" => 100.00
                            "total_vat" => 20.00
                       "guest_category" => The associated guest category
                                "event" => The associated event
                        "person_parent" => {}
}
```

## Pre-fill form with URL parameters

By providing the right URL query string parameters, you can pre-fill the Eventmaker registration form. To do so, append to the form URL the url-encoded list of parameters. The parameter names will be the first argument of the `{% guest_field %}` and `{% guest_field_name %}` tags. As an exemple:

```
https://app.eventmaker.io/[...]/registrations/new?first_name=John&last_name=Smith
```

In addition to that you can pre-fill the following fields :

* `payment_promo_code`
* `utm_source`
* `utm_medium`
* `utm_campaign`

## Simple guest field

This is the simplest tag, which will by default result in a form text field `<input type="text" />`. The first argument is the property name of the field (native Eventmaker field or metadata), the second argument is the label for this field (displayed on the left of the text box).

```
{% guest_field birthdate "Your Birth date" %}
```

You can use [all the HTML attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/input) as option with this tag. Some examples:

| Option        | Example value                                    | Details                                                                        |
| ------------- | ------------------------------------------------ | ------------------------------------------------------------------------------ |
| `required`    | `true`                                           | Whether this field is mandatory to fill.                                       |
| `readonly`    | `true`                                           | Use it to prevent users from modifying the field                               |
| `placeholder` | `"12/12/1992"`                                   | The placeholder HTML tag giving some hint to the user on how to fill the field |
| `help-inline` | `"We must be sure you are above 18."`            | Some help text displayed on the right of the text field                        |
| `maxlength`   | `5`                                              | Limit the number of characters inside the text field                           |
| `type`        | `file`, `number`, `date`, `textarea` or `hidden` | Change the type of data the field will accept / the control itself             |
| `class`       | `input-xxlarge`                                  | Some CSS class to apply on the generated `<input />` element                   |

This way you can compose more advanced guest fields, like the following:

```
{% guest_field city "City", required: true %}
```

```
{% guest_field zip_code "Zip Code", maxlength: 5, type: number, placeholder: "75018", help-inline: "Enter a 5 digits number" %}
```

```
{% guest_field mariage_date "The mariage will take place on", type: date, data-language: en %}
```

```
{% guest_field comments "Comments (1000 characters)", type: textarea, rows: 3, maxlength: 1000, class: input-xxlarge %}
```

You can create a basic file input field as follows:

```
{% guest_field resume "Your resume", type: file %} 
```

You can even create a direct upload file input that uses ajax and a progress bar to upload your file:

```
{% guest_field resume "Your resume", type: file direct_upload: true %} 
```

An additionnal option is present for email if you need to check in ajax the presence of a guest with this email into the guest\_category

```
{% guest_field email "Email", check_if_registered: true %}
```

Note that you can also require a field conditionnally :

```
{% guest_field sector_other "Sector other", required_if: "sector==other" %}
```

For linked guest you can require a field comparing a main guest field, to achieve that simply use the prefix \`main\_guest\` into the condition

```
{% guest_field phone_number "Phone number", required_if: "main_guest_step_1_completed==1" %}
```

For country field, this tag generate a dropdown list of countries. You can specify the first country of the list.

```
{% country_select "Your country", required: true, first: "France" %}
```

The VAT Number liquid tag enables a few functionalities associated with the new \`vat\_number\` standard field, and is particularly useful when the organizer needs to enable VAT exemption for their registrations.

```
{% vat_number "VAT number", required: true %}
```

The liquid tag provides a few options. But you can also provide no option to the tag, in this case the default values will be used just as follows :

| Option       | Default value | Details                                                                                      |
| ------------ | ------------- | -------------------------------------------------------------------------------------------- |
| `required`   | `false`       | Whether this field is mandatory.                                                             |
| `validate`   | `false`       | Prevents from submitting an invalid VAT number                                               |
| `readonly`   | `false`       | Prevents from changing the field value                                                       |
| `live-check` | `true`        | Checks whether the VAT number is valid while filling the form and updates cart if necessary. |
| `no-icons`   | `false`       | Disables all icons associated with the live check of the field.                              |
| `help-block` | `""`          | Help text. For example "Type your VAT number here"                                           |

## Advanced guest field

Eventmaker provides you an alternate tag, `{% guest_field_name %}` to get event more control over the form. You may need to have a mandatory checkbox where people have to agree with terms of services. Here is how you can do it

```
<div class="control-group {% if guest_errors contains 'read_and_accept_tos' %} error {% endif %}">
  <label class="control-label" required="required">Terms of Service</label>
  <div class="controls">
    <label class="checkbox">
      <input type="checkbox" name="{% guest_field_name read_and_accept_tos, required: true %}" value="opt-in" />
      I read and agree with the <a href="#">terms of service</a>.

      {% if guest_errors contains 'read_and_accept_tos' %}
        <span class="help-block">You must accept the terms of service.</span>
      {% endif %}
    </label>
  </div>
</div>
```

## Drop down lists

Dropdown lists in HTML are `<select />` tags with a few nested `<option />`. You can generate some of them with the following syntax:

```
{% guest_select_field meal 'Special meal', required: true %}
  {% option 'Please choose...', value: '', selected: true %}
  {% option 'Normal' %}
  {% option 'Low salt' %}
  {% option 'Gluten-free' %}
  {% option 'Low calorie' %}
{% endguest_select_field %}
```

You can group options by using the following syntax:

```
  {% guest_select_field meal 'Special meal', required: true %}
    {% option 'Please choose...', value: '', selected: true %}
    <optgroup label="group label 1">
      {% option 'Normal' %}
      {% option 'Low salt' %}
    </optgroup>
    <optgroup label="group label 2">
      {% option 'Gluten-free' %}
      {% option 'Low calorie' %}
    </optgroup>
  {% endguest_select_field %}
```

You can also use the power of Liquid to generate a three drop down lists component to register a birth date:

```
<div class="control-group {% if (guest_errors contains 'birth_date_day') or (guest_errors contains 'birth_date_month') or (guest_errors contains 'birth_date_year') %} error {% endif %}">
  <label class="control-label" required="required">Birth Date (year/month/day)</label>
  <div class="controls">
    <select class="input-small" name="{% guest_field_name birth_date_year, required: true %}" required="required">
      <option value="">-</option>
      {% for i in (1900..2013) %}
        <option {{ if i == 1960 }} selected="selected" {{ endif }}>{{ i }}</option>
      {% endfor %}
    </select>
    <select class="input-medium" name="{% guest_field_name birth_date_month, required: true %}" required="required">
      <option value="">-</option>
      <option value="1">January</option>
      <option value="2">February</option>
      <option value="3">March</option>
      <option value="4">April</option>
      <option value="5">May</option>
      <option value="6">June</option>
      <option value="7">July</option>
      <option value="8">August</option>
      <option value="9">September</option>
      <option value="10">Ocotber</option>
      <option value="11">November</option>
      <option value="12">December</option>
    </select>
    <select class="input-mini" name="{% guest_field_name birth_date_day, required: true %}" required="required">
      <option value="">-</option>
      {% for i in (1..31) %}
        <option>{{ i }}</option>
      {% endfor %}
    </select>
  </div>
</div>
```

If you define a specific values list for a guest field, you can use the \`guest\_select\_from\_field\` tag instead to display a dropdown list, without specifying any option.

```
    {% guest_select_from_field country "Your country", checked:"France", required:true %}
```

The property `selected:"France"` selects the option with the value equal to "France", whereas `required:true` make the dropdown list required.\
You can pass any previously defined property to this tag except for `type`.

## Radio fields

Radio buttons can be identified to drop down lists as they provide the same feature, which is choosing one value from a given list. That's why the tag syntax is close:

```
    {% guest_radios_field gender 'Your gender', required: true %}
      {% radio Male %}
      {% radio Female, value: 'f', checked: true %}
    {% endguest_radios_field %}
```

If you define a specific values list for a guest field, you can use the \`guest\_radios\_from\_field\` tag instead to display a radio buttons group, without specifying any radio.

```
    {% guest_radios_from_field gender "Your gender", checked:"Male", required:true %}
```

The property `checked:"Male"` pre-checks the radio button with the value equal to "Male", whereas `required:true` make the group required.\
You can pass any previously defined property to this tag except for `type`.

## Checkbox fields

Radio buttons have cousins, the checkboxes. But a checkbox is a field in itself, with a boolean value. That's why if you have a "group of checkboxes", you need as many guest fields as the number of checkboxes.

```
{% guest_checkbox_field read_and_accept_tos "You must accept the terms of service." %}
```

This is the HTML generated by the liquid tag:

```
<div class="control-group">
  <div class="controls">
    <label class="checkbox ">
      <input id="guest_guest_metadata_read_and_accept_tos" name="guest[guest_metadata[read_and_accept_tos]]" type="hidden" value="">
      <input id="guest_guest_metadata_read_and_accept_tos" name="guest[guest_metadata[read_and_accept_tos]]" type="checkbox" value="1">
      <span>You must accept the terms of service.</span>
    </label>
  </div>
</div>
```

You can use the following options with this tag:

| Option          | Example value         | Details                                                                                  |
| --------------- | --------------------- | ---------------------------------------------------------------------------------------- |
| `required`      | `true`                | Whether this checkbox is mandatory to check.                                             |
| `checked`       | `true`                | This checkbox is checked when the page loads                                             |
| `value`         | `"Yes"`               | By default, the checkbox value is set to 1, but you can override it with your own value. |
| `class`         | `"my_class"`          | You can stylize the checkbox or its label by adding a class.                             |
| `control_label` | `"Terms of services"` | You can add a title to the checkbox which is different from the clickable label.         |
| `group`         | `true`                | You can group several checkboxes by adding the group option to each one of them.         |

```
{% guest_checkbox_field read_and_accept_tos "You must accept the terms of service.", group: true %}
```

This is the HTML generated by the liquid tag:

```
<label class="checkbox">
  <input id="guest_guest_metadata_read_and_accept_tos" name="guest[guest_metadata[read_and_accept_tos]]" type="hidden" value="">
  <input id="guest_guest_metadata_read_and_accept_tos" name="guest[guest_metadata[read_and_accept_tos]]" type="checkbox" value="1">
  <span>You must accept the terms of service.</span>
</label>
```

## Check-in points

If you have check-ins points not linked to the guest category for which you edit the registration form, you can let your user register to specific check-in points. With the following code, you will generate a check box for each check-in point.

```
<div class="control-group">
  <label class="control-label">Please choose</label>
  <div class="controls">
    {% for point in checkin_points %}
      {% checkin_point point.id %}
    {% endfor %}
  </div>
</div>
```

You may want to display a checkbox for each check-in point **according to the value of one or several traits**. In that case, use the following code, in which we display the check-in points with the traits `type` as *conferences* and **date** as *28/02*; we also use the trait **form\_label** as the checkin-point label.

```
  {% for point in checkin_points %}
    {% if point.traits.type == "conferences" and point.traits.date == "28/02" %}
      {% checkin_point point.id, label: point.traits.form_label %}
    {% endif %}
  {% endfor %}
```

You may want to display a checkbox for each check-in points, **except** for 1 or 2. In that case, use the following code, in which we exclude 2 check-in points by specifying their id.

```
<div class="control-group">
  <label class="control-label">Please choose</label>
  <div class="controls">
    {% assign hidden_checkin_point_ids = '50d334f9230b43daa6000006,50d334f9230b43daa6000007' | split: ',' %}
    {% for point in checkin_points %}
      {% unless hidden_checkin_point_ids contains point.id %}
        {% checkin_point point.id %}
      {% endunless %}
    {% endfor %}
  </div>
</div>
```

Sometimes you may want to group check-in points as alternatives, meaning that a guest can choose at most **one** check-in point among several options. You then need `radio` buttons, so for each `check_in_point` tag, you need to pass the `radio_group` option. Please note that the name of the `radio_group` won't be displayed anywhere, it only serves to identify which groups of alternatives.

```
{% checkin_point 50d334f9230b43daa6000006, radio_group: morning_conference %}
{% checkin_point 10d334f9980b43daa6000018, radio_group: morning_conference %}
{% checkin_point none, label: "None",      radio_group: morning_conference, checked: true %}
```

By default, the label next to the checkbox is the Check-in Point name. You can override this text with the `label` option.

```
{% checkin_point 50d334f9230b43daa6000006, label: "A shorter label" %}
```

If your check-in point has a capacity set, you can display the remaining slots with the `display_remaining` option.

```
{% checkin_point point.id, display_remaining: true %}
{% checkin_point 50d334f9230b43daa6000006, display_remaining: true %}
```

If you want to set a "unique access" policy to your check-in point, use the `max_allowed_accesses` option.

```
{% checkin_point point.id, max_allowed_accesses: 1 %}
{% checkin_point 50d334f9230b43daa6000006, max_allowed_accesses: 1 %}
```

If you want to set "more access" policy to your check-in point, use the `max_allowed_accesses` option.

```
{% checkin_point point.id, max_allowed_accesses: n %}
{% checkin_point 50d334f9230b43daa6000006, max_allowed_accesses: 4 %}
```

If you want to set a “unlimited access” policy to your check-in point, use the `max_allowed_accesses` option. \</p>

```
{% checkin_point point.id, max_allowed_accesses: -1 %}
{% checkin_point 50d334f9230b43daa6000006, max_allowed_accesses: -1 %}
```

You can use the following options with this tag:

| Option        | Type value | Example value | Apply to        |
| ------------- | ---------- | ------------- | --------------- |
| `exclude_vat` | Boolean    | `true`        | `checkin_point` |

## Accompanying people

This tag allows you to add one or several accompanying people. The same as the main guest, you can use the following fields for the accompanying person : simple guest fields, checkin-in points, drop down lists, radio and checkbox fields.\
An identity field must also be present for the accompanying person to be valid (`last_name`, `email`, `company_name` or `uid`).\
The naming of the fields must be no different from the main guest (ex: `last_name` and not `partner_last_name`).

```
{% foreach_linked_guest default_nb: 0, guest_category_id: "50d334f9230b43daa6000007", add: 1, add_label: "Add an accompanying people", remove: 1, remove_label: "Remove this accompanying people" %}

    {% guest_field last_name "Last Name :", required: true %}
    {% guest_field first_name "First Name :", required: true %}

{% endforeach_linked_guest %}
```

| Option              | Type value | Example value                       | Details                                                                                        |
| ------------------- | ---------- | ----------------------------------- | ---------------------------------------------------------------------------------------------- |
| `default_nb`        | Integer    | `1`                                 | The number of accompanying people blocks that will be displayed by default when the page loads |
| `guest_category_id` | String     | `"50d334f9230b43daa6000007"`        | Accompagnying person's guest category ID                                                       |
| `add`               | Integer    | `0` or `1`                          | Display a button to add an accompanying person                                                 |
| `remove`            | Integer    | `0` or `1`                          | Display a button to remove an accompanying person                                              |
| `add_label`         | String     | `"Add an accompanying person"`      | The add button label                                                                           |
| `remove_label`      | String     | `"Remove this accompanying person"` | The remove button label                                                                        |
| `limit`             | Integer    | `4`                                 | The max number of accompanying people you can add                                              |

## Payment

The Eventmaker registration form can be coupled with a payment process. You get a cart which you can init with a base price for the guest category, and then you can add a price to some elements in the form.

To set the price of a check-in point, go on its "edit" page and update the base price. The currency used will be the one of the guest category.

Last but not least, you can let the user to choose the payment method. Depending on the value selected, the guest will be redirected to the Ogone payment page. Eventmaker supports Ogone and will soon support Paypal.

```
    {% guest_radios_field payment_merchant_type 'Payment method', payment: true %}
      {% radio "Credit card", value: ogone, checked: true %}
      {% radio "Wire Transfer" %}
      {% radio "Check" %}
    {% endguest_radios_field %}
```

There is also a tag which can generate the options based on what is configurate into the category.

```
    {% payment_merchant_type "Payment" %}
```

You can make it required or add a pre-selected value from this list: **check**, **bank\_transfer**, **cash** or **ogone** to the credit card option.

```
    {% payment_merchant_type "Payment", required: true, selected: "check" %}
```

## Discount codes

Discount codes can be used in two ways :

* As a reduction for one or several products
* As an invitation code which allows your guests to register. Only people owning a code will be able to register.

**Both ways can be used together if you don’t want people to register without a code and offer them a discount at the same time.**

```
{% promo_code 'Do you have a discount code?' %}
```

| Option             | Type value | Example value  | Details                                            |
| ------------------ | ---------- | -------------- | -------------------------------------------------- |
| `display_capacity` | Boolean    | `true / false` | Display the remaining slots for this discount code |
| `display_label`    | Boolean    | `true / false` | Display discount code label                        |
| `readonly`         | Boolean    | `true / false` | A readonly discount code cannot be modified        |

```
{% promo_code 'Do you have a discount code?', display_capacity: true %}
```

## Displaying errors

It is possible to display a list of errors after the form validation thanks to the `guest_errors` variable. When looping through the list, each iteration will produce an array of 2 entries, the first of which contains the key of the error field, the last of which contains the error message.

```
  <ul>
    {% for error in guest_errors %}
      <li> {{ error[1] }} </li>
    {% endfor %}
  </ul>
```

This would output:

```
  <ul>
    <li> Société doit être rempli(e) </li>
    <li> Code promo est requis pour s'inscrire et est invalide </li>
  </ul>
```

## Floats precision and currency

You can handle the precision of floats and choose which currency you want to display after the number with the following tags.

```
{{ 1234.00000 | number_to_currency precision: 2, "fr" }}
```

`1234.00 €`

```
{{ 1234.00000 | number_with_precision precision: 3 }}
```

`1234.000`

## Localization

By default, Eventmaker will show your guests error messages if some of the field don't validate. You can set the locale of your form to `en` or `fr`. But if for some reason you don't like an error message for a specific field, you can override them like this:

```
{% guest_field email 'Email', overrides: {"Someone already registered to this event using this email address" => "Une autre inscription a déjà prise en compte avec la même adresse email" } %}
```

## Resend confirmation email

```
{% link_to_resend_confirmation_email_block, class: "btn btn-primary" %}
    < something >
{% endlink_to_resend_confirmation_email_block %}
```

Unique email option must be enabled for either event or guest category. You must add the `check_if_registered` option in your guest field email.

```
{% guest_field email 'Email', required: true, check_if_registered: true, overrides: {"Someone already registered to this event using this email address" => "Une autre inscription a déjà été prise en compte avec la même adresse email" } %}
```

## Filters

If you need to escape some text to include it in a URL for example, we've added a convenient liquid filter for that :

```
http://somewebsite.com/search?q={{"my favourite band is AC/DC" | urlencode}}
```

This will output:

```
http://somewebsite.com/search?q=my%20favourite%20band%20is%20AC/DC
```

If you need to escape some text to include it in a URL param ( this will escape '&' for example ) :

```
 {{ "Eventmaker & cie" | url_param_encode }}
```

This will output:

```
Eventmaker+%26+cie
```

## Ajax form submission

You can use some Javascript to asynchronously submit the registration form. Here is some handy sample code:

```
<script type="text/javascript">
  $('form').submit(function(e) {
    e.preventDefault();  // Do not submit the form yet

    $.ajax({
      type: 'POST',
      url: $(e.target).attr('action'),
      dataType: 'json',
      data: $(e.target).serialize(),
      success: function(data) {
        // Do whatever you want
        // console.log(data);
        // the JSON object has the following properties:
        // - 'confirm_url' (String)
        // - 'person' (Object)
      }
    });
  })
</script>
```

## Editable fields

If you want to help your users to edit contents without editing the HTML code, this is possible by declaring editable fields.

```
{% editable_text "text intro" %}{% endeditable_text %}
```

You can add a text box if you want to enlarge the user's possibility

```
{% editable_text "text intro", type: text_area %}{% endeditable_text %}
```

You can also use ckeditor in to help the users add style.

```
{% editable_text "text intro", type: cktext_area %}{% endeditable_text %}
```

It is also possible to add select fields

```
    {% editable_select "Select an option", default: "option_2" %}
      {% editable_select_option "", label: "Please choose your option" %}
      {% editable_select_option "option_1", label: "option 1" %}
      {% editable_select_option "option_2", label: "option 2" %}
      {% editable_select_option "option_3", label: "option 3" %}
    {% endeditable_select %}
```

When you use many editable fields, it can become difficult to find the one you would like to change. It is then nice to be able to sort them. By default it is a descending order so that you can prioritize new editable fields in front of those that already exist.

```
{% editable_text "text intro", priority:2, type: cktext_area %}{% endeditable_text %}
{% editable_text "text content", priority:1, type: cktext_area %}{% endeditable_text %}
```

## Order uid to edit registration

You can use the order uid to edit a guest.

```
/public/events/:event_id/guests/edit_from_order_uid?order_uid=xxx
```

You can use the order uid to display a confirmation message.

```
/public/events/:event_id/guests/display_confirmation_message_from_order_uid?order_uid=xxx 
```

You can use the order uid to go to payment page when a payment is required:

```
/public/events/:event_id/guests/goto_payment_from_order_uid?order_uid=xxx 
```

## Labels

You can add labels to guests like this

```
  {% add_guest_label "foo" %}
  {% add_guest_label "foo,toto,titi" %}
```

and remove like this.

```
  {% remove_guest_label "foo" %}
  {% remove_guest_label "foo,toto,titi" %}
```


