Event Appearances

CRUD endpoints for a user's event appearances

Please note that in all urls & code samples you'll need to replace:username and :corporation with appropriate values

Get All Event Appearances

GET /v2/organization/:corporation/expert/:username/eventappearance

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

Response

 {
  data: [
    {
      id: 1,
      title: 'Event Title',
      event_name: 'Event Name',
      location: 'Event Location',
      date: 0
    },
  ],
  success: true
}

Code

const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const events = data;
        console.log('all events', events)
    }

})
.catch(error => console.error(error));

Get Individual Event Appearances

GET /v2/organization/:corporation/expert/:username/eventappearance/:id

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

id

number

Event Appearance ID

Response

 {
  data: [
    {
      id: 1,
      title: 'Event Title',
      event_name: 'Event Name',
      location: 'Event Location',
      date: 0
    },
  ],
  success: true
}

Code

const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('event', data)
    }

})
.catch(error => console.error(error));

Create Event Appearances

POST /v2/organization/:corporation/expert/:username/eventappearance

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

Body

NameTypeDescription

title*

string

Event Title

event_name*

string

Event Name

location

string

Event Location

date

unix timestamp

Event Date

Response

{ 
    data: { 
        id: 1
    }, 
    success: true 
}

Code

const data = new URLSearchParams();
const accessToken = `<ACCESS CODE>`

data.append('title', 'My Event Title');
data.append('event_name', 'My Event Name...');
data.append('location', 'My Event Location');
data.append('date', 1341892800);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New event id', id)
    }

})
.catch(error => console.error(error));

Update Event Appearances

PUT /v2/organization/:corporation/expert/:username/eventappearance/:id

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

id

number

Event ID

Body

NameTypeDescription

title*

string

Event Title

event_name*

string

Event Name

location

string

Event Location

date

unix timestamp

Event Date

Response

{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}

Code

const data = new URLSearchParams();
const accessToken = `<ACCESS CODE>`

data.append('title', 'My Event Title');
data.append('event_name', 'My Event Name...');
data.append('location', 'My Event Location');
data.append('date', 1341892800);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated event id', id)
    }

})
.catch(error => console.error(error));

Delete Event Appearances

DELETE /v2/organization/:corporation/expert/:username/eventappearance/:id

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

id

number

Event ID

Response

{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}

Code

const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted event id', id)
    }

})
.catch(error => console.error(error));

Last updated