# Welcu API v1

## Overview

This documentation describes the resources that compose the official Welcu API v1.

### Authentication

This API requires an API token per event. This token can be obtained from the integrations menu of your organization.

Every method of this API require an event token which must be passed in the HTTP request *Authorization* header like:

```
Authorization: event HERE_GOES_THE_TOKEN
```

So for example using curl. Every request must be called like:

```
curl -i -H 'Authorization: event HERE_GOES_THE_TOKEN' \
  https://api.welcu.com/v1/:api_method.json
```

### Errors

Errors are delivered via HTTP Status Codes along with a JSON payload with the description of the error

**401 Unauthorized**

This code is returned when the event token is wrong/disabled/empt&#x79;**.**

```
curl -i https://api.welcu.com/v1/event.json
```

**404 Not Found**

This code is returned when the API can't find the resource you are querying.

**406 Not Acceptable**

This code is returned when the change you are trying to perform is not possible

**422 Unprocessable Entity**

This error is returned when there are errors on the parameters given to the API

### **Global Auth**

You can use a 'company token' to access event's data. Only add a valid 'event\_id' to events endpoint.

```bash
Authorization: event COMPANY_TOKEN
```

```
https://api.welcu.com/v1/event/attendees.json?event_id=123
```

#### Example:

```
curl -H 'Authorization: event COMPANY_TOKEN' https://api.welcu.com/v1/event/attendees/code/SC1F5E6.json?event_id=123
```

## Event

## Get event information

<mark style="color:blue;">`GET`</mark> `https://api.welcu.com/v1/event.json`

This endpoint allows you to get information about the event including its company and tickets\
`curl -H 'Authorization: event TOKEN' https://api.welcu.com/v1/event.json`

{% tabs %}
{% tab title="200 Event information successful response" %}

```javascript
{
  "id": 15,
  "name": "Webprendedor Santiago 2012",
  "description": "Webprendedor 2012 reunirá a los emprendedores digitales y quienes quieren comenzar a emprender, para que conozcan experiencias exitosas de startups en Silicon Valley.",
  "starts_at": "2012-11-16T09:00:00-03:00",
  "ends_at": "2012-11-17T18:00:00-03:00",
  "locale": "es",
  "timezone": "Santiago",
  "state": "active",
  "url": "https://welcu.com/webprendedor/santiago2012",
  "public": true,
  "real_state": "selling",
  "rating_avg": 4.5,
  "ratings_enabled": true,
  "location": {
    "venue": "Teatro NESCAFÉ de las Artes",
    "address": "Manuel Montt 032",
    "city": "Providencia",
    "country": "CL",
    "lat": -33.4285940111406,
    "lng": -70.6207394599915
  },
  "company": {
    "id": 2,
    "name": "Webprendedor"
  },
  "tickets": [
    {
      "id": 15,
      "name": "Conferencia Santiago 2012",
      "starts_at": "2012-11-16T09:00:00-03:00",
      "ends_at": "2012-11-16T18:00:00-03:00",
      "location": {
        "venue": "Teatro NESCAFÉ de las Artes",
        "address": "Manuel Montt 032",
        "city": "Providencia",
        "country": "CL",
        "lat": -33.4285940111406,
        "lng": -70.6207394599915
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Attendees

## Get attendee list

<mark style="color:blue;">`GET`</mark> `https://api.welcu.com/v1/event/attendees[/:state].json`

Using this endpoint you can get the list of attendees along with its ticket\
`curl -i -H 'Authorization: event TOKEN' \`\
`https://api.welcu.com/v1/event/attendees/checked.json`

#### Path Parameters

| Name  | Type   | Description                                                                                                                                                                                                                |
| ----- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| state | string | <p>To filter list by the attendee state. The available states are:<br><strong>checked</strong>: Filter only attendees with checked tickets<br><strong>unchecked</strong>: Filter only attendees with unchecked tickets</p> |

#### Query Parameters

| Name       | Type   | Description                                                              |
| ---------- | ------ | ------------------------------------------------------------------------ |
| since      | string | An ISO8601 encoded date to filter attendees updated since the given date |
| ticket\_id | string | To filter the attendees with tickets for a given ticket\_id              |

{% tabs %}
{% tab title="200 " %}

```javascript
[
  " ... "
  {
    "id": 96,
    "first_name": "Seba",
    "last_name": "Gamboa",
    "organization": "Welcu",
    "title": "CTO",
    "email": "seba@welcu.com",
    "phone": null,
    "facebook_uid": "754027414",
    "reference_key": null,
    "tickets": [
      {
        "code": "SC1F5E6",
        "ticket_id": 15,
        "checked_at": "2012-11-16T08:27:05-03:00",
        "created_at": "2012-11-07T10:27:16-03:00"
      }
    ]
  },
  " ... "
]
```

{% endtab %}
{% endtabs %}

## Get attendee by ticket code

<mark style="color:blue;">`GET`</mark> `https://api.welcu.com/event/attendees/code/:code.json`

This endpoint allows you to get the attendee associated to a given ticket code\
`curl -i -H 'Authorization: event TOKEN' \`\
`https://api.welcu.com/v1/event/attendees/code/SC1F5E6.json`

#### Path Parameters

