0.0.9 • Published 6 years ago

joinyclients v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

##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 YClients
  • id_company {Integer} Id company in YClients

###GetCategories()

return: on success Array of {Category} objects

###GetCategory(id)

  • id {Number} required:true category 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 format iso8601 filter by datetime

  • service_ids Array of {Numbers} filter by services

  • staff_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 format iso8601 filter by datetime

  • service_ids Array of {Number} filter by services

  • without_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 phone

  • fullname {String} {required:true} client fullname

  • email {String} {required:true} client email

  • code {String} Phone number verification code sent by SMS (needed only if it is necessary to confirm the number)

  • comment {String} comment to record

  • type {String} source of record

  • notify_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 identifier

  • appointments array with {Appointment} object {required:true}

    • Appointment Record for each appointment

      • id {Number}

      • services [Array of [Number]] array with id services

      • staff_id {Number}

      • datetime {String} datetime in format iso8601 filter by datetime

return: Array of {RecordResult} object

###CheckingOnAvailableRecord(appointments)

  • appointments array with {Appointment} object {required:true}

    • Appointment Record for each appointment

      • id {Number}

      • services [Array of [Number]] array with id services

      • staff_id {Number}

      • datetime {String} datetime in format iso8601 filter by datetime

return:

###GetDateAvailableToRecord(datetime,service_ids,staff_id)

datetime {String} datetime in format iso8601 filter by datetime

return: {AvailableDays} object ##Link to API YClients: https://yclients.docs.apiary.io

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago