NAV Navbar
shell

Introduction

Welcome to the Invajo API! You can use our API to access Events API endpoints, which can get information on your company's events, import and export guests information.

http://en-gb.invajo.com/api/invajo

Authentication

To authorize, use this code:

curl "http://en-gb.invajo.com/api/invajo" \
 -H "Authorization: invajo_api_key"

Make sure to replace invajo_api_key with your API key.

Invajo uses API keys to allow access to the API. You can register with Invajo to obtain an API key for your company.

Invajo expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: invajo_api_key

Events

Get All Events

curl "http://en-gb.invajo.com/api/invajo/events" \
 -H "Authorization: invajo_api_key"

The above command returns JSON structured like this:

[
    {
        "id": "5ea3bcc0-0e3d-11e7-a91b-e9e2da53a24a",
        "name": "New event",
        "start_date": "2017-04-20 00:00:00",
        "end_date": null,
        "state": "DRAFT",
        "address": {
            "country": "",
            "city": "",
            "street": "",
            "state": null,
            "postal_code": ""
        }
    }
]

This endpoint retrieves all events of organization.

HTTP Request

GET http://en-gb.invajo.com/api/invajo/events

Event Object Structure

Property Description
event.id The ID of the event in Invajo system
event.name Name of the event given by organizer
event.start_date Event start date
event.end_date Event end date (optional)
event.state State of the event (Published - for visible events, Draft - for non-visible events)
event.address Address object for the event
event.address.country Country of the event (empty string for Sweden)
event.address.city City of the event
event.address.street Address of the event
event.address.state State of the event
event.address.postal_code Postal code of the event

Get Guests of a an event

curl "http://en-gb.invajo.com/api/invajo/export-guests/event-id/EVENT_ID" \
 -H "Authorization: invajo_api_key"

The above command returns JSON structured like this:


[
    {
        "id": "90fe97d0-56b6-11e9-969b-a3a867fe8d5f",
        "fname": "John",
        "lname": "Doe",
        "email": "email@example.com",
        "phone": "+400000000000"
        "ticketCount": 1,
        "tickets": [
            {
                "id": "912509b0-56b6-11e9-874d-277565137e7b",
                "option": "31156cc0-56b6-11e9-a95e-d13ee7461241",
                "name": "Book Option 1",
                "questions": [
                    {
                        "id": "7bb6eae0-56b6-11e9-b482-997d70646aec",
                        "type": "TEXT",
                        "question": "Q1 - Open Response",
                        "answer": "123"
                    },
                    {
                        "id": "7bce7cd0-56b6-11e9-885b-c72b8f73fb55",
                        "type": "SELECT",
                        "question": "Q2 - Multiple Choice",
                        "answer": "Choice 1"
                    },
                    {
                        "id": "7bffc1c0-56b6-11e9-930e-29f0a604635b",
                        "type": "DATE",
                        "question": "Q3 - Date\/Calendar",
                        "answer": "2019-04-10"
                    },
                    {
                        "id": "7bffe780-56b6-11e9-ae63-c38f51dbfd27",
                        "type": "MULTISELECT",
                        "question": "Q4 - Multi response",
                        "answer": "Response 1, Response 2"
                    }
                ]
            }
        ]

    }
]

This endpoint retrieves a specific event's guests.

HTTP Request

GET http://en-gb.invajo.com/api/invajo/export-guests/event-id/<EVENT_ID>

URL Parameters

Parameter Description
EVENT_ID The ID of the event to retrive guests from

Guest Object Structure

Property Description
guest.id ID Of the guest in Invajo system
guest.fname First name of the guest
guest.lname Last name of the guest
guest.email Email address of the guest
guest.phone Phone number of the guest
guest.ticketsCount Number of tickets associated with this guest
guest.tickets Array of tickets purchased by this guest (can be empty)
guest.tickets[].id ID of the ticket
guest.tickets[].option ID of the Booking Option
guest.tickets[].name Name of the Booking Option
guest.tickets[].questions Array of Additional Questions for this ticket
guest.tickets[].questions[].id ID of the Additional Question
guest.tickets[].questions[].type Type of the Additional Question (TEXT/SELECT/DATE/MULTISELECT)
guest.tickets[].questions[].question Text of the question
guest.tickets[].questions[].answer Text of the Answer

Add Guest into specific event

curl -X POST "http://en-gb.invajo.com/api/invajo/add-guest/event-id/EVENT_ID" \
 -H "Authorization: invajo_api_key" \
 --data "fname=John&lname=Doe&email=john@doe.com&phone=+400000000000"

The above command returns JSON structured like this:



{
    "id": "90fe97d0-56b6-11e9-969b-a3a867fe8d5f",
    "fname": "John",
    "lname": "Doe",
    "email": "john@doe.com",
    "phone": "+400000000000"
    "result": "Added"
}

This endpoint adds a guest to a specific event.

HTTP Request

POST http://en-gb.invajo.com/api/invajo/add-guest/event-id/<EVENT_ID>

URL Parameters

Parameter Description
EVENT_ID The ID of the event to add guest to
fname First Name of the guest to add
lname Last Name of the guest to add
email Email address of the guest
phone Phone number including country code

Guest Object Structure

Property Description
guest.id ID Of the guest in Invajo system
guest.fname First name of the guest
guest.lname Last name of the guest
guest.email Email address of the guest
guest.phone Phone number of the guest
guest.result Result of adding operation (Added/Duplicate/Error)
guest.error Description of an error (e.g. Invalid email)

Please note, that this object is returned both if it was added or just found in the system.

Import guests into event

curl -X POST "http://en-gb.invajo.com/api/invajo/import-guests/event-id/EVENT_ID" \
 -H "Authorization: invajo_api_key" \
 -H "Content-Type: application/json" \
 --data '[{"fname": "John", "lname": "Doe", "email": "john@doe.com", "phone": "+400000000000"}]'

The above command returns JSON structured like this:


[
    {
        "id": "90fe97d0-56b6-11e9-969b-a3a867fe8d5f",
        "fname": "John",
        "lname": "Doe",
        "email": "john@doe.com",
        "phone": "+400000000000"
        "result": "Added"
    }
]

This endpoint imports a batch of guests to a specific event.

HTTP Request

POST http://en-gb.invajo.com/api/invajo/import-guests/event-id/<EVENT_ID>

URL Parameters

Parameter Description
EVENT_ID The ID of the event to retrive guests from

Importing Guest Object Structure

Property Description
guest.fname First name of the guest
guest.lname Last name of the guest
guest.email Email address of the guest
guest.phone Phone number of the guest

Resulting Guest Object Structure

Property Description
guest.id ID Of the guest in Invajo system
guest.fname First name of the guest
guest.lname Last name of the guest
guest.email Email address of the guest
guest.phone Phone number of the guest
guest.error Description of an error (e.g. Invalid email)

Errors

The Invajo API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The key requested an operation, that is not allowed by it's settings.