| Name | Type   | Description              |
| ---- | ------ | ------------------------ |
| code | string | The ticket code to query |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "id": 96,
  "first_name": "Seba",
  "last_name": "Gamboa",
  "organization": "Welcu",
  "title": "CTO",
  "email": "seba@welcu.com",
  "phone": null,
  "facebook_uid": "754027414",
  "reference_key": null,
  "tickets": [
    {
      "code": "SC1F5E6",
      "ticket_id": 15,
      "checked_at": "2012-11-16T08:27:05-03:00",
      "created_at": "2012-11-07T10:27:16-03:00"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Check an attendee's ticket

<mark style="color:green;">`POST`</mark> `https://api.welcu.com/v1/event/attendees/code/:code/check.json`

This endpoint allows you to mark the ticket as checked\
`curl -i -H 'Authorization: event TOKEN' \`\
`-d 'at=2012-11-16T08:27:05-03:00' \`\
`https://api.welcu.com/v1/event/attendees/code/SC1F5E6.json`

#### Path Parameters

| Name | Type   | Description              |
| ---- | ------ | ------------------------ |
| code | string | The ticket code to check |

#### Query Parameters

| Name | Type   | Description                                                                                                      |
| ---- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| at   | string | An ISO8601 encoded date to specify at which time the ticket was checked. The current time is used if left blank. |

{% tabs %}
{% tab title="202 " %}

```
```

{% endtab %}
{% endtabs %}

## Invitations

## Get invitations

<mark style="color:blue;">`GET`</mark> `https://api.welcu.com/v1/event/invitations.json`

Using this endpoint you can get the list of attendees along with its tickets\
`curl -i -H 'Authorization: event TOKEN' \`\
`https://api.welcu.com/v1/event/invitations.json`

{% tabs %}
{% tab title="200 " %}

```javascript
[
  " ... "
  {
    "id": 1462,
    "name": "2015 clients",
    "email_subject": "Invitation for Webprendedor Santiago 2016",
    "event_id": 15,
    "sender_email": "rsvp@welcu.com",
    "sender_name": "Welcu Inc.",
    "sent_at": "2015-12-28T17:50:53-03:00",
    "stats": {
        "confirmed": 20,
        "declined": 1,
        "pending": 10
    },
    "ticket_id": 15
  },
  " ... "
]
```

{% endtab %}
{% endtabs %}

## Get invitation recipients

<mark style="color:blue;">`GET`</mark> `https:api.welcu.com/v1/event/invitations/:invitation_id/recipients.json`

Using this endpoint you can get the list of recipients from an invitation\
`curl -i -H 'Authorization: event TOKEN' \`\
`https://api.welcu.com/v1/event/invitations/1462/recipients.json`

#### Path Parameters

| Name           | Type   | Description                                                                                           |
| -------------- | ------ | ----------------------------------------------------------------------------------------------------- |
| invitation\_id | number | To filter the list by invitation. If you don't want to filter by invitation, use invitation\_id = all |

#### Query Parameters

| Name        | Type   | Description                                                            |
| ----------- | ------ | ---------------------------------------------------------------------- |
| email       | string | To filter the recipients by email                                      |
| first\_name | string | To filter the recipients by first name                                 |
| last\_name  | string | To filter the recipients by last name                                  |
| state       | string | To filter the recipients by their state (confirmed, declined, pending) |

{% tabs %}
{% tab title="200 " %}

```javascript
[
  " ... "
  {
      "id": 974534,
      "invitation_id": 1462,
      "email": "recipient1@welcu.com",
      "first_name": "John",
      "last_name": "Doe",
      "state": "declined",
      "ticket_code": null,
      "ticket_url": null
  },
  " ... "
]
```

{% endtab %}
{% endtabs %}

## Recipient actions

<mark style="color:green;">`POST`</mark> `https://api.welcu.com/v1/event/invitations/:invitation_id/recipients/:recipient_id/:action.json`

Using this endpoint you can confirm or decline a recipient\
`curl -i -H 'Authorization: event TOKEN' \`\
`https://api.welcu.com/v1/event/invitations/1462/recipients/974534/decline.json`

#### Path Parameters

| Name           | Type   | Description                                                                                                                  |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| action         | string | <p>The action to perfirm. The available actions are:<br>confirm: Confirm the recipient<br>decline: Decline the recipient</p> |
| recipient\_id  | number | The recipient´s ID                                                                                                           |
| invitation\_id | number | Filter by invitation. If you dont want to filter by invitation, use invitation\_id = all                                     |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "id": 974534,
    "invitation_id": 1462,
    "email": "recipient1@welcu.com",
    "first_name": "John",
    "last_name": "Doe",
    "state": "declined",
    "ticket_code": null,
    "ticket_url": null
}
```

{% endtab %}
{% endtabs %}

## Company

## Get events information

<mark style="color:blue;">`GET`</mark> `https://api.welcu.com/v1/company.json`

Get a list with all events and activities data\
\
`curl -i -H 'Authorization: company COMPANY_TOKEN' https://api.welcu.com/v1/company.json`

{% tabs %}
{% tab title="200 " %}

```
{
  "name": "abel",
  "url": "https://welcu.com/abel",
  "logo_url": "https://welcu.com/images/logo/2016/welcu.png",
  "currencies": [
    "clp"
  ],
  "contact_email": "abel(a)welcu.com",
  "country_id": "CL",
  "locale": null,
  "timezone": "Santiago",
  "events": [
    {
      "id": 25524,
      "name": "evento en borrador",
      "description": null,
      "starts_at": "2018-09-10T11:00:00.000Z",
      "ends_at": "2018-09-10T15:00:00.000Z",
      "locale": "en",
      "timezone": "Santiago",
      "state": "draft",
      "url": "https://welcu.com/abel/evento-en-borrador",
      "logo": null,
      "public": true,
      "real_state": "draft",
      "thumbnail_url": "https://welcu.com/images/default/business.png",
      "rating_avg": null,
      "ratings_enabled": true,
      "location": {
        "venue": "",
        "address": "",
        "city": "Santiago",
        "country": "CL",
        "lat": 0.0,
        "lng": 0.0
      },
      "company": {
        "id": 157695,
        "name": "abel"
      },
      "tickets": [
        {
          "id": 73418,
          "name": "General",
          "starts_at": "2018-09-10T11:00:00.000Z",
          "ends_at": "2018-09-10T15:00:00.000Z",
          "quantity": 100,
          "available": 100,
          "prices": {
            "clp": "10000"
          },
          "locked": false,
          "ticket_type": "sales",
          "location": {
            "venue": "",
            "address": "",
            "city": "Santiago",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        }
      ],
      "website_data": {
        "speakers": [
          
        ],
        "schedule": [
          
        ]
      }
    },
    {
      "id": 32360,
      "name": "prueba-links",
      "description": null,
      "starts_at": "2019-07-29T12:00:00.000Z",
      "ends_at": "2019-12-31T15:00:00.000Z",
      "locale": "en",
      "timezone": "Santiago",
      "state": "active",
      "url": "https://welcu.com/abel/prueba-links",
      "logo": null,
      "public": false,
      "real_state": "paid-active",
      "thumbnail_url": "https://welcu.com/images/default/business.png",
      "rating_avg": null,
      "ratings_enabled": true,
      "location": {
        "venue": "",
        "address": "",
        "city": "Stgo",
        "country": "CL",
        "lat": 0.0,
        "lng": 0.0
      },
      "company": {
        "id": 157695,
        "name": "abel"
      },
      "tickets": [
        {
          "id": 109168,
          "name": "Empresa",
          "starts_at": "2019-07-29T12:00:00.000Z",
          "ends_at": "2019-12-31T15:00:00.000Z",
          "quantity": 100,
          "available": 87,
          "prices": {
            "clp": 0
          },
          "locked": false,
          "ticket_type": "free",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        },
        {
          "id": 109359,
          "name": "Gift",
          "starts_at": "2019-07-29T12:00:00.000Z",
          "ends_at": "2019-12-31T15:00:00.000Z",
          "quantity": 100,
          "available": 96,
          "prices": {
            "clp": "1000"
          },
          "locked": false,
          "ticket_type": "sales",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        },
        {
          "id": 117359,
          "name": "Hola",
          "starts_at": "2019-07-29T12:00:00.000Z",
          "ends_at": "2019-12-31T15:00:00.000Z",
          "quantity": 100,
          "available": 100,
          "prices": {
            
          },
          "locked": false,
          "ticket_type": "rsvp",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        },
        {
          "id": 120323,
          "name": "Para federados",
          "starts_at": "2019-07-29T12:00:00.000Z",
          "ends_at": "2019-12-31T15:00:00.000Z",
          "quantity": 100,
          "available": 100,
          "prices": {
            "clp": 0
          },
          "locked": false,
          "ticket_type": "free",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        }
      ],
      "website_data": {
        "speakers": [
          
        ],
        "schedule": [
          
        ]
      }
    },
    {
      "id": 25587,
      "name": "prueba modal invitacion",
      "description": null,
      "starts_at": "2018-09-17T11:00:00.000Z",
      "ends_at": "2018-09-17T15:00:00.000Z",
      "locale": "en",
      "timezone": "Santiago",
      "state": "active",
      "url": "https://welcu.com/abel/prueba-modal-invitacion",
      "logo": null,
      "public": true,
      "real_state": "selling",
      "thumbnail_url": "https://welcu.com/images/default/business.png",
      "rating_avg": null,
      "ratings_enabled": true,
      "location": {
        "venue": "",
        "address": "",
        "city": "Stgo",
        "country": "CL",
        "lat": 0.0,
        "lng": 0.0
      },
      "company": {
        "id": 157695,
        "name": "abel"
      },
      "tickets": [
        {
          "id": 73804,
          "name": "Invitación",
          "starts_at": "2018-09-17T11:00:00.000Z",
          "ends_at": "2018-09-17T15:00:00.000Z",
          "quantity": 100,
          "available": 100,
          "prices": {
            
          },
          "locked": false,
          "ticket_type": "rsvp",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        },
        {
          "id": 73805,
          "name": "Publico",
          "starts_at": "2018-09-17T11:00:00.000Z",
          "ends_at": "2018-09-17T15:00:00.000Z",
          "quantity": 100,
          "available": 100,
          "prices": {
            "clp": 0
          },
          "locked": false,
          "ticket_type": "free",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        }
      ],
      "website_data": {
        "speakers": [
          
        ],
        "schedule": [
          
        ]
      }
    },
    {
      "id": 29482,
      "name": "spots-prueba",
      "description": null,
      "starts_at": "2019-03-25T11:00:00.000Z",
      "ends_at": "2019-08-28T16:00:00.000Z",
      "locale": "es",
      "timezone": "Santiago",
      "state": "active",
      "url": "https://welcu.com/abel/spots-prueba",
      "logo": null,
      "public": false,
      "real_state": "selling",
      "thumbnail_url": "https://welcu.com/images/default/sports.png",
      "rating_avg": null,
      "ratings_enabled": true,
      "location": {
        "venue": "",
        "address": "",
        "city": "",
        "country": "CL",
        "lat": 0.0,
        "lng": 0.0
      },
      "company": {
        "id": 157695,
        "name": "abel"
      },
      "tickets": [
        {
          "id": 96370,
          "name": "General",
          "starts_at": "2019-03-25T11:00:00.000Z",
          "ends_at": "2019-08-28T16:00:00.000Z",
          "quantity": 0,
          "available": 0,
          "prices": {
            "clp": 0
          },
          "locked": false,
          "ticket_type": "free",
          "location": {
            "venue": "",
            "address": "",
            "city": "",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        },
        {
          "id": 104534,
          "name": "Pre registro",
          "starts_at": "2019-03-25T11:00:00.000Z",
          "ends_at": "2019-08-28T16:00:00.000Z",
          "quantity": 100,
          "available": 99,
          "prices": {
            "clp": 0
          },
          "locked": false,
          "ticket_type": "free",
          "location": {
            "venue": "",
            "address": "",
            "city": "",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        }
      ],
      "website_data": {
        "speakers": [
          
        ],
        "schedule": [
          
        ]
      }
    },
    {
      "id": 30797,
      "name": "tests",
      "description": null,
      "starts_at": "2019-05-27T12:00:00.000Z",
      "ends_at": "2019-05-27T16:00:00.000Z",
      "locale": "en",
      "timezone": "Santiago",
      "state": "active",
      "url": "https://welcu.com/abel/tests",
      "logo": null,
      "public": true,
      "real_state": "selling",
      "thumbnail_url": "https://welcu.com/images/default/sports.png",
      "rating_avg": null,
      "ratings_enabled": true,
      "location": {
        "venue": "",
        "address": "",
        "city": "Stgo",
        "country": "CL",
        "lat": 0.0,
        "lng": 0.0
      },
      "company": {
        "id": 157695,
        "name": "abel"
      },
      "tickets": [
        {
          "id": 101700,
          "name": "General 1",
          "starts_at": "2019-05-27T12:00:00.000Z",
          "ends_at": "2019-05-27T16:00:00.000Z",
          "quantity": 5,
          "available": 3,
          "prices": {
            "clp": 0
          },
          "locked": false,
          "ticket_type": "free",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        },
        {
          "id": 101701,
          "name": "General 2",
          "starts_at": "2019-05-27T12:00:00.000Z",
          "ends_at": "2019-05-27T16:00:00.000Z",
          "quantity": 5,
          "available": 3,
          "prices": {
            "clp": 0
          },
          "locked": false,
          "ticket_type": "free",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        },
        {
          "id": 101702,
          "name": "General 3",
          "starts_at": "2019-05-27T12:00:00.000Z",
          "ends_at": "2019-05-27T16:00:00.000Z",
          "quantity": 5,
          "available": 3,
          "prices": {
            "clp": 0
          },
          "locked": false,
          "ticket_type": "free",
          "location": {
            "venue": "",
            "address": "",
            "city": "Stgo",
            "country": "CL",
            "lat": 0.0,
            "lng": 0.0
          }
        }
      ],
      "website_data": {
        "speakers": [
          
        ],
        "schedule": [
          
        ]
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}
