joinyclients v0.0.9
##JoinYClients API connection
Module can be use for YClients API connection
###Installing:
npm i joinyclients###Example:
const yclients=require("joinyclients");
const client=yclients.authorize('your_api_key','your_company_id');
const applointments=[{
"id": 1,
"services": [
3786376
],
"staff_id": 674179,
"datetime": "2019-08-16T13:00:00+04:00",
}];
const result=await client.WriteInToBookRecord(
380501900208,
'Imia Familia',
'testEmail@email.email',
'',
'Test',
'',
'0',
'0',
'0',
applointments,
);###Methods:
###yclients.authorize(api_token,id_company)
api_token{String}Token provided by YClientsid_company{Integer}Id company in YClients
###GetCategories()
return: on success Array of {Category} objects
###GetCategory(id)
id{Number}required:truecategory id
return: {Category} object
###GetServices()
return: Array with {Service} objects
###GetService(id)
id{Number}required:true
return: {Service} object
###GetServicesAvailableToRecord(datetime,service_ids,staff_id)
datetime{String}datetime in formatiso8601filter by datetimeservice_idsArray of{Numbers}filter by servicesstaff_id{Number}filter by staff
return: return Array of {Service} ,Array of {Category} return services and category what filtered and available now
###GetStaffs()
return: {Staff} object
###GetStaff(id)
id{Number}required:true
return: Array of {Staff} objects
###GetStaffsAvailableToRecord(datetime,service_ids,without_seances)
datetime{String}datetime in formatiso8601filter by datetimeservice_idsArray of{Number}filter by serviceswithout_seances{Boolean}Disables the issuance of the nearest free sessions, speeds up data acquisition.
return:Array of {Staff} objects
###WriteInToBookRecord(phone,fullname,email,code,comment,type,notify_by_sms,notify_by_email,api_id,appointments)
phone{String}{required:true}client phonefullname{String}{required:true}client fullnameemail{String}{required:true}client emailcode{String}Phone number verification code sent by SMS (needed only if it is necessary to confirm the number)comment{String}comment to recordtype{String}source of recordnotify_by_sms{Number}For what number of hours to send an SMS reminder about the recording (0 if you do not need to be reminded)notify_by_email{Number}For what number of hours to send an email reminder about the record (0 if you do not need to be reminded)api_id{String}External record identifierappointmentsarray with{Appointment}object{required:true}AppointmentRecord for each appointmentid{Number}services[Array of[Number]] array with id servicesstaff_id{Number}datetime{String}datetime in formatiso8601filter by datetime
return: Array of {RecordResult} object
###CheckingOnAvailableRecord(appointments)
appointmentsarray with{Appointment}object{required:true}AppointmentRecord for each appointmentid{Number}services[Array of[Number]] array with id servicesstaff_id{Number}datetime{String}datetime in formatiso8601filter by datetime
return:
###GetDateAvailableToRecord(datetime,service_ids,staff_id)
datetime {String} datetime in format iso8601 filter by datetime
service_idsArray of{Numbers}filter by servicesstaff_id{Number}filter by staff
return: {AvailableDays} object
##Link to API YClients:
https://yclients.docs.apiary.io