Create Event

Endpoint: /api/create_event.php

Method: POST

Request Body:

{
    "api_key": "your_api_key_here",
    "event_name": "Tech Conference 2024",
    "date_from": "2024-10-01",
    "date_to": "2024-10-03",
    "timeslot_duration": 30,
    "venues_activated": true,  // Set this to true if venues are needed for the event
    "event_days": [
        {
            "event_date": "2024-10-01",
            "time_from": "09:00:00",
            "time_to": "17:00:00"
        },
        {
            "event_date": "2024-10-02",
            "time_from": "09:00:00",
            "time_to": "17:00:00"
        },
        {
            "event_date": "2024-10-03",
            "time_from": "09:00:00",
            "time_to": "17:00:00"
        }
    ]
}

Response for Successful Event Creation

{
    "message": "Event created successfully",
    "event_id": "a5c1f67d8eab9f12dafe8c0b12345678",
    "event_name": "Tech Conference 2024",
    "date_from": "2024-10-01",
    "date_to": "2024-10-03",
    "timeslot_duration": 30,
    "venues_activated": true,
    "event_days": [
        {
            "event_date": "2024-10-01",
            "time_from": "09:00:00",
            "time_to": "17:00:00"
        },
        {
            "event_date": "2024-10-02",
            "time_from": "09:00:00",
            "time_to": "17:00:00"
        },
        {
            "event_date": "2024-10-03",
            "time_from": "09:00:00",
            "time_to": "17:00:00"
        }
    ]
}

Use this API to create an event with optional venue support. If venues_activated is set to true, the event will require venues for bookings.

Examples

Here are examples of how to create an event using different programming languages.

Python Example


import requests
import json

url = "https://eventinor.no/api/create_event.php"
data = {
    "api_key": "your_api_key_here",
    "event_name": "Tech Conference 2024",
    "date_from": "2024-10-01",
    "date_to": "2024-10-03",
    "timeslot_duration": 30,
    "venues_activated": True,
    "event_days": [
        {"event_date": "2024-10-01", "time_from": "09:00:00", "time_to": "17:00:00"},
        {"event_date": "2024-10-02", "time_from": "09:00:00", "time_to": "17:00:00"}
    ]
}
response = requests.post(url, data=json.dumps(data), headers={'Content-Type': 'application/json'})
print(response.json())
    

PHP Example



$url = "https://eventinor.no/api/create_event.php";
$data = array(
    "api_key" => "your_api_key_here",
    "event_name" => "Tech Conference 2024",
    "date_from" => "2024-10-01",
    "date_to" => "2024-10-03",
    "timeslot_duration" => 30,
    "venues_activated" => true,
    "event_days" => array(
        array("event_date" => "2024-10-01", "time_from" => "09:00:00", "time_to" => "17:00:00"),
        array("event_date" => "2024-10-02", "time_from" => "09:00:00", "time_to" => "17:00:00")
    )
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

    

.NET (C#) Example


using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        var url = "https://eventinor.no/api/create_event.php";
        var data = new
        {
            api_key = "your_api_key_here",
            event_name = "Tech Conference 2024",
            date_from = "2024-10-01",
            date_to = "2024-10-03",
            timeslot_duration = 30,
            venues_activated = true,
            event_days = new[]
            {
                new { event_date = "2024-10-01", time_from = "09:00:00", time_to = "17:00:00" },
                new { event_date = "2024-10-02", time_from = "09:00:00", time_to = "17:00:00" }
            }
        };
        using (var client = new HttpClient())
        {
            var json = Newtonsoft.Json.JsonConvert.SerializeObject(data);
            var content = new StringContent(json, Encoding.UTF8, "application/json");
            var response = await client.PostAsync(url, content);
            var result = await response.Content.ReadAsStringAsync();
            Console.WriteLine(result);
        }
    }
}
    

JavaScript (Node.js) Example


const axios = require('axios');

const url = 'https://eventinor.no/api/create_event.php';
const data = {
    api_key: 'your_api_key_here',
    event_name: 'Tech Conference 2024',
    date_from: '2024-10-01',
    date_to: '2024-10-03',
    timeslot_duration: 30,
    venues_activated: true,
    event_days: [
        { event_date: '2024-10-01', time_from: '09:00:00', time_to: '17:00:00' },
        { event_date: '2024-10-02', time_from: '09:00:00', time_to: '17:00:00' }
    ]
};
axios.post(url, data)
  .then(response => console.log(response.data))
  .catch(error => console.error(error));
    

Ruby Example


require 'net/http'
require 'uri'
require 'json'

url = URI.parse('https://eventinor.no/api/create_event.php')
data = {
    api_key: 'your_api_key_here',
    event_name: 'Tech Conference 2024',
    date_from: '2024-10-01',
    date_to: '2024-10-03',
    timeslot_duration: 30,
    venues_activated: true,
    event_days: [
        { event_date: '2024-10-01', time_from: '09:00:00', time_to: '17:00:00' },
        { event_date: '2024-10-02', time_from: '09:00:00', time_to: '17:00:00' }
    ]
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url.path, { 'Content-Type' => 'application/json' })
request.body = data.to_json
response = http.request(request)
puts response.body
    

Go (Golang) Example


package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://eventinor.no/api/create_event.php"
    data := map[string]interface{}{
        "api_key": "your_api_key_here",
        "event_name": "Tech Conference 2024",
        "date_from": "2024-10-01",
        "date_to": "2024-10-03",
        "timeslot_duration": 30,
        "venues_activated": true,
        "event_days": []map[string]string{
            {"event_date": "2024-10-01", "time_from": "09:00:00", "time_to": "17:00:00"},
            {"event_date": "2024-10-02", "time_from": "09:00:00", "time_to": "17:00:00"},
        },
    }
    jsonData, err := json.Marshal(data)
    if err != nil {
        fmt.Println(err)
        return
    }
    resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
    if err != nil {
        fmt.Println(err)
        return
    }
    defer resp.Body.Close()
    var responseData map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&responseData)
    fmt.Println(responseData)
}
    

Swift Example


import Foundation

let url = URL(string: "https://eventinor.no/api/create_event.php")!
let data: [String: Any] = [
    "api_key": "your_api_key_here",
    "event_name": "Tech Conference 2024",
    "date_from": "2024-10-01",
    "date_to": "2024-10-03",
    "timeslot_duration": 30,
    "venues_activated": true,
    "event_days": [
        ["event_date": "2024-10-01", "time_from": "09:00:00", "time_to": "17:00:00"],
        ["event_date": "2024-10-02", "time_from": "09:00:00", "time_to": "17:00:00"]
    ]
]
let jsonData = try! JSONSerialization.data(withJSONObject: data)
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = jsonData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
    guard let data = data, error == nil else {
        print("Error: \(error!)")
        return
    }
    if let jsonResponse = try? JSONSerialization.jsonObject(with: data, options: []) {
        print(jsonResponse)
    }
}
task.resume()
    

Perl Example


use strict;
use warnings;
use LWP::UserAgent;
use JSON;

my $url = 'https://eventinor.no/api/create_event.php';
my %data = (
    api_key => 'your_api_key_here',
    event_name => 'Tech Conference 2024',
    date_from => '2024-10-01',
    date_to => '2024-10-03',
    timeslot_duration => 30,
    venues_activated => \1,
    event_days => [
        { event_date => '2024-10-01', time_from => '09:00:00', time_to => '17:00:00' },
        { event_date => '2024-10-02', time_from => '09:00:00', time_to => '17:00:00' }
    ]
);
my $ua = LWP::UserAgent->new;
my $response = $ua->post(
    $url,
    'Content-Type' => 'application/json',
    Content => encode_json(\%data)
);
if ($response->is_success) {
    print $response->decoded_content;
} else {
    print "Error: ", $response->status_line, "\n";
}
    

Add Venue

Endpoint: /api/add_venue.php

Method: POST

Request Body:

{
    "api_key": "your_api_key_here",
    "event_id": "a5c1f67d8eab9f12dafe8c0b12345678",
    "name": "Main Hall",
    "capacity": 200,
    "description": "The largest hall available for main events."
}

Response:

{
    "message": "Venue added successfully",
    "venue_id": "c1d8e9bff6c8e7b50f09f1e231a6b879",
    "name": "Main Hall",
    "capacity": 200,
    "description": "The largest hall available for main events."
}

Add Exhibitor

Endpoint: /api/add_exhibitor.php

Method: POST

Request Body:

{
    "api_key": "your_api_key_here",
    "event_id": "a5c1f67d8eab9f12dafe8c0b12345678",
    "exhibitor_name": "Innovate Tech",
    "email": "contact@innovatetech.com",
    "phone": "1234567890",
    "externalID": "EX123456",
    "default_venue_id": "c1d8e9bff6c8e7b50f09f1e231a6b879"  
}

Response for Successful Addition

{
    "message": "Exhibitor added successfully",
    "exhibitor_id": 4564113,
    "exhibitor_name": "Innovate Tech",
    "email": "contact@innovatetech.com",
    "phone": "1234567890",
    "externalID": "EX123456",
    "default_venue_id": "c1d8e9bff6c8e7b50f09f1e231a6b879"
}

Book a Meeting

Endpoint: /api/book_meeting.php

Method: POST

Request Body:

{
    "api_key": "your_api_key_here",
    "event_id": "a5c1f67d8eab9f12dafe8c0b12345678",
    "exhibitor_id": 4564113,
    "participant_name": "John Doe",
    "participant_email": "john.doe@example.com",
    "company": "Tech Innovators",
    "job_title": "CTO",
    "externalID": "P12345",
    "booking_date": "2024-10-02",
    "booking_time": "13:00:00",
    "venue_id": "c1d8e9bff6c8e7b50f09f1e231a6b879"  
}

Response for Successful Booking

{
    "message": "Meeting booked successfully",
    "booking_id": 12345,
    "event_id": "a5c1f67d8eab9f12dafe8c0b12345678",
    "exhibitor_id": 4564113,
    "participant_id": 78910,
    "venue_id": "c1d8e9bff6c8e7b50f09f1e231a6b879",
    "booking_details": {
        "event": {
            "event_name": "Tech Conference 2024",
            "date_from": "2024-10-01",
            "date_to": "2024-10-03",
            "timeslot_duration": 30
        },
        "exhibitor": {
            "exhibitor_name": "Innovate Tech",
            "email": "contact@innovatetech.com",
            "phone": "1234567890"
        },
        "participant": {
            "participant_name": "John Doe",
            "participant_email": "john.doe@example.com",
            "company": "Tech Innovators",
            "job_title": "CTO",
            "externalID": "P12345"
        },
        "booking_date": "2024-10-02",
        "booking_time": "13:00:00"
    }
}

Response for Participant Conflict

{
    "message": "Conflict: Participant already has a booking at this time."
}

Response for Exhibitor Conflict

{
    "message": "Conflict: Exhibitor already has a booking at this time."
}

This API allows booking a meeting for a participant with an exhibitor at a specific date and time. It checks for conflicts to ensure neither the participant nor the exhibitor has overlapping meetings. If the event requires a venue, the exhibitor's default venue will be automatically selected if no venue is provided in the request.

List Meetings for an Exhibitor

Endpoint: /api/list_exhibitor_meetings.php

Method: GET

Request Parameters:

?exhibitor_id=4564113&api_key=your_api_key

Response for Successful Request

{
    "exhibitor_id": 4564113,
    "meetings": [
        {
            "booking_id": 12345,
            "event_id": "a5c1f67d8eab9f12dafe8c0b12345678",
            "event_name": "Tech Conference 2024",
            "participant_id": 78910,
            "participant_name": "John Doe",
            "participant_email": "john.doe@example.com",
            "participant_company": "Tech Innovators",
            "participant_job_title": "CTO",
            "participant_externalID": "P12345",
            "venue_id": "c1d8e9bff6c8e7b50f09f1e231a6b879",
            "venue_name": "Main Hall",
            "venue_capacity": 200,
            "venue_description": "The largest hall available for main events.",
            "booking_date": "2024-10-02",
            "booking_time": "13:00:00"
        }
    ]
}

Description: This API endpoint lists all the meetings scheduled for a specific exhibitor. The response includes detailed information about each booking, including the booking ID, event details, participant details, and venue information (if applicable).

Request Parameters:

Response:

List Meetings for a Participant

Endpoint: /api/list_participant_meetings.php

Method: GET

Request Parameters:

?participant_id=78910&api_key=your_api_key

Response for Successful Request

{
    "participant_id": 78910,
    "meetings": [
        {
            "booking_id": 12345,
            "event_id": "a5c1f67d8eab9f12dafe8c0b12345678",
            "event_name": "Tech Conference 2024",
            "exhibitor_id": 4564113,
            "exhibitor_name": "Innovate Tech",
            "exhibitor_email": "contact@innovatetech.com",
            "exhibitor_phone": "1234567890",
            "venue_id": "c1d8e9bff6c8e7b50f09f1e231a6b879",
            "venue_name": "Main Hall",
            "venue_capacity": 200,
            "venue_description": "The largest hall available for main events.",
            "booking_date": "2024-10-02",
            "booking_time": "13:00:00"
        }
    ]
}

Check Available Times

Endpoint: /api/available_times.php

Method: GET

Request Parameters:

api_key=your_api_key_here&exhibitor_id=2&date=2024-10-02

Response:

{
    "available_timeslots": [
        "09:00:00",
        "09:30:00",
        "10:00:00",
        "10:30:00",
        "11:00:00"
    ],
    "event_id": 1,
    "event_day": "2024-10-02",
    "time_from": "09:00:00",
    "time_to": "17:00:00"
}

This endpoint returns all available timeslots for a specific exhibitor on the requested event date, taking into account the event's day-specific schedule and already booked timeslots for that exhibitor.

List Exhibitors

Endpoint: /api/list_exhibitors.php

Method: GET

Request Parameters:

api_key=api_user_key_here&event_id=1

Response:

[
    {
        "exhibitor_name": "Company ABC",
        "email": "abc@example.com",
        "phone": "123456789",
        "externalID": "external_123"
    }
]

List Participants for an Event

Endpoint: /api/list_participants.php

Method: GET

Request Parameters:

api_key=your_api_key_here&event_id=1

Response:

[
    {
        "participant_id": 1,
        "participant_name": "John Doe",
        "participant_email": "john.doe@example.com",
        "company": "Tech Innovators",
        "job_title": "CTO",
        "externalID": "P12345",
        "event_id": 1
    }
]

Show Event Details

Endpoint: /api/event_details.php

Method: GET

Request Parameters:

api_key=api_user_key_here&event_id=1

Response:

{
    "event_name": "Conference 2024",
    "date_from": "2024-09-20",
    "date_to": "2024-09-22",
    "timeslot_duration": 30,
    "api_key": "event_api_key_here"
}

Update Event

Endpoint: /api/update_event.php

Method: POST

Request Body:

{
    "api_key": "api_user_key_here",
    "event_id": 1,
    "event_name": "Updated Conference 2024",
    "date_from": "2024-09-19",
    "date_to": "2024-09-21",
    "timeslot_duration": 45
}

Response:

{
    "message": "Event updated successfully"
}

Update Exhibitor

Endpoint: /api/update_exhibitor.php

Method: POST

Request Body:

{
    "api_key": "api_user_key_here",
    "exhibitor_id": 2,
    "exhibitor_name": "New Company ABC",
    "email": "newemail@abc.com",
    "phone": "987654321"
}

Response:

{
    "message": "Exhibitor updated successfully"
}

Update Participant

Endpoint: /api/update_participant.php

Method: POST

Request Body:

{
    "api_key": "api_user_key_here",
    "participant_id": 3,
    "participant_name": "Updated Jane Doe",
    "company": "New Tech Corp"
}

Response:

{
    "message": "Participant updated successfully"
}

Delete Event

Endpoint: /api/delete_event.php

Method: POST

Request Body:

{
    "api_key": "api_user_key_here",
    "event_id": 1
}

Response:

{
    "message": "Event deleted successfully"
}

Delete Exhibitor

Endpoint: /api/delete_exhibitor.php

Method: POST

Request Body:

{
    "api_key": "api_user_key_here",
    "exhibitor_id": 2
}

Response:

{
    "message": "Exhibitor deleted successfully"
}

Delete Participant

Endpoint: /api/delete_participant.php

Method: POST

Request Body:

{
    "api_key": "api_user_key_here",
    "participant_id": 3
}

Response:

{
    "message": "Participant deleted successfully"
}

Cancel Booking

Endpoint: /api/cancel_booking.php

Method: POST

Request Body:

{
    "api_key": "api_user_key_here",
    "booking_id": 1
}

Response:

{
    "message": "Booking cancelled successfully"
}

Search for a Participant

Endpoint: /api/search_participant.php

Method: GET

Request Parameters:

Response for Successful Request

{
    "participant_id": 78910,
    "participant_name": "John Doe",
    "participant_email": "john.doe@example.com",
    "company": "Tech Innovators",
    "job_title": "CTO",
    "externalID": "P12345"
}

Search for an Exhibitor

Endpoint: /api/search_exhibitor.php

Method: GET

Request Parameters:

Response for Successful Request

{
    "exhibitor_id": 4564113,
    "exhibitor_name": "Innovate Tech",
    "email": "contact@innovatetech.com",
    "phone": "1234567890",
    "externalID": "EX123456"
}