yarn add @airlst/sdk
Set API key
import { Api } from '@airlst/sdk'
Api.setApiKey('YOUR_API_KEY')
Currently available methods:
Important: This method requires that API key must be company bound!
import { Event } from '@airlst/sdk'
const { data } = await new Event().list()
import { Event } from '@airlst/sdk'
const { data } = await new Event().get('event-uuid')
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').list({ page: 2, search: 'John' })
Method accepts following parameters:
Parameter | Type | Description |
---|---|---|
page |
number |
Page number |
perPage |
number |
Number of items per page |
search |
string |
Quick search |
filters |
array |
Filters arrays |
filters.*.field |
string |
Filter field e.g: extended_fields->field1 , booking:extended_fields->field1 |
filters.*.value |
string |
Filter field value |
filters.*.operator |
string |
Filter field operator. Optional. One of: eq (equal), neq (not equal), like , gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal). If operator is not provided eq will be used as default |
sorts |
array |
Sorts array |
sorts.*.field |
string |
Sort field |
sorts.*.direction |
string |
Sort field direction. One of: asc (ascending), desc (descending) |
sorts.*.order |
number |
Sort field order. Optional. Defines order/priority of the sort when sorting by multiple fields |
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').validatedCode('guest-code')
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').get('guest-code')
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').create({
status: 'confirmed',
contact: {
first_name: 'John',
last_name: 'Doe',
}
})
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').createCompanion('guest-code', {
contact: {
first_name: 'John',
last_name: 'Doe',
}
})
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').update('guest-code', { status: 'confirmed' })
import { Guest } from '@airlst/sdk'
await new Guest('event-uuid').archive('guest-code')
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').restore('guest-code')
import { Guest } from '@airlst/sdk'
await new Guest('event-uuid').delete('guest-code')
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').checkin('guest-code', {
type: Guest.CheckinType.CHECK_IN,
device: 'Mobile',
location: 'Munich',
timestamp: Math.round(+new Date() / 1000),
})
import { Guest } from '@airlst/sdk'
const { data } = await new Guest('event-uuid').createRecommendation('guest-code', {
status: 'confirmed',
contact: {
first_name: 'John',
last_name: 'Doe',
}
})
import { EmailTemplate } from '@airlst/sdk'
const { data } = await new EmailTemplate('event-uuid').list()
import { EmailTemplate } from '@airlst/sdk'
await new EmailTemplate('event-uuid').send('email-template-uuid',{
guests:[
"guest-code-1",
"guest-code-2"
]
})