# Tor4You API Documentation Welcome to the Tor4You API documentation. Base URL: `https://www.tor4you.co.il/api/` Full interactive documentation: https://www.tor4you.co.il/api/docs --- ## Concepts & Terminology ### About Tor4You Tor4You is an online appointment scheduling platform that enables businesses to manage their bookings. Businesses can manage appointments directly through the Tor4You dashboard, and can also allow their customers to book appointments online via an embeddable widget or through the Tor4You API. ### Key Concepts **Site** — Each business account in Tor4You is called a site. A site is an independent tenant with its own users, calendars, appointments, customers, and settings. **Calendar Types** — There are two types of calendars: - **Open Calendar** — The business defines working hours, holidays, and staff availability. Appointments can be booked at any time the business is open, for any duration that fits within the service length. - **Timeslots Calendar** — The business creates specific time slots for each staff member. Appointments can only be booked on existing slots. Slots can accept any service (service=0) or be restricted to a specific service. Slots can be limited to one participant or allow multiple participants (a class/group). A slot can also be marked as unavailable using a lozamin service (see Lozamin below). **Branches** — A business may operate from a single location or multiple branches. When multiple branches exist, each staff member must be assigned to a specific branch. **Staff** — Staff members fall into two categories: - **Service providers** — Staff who have their own calendar and provide services to customers. These are identified by having a showorder value greater than 0. The showorder value also determines the display order — higher values are displayed first. Each service provider has their own availability schedule and a set of linked services they can perform. Appointments are always linked to a specific service provider's calendar and can only be booked if that provider is linked to the requested service. - **Administrative users** — Staff who have access to the system to perform management functions but do not provide services directly. **Services** — Services represent the types of appointments a business offers. Each service has attributes such as name, duration, and price. Services are linked to one or more staff members who can perform them. Services can be marked as internal (staff-only booking) or external (available for customer self-booking). **Customers** — Each appointment is associated with a single customer. An appointment may have multiple participants (for example, purchasing several tickets to an event), but it still belongs to one customer record. Customer uniqueness is determined by the combination of first name + cell phone number. For example, if a parent books an appointment under their own name using their cell number, one customer record is created. If the same parent books an appointment for their child (different first name, same cell number), a separate customer record is created. **Participants and Max Members** — An appointment can include one or more participants. In a timeslots calendar, each slot has a maxmembers value that defines the total number of participants the slot can accommodate across all appointments booked on that slot. For example, a slot with maxmembers=10 could have one appointment with 10 participants, two appointments with 5 participants each, or any other combination totaling up to 10. **Appointments in Timeslot Calendars** — When booking on a timeslots calendar, the appointment must be linked to a specific slot and must match the slot's date/time range and service. If the slot's service is set to 0 (any service), any of the staff member's linked services can be used. **Lozamin (Unavailable)** — A lozamin is a special appointment type used to block a time period or slot, marking it as unavailable. When a lozamin appointment is created, the system uses a dedicated site-specific "lozamin customer" rather than a real customer. This is useful for blocking time for breaks, maintenance, or other non-booking purposes. **Iscoming (Pre-Appointment Confirmation)** — Indicates whether a customer has confirmed in advance that they intend to attend their appointment. Values: 0 = not updated, 1 = confirmed attending, 2 = confirmed not attending. This is typically updated before the appointment takes place, for example via a reminder message. **Showstatus (Post-Appointment Attendance)** — Indicates whether the customer actually showed up for their appointment. Values: 0 = not updated, 1 = attended, 2 = no-show. This is updated after the appointment time has passed. ### Additional Terms **Conf / Vfib (Confirmation Tokens)** — Most objects in the system have both a numeric ID and a confirmation token (referred to as `conf` or `vfib` depending on the object type). These tokens serve as a security measure to prevent unauthorized modifications by guessing IDs alone. For example, an appointment might have apptid=123456 and conf="AE154A23B746DC21". When an object is created via the API, the response includes both the ID and the conf/vfib value. All subsequent operations on that object (update, delete) require both the ID and the matching conf/vfib value. List endpoints also return these values for each object, enabling further operations without additional lookups. **Status** — Objects in the system have a status field: 1 indicates active/live, and 0 indicates cancelled/inactive. **Extra Fields** — Appointments support up to 20 custom fields (af1–af20) and customers support up to 10 custom fields (cf1–cf10 / cx1–cx10). These can be configured per site to capture additional business-specific information. **Tz (ID Number)** — The `tz` field refers to the customer's Israeli ID number (Teudat Zehut). Some sites require this field for customer identification. When required, it must be unique across customers. **External Users (updateby=99)** — In webhook notifications, the `updateby` field indicates which staff member performed the action. A value of 99 indicates that the action was not performed by a staff member, but rather by a business customer using the external booking widget. --- ## Making API Calls ### Method API calls are made using GET, or POST with `Content-Type: application/x-www-form-urlencoded` as indicated in each endpoint description. ### Authorization All API calls need to be authenticated and authorized. There are two authorization methods: #### Method 1: API Key (recommended) Add a header called `torkey` with your API key: ``` torkey: 12345-skie75fytailksecRFaonsw3ehoaeWCrs9odin8Ysego48isoyfnHsw9nfvp8w32 ``` #### Method 2: Signed Parameters This method is more secure but more difficult to implement. Send the following parameters with each request: | Parameter | Description | |-----------|-------------| | siteid | Your siteid | | key | Your API public key | | dt | The date and hour the call is made (format: YYYYMMDDHHmm) | | sh | A digital SHA256 signature of: siteid + key + dt + apicall + your secret key | **Example:** Calling `addcust` on Dec 31, 2020 at 10:34AM with secret key "secret": - siteid: 123456 - key: abcdefg - dt: 202012311034 Signature: `SHA256("123456abcdefg202012311034addcustsecret")` = `2394f3d48822809e9942417686544704c1447eb3b20595d7465a7ff4658958cb` Full query: `tor4you.co.il/api/addcust?siteid=123456&key=abcdefg&dt=202012311034&p1=abcd&p2=efgh&p3=hijk&sh=2394f3d48822809e9942417686544704c1447eb3b20595d7465a7ff4658958cb` --- ## Responses All API responses are in JSON format. All responses return either status=1 for success, with additional information, or status=0, with an error message. **Successful response:** ```json { "status": "1", "siteid": "12345" } ``` **Unsuccessful response:** ```json { "status": "0", "message": "Bad credentials" } ``` --- ## Webhooks Tor4You can send an update to an endpoint on your system whenever an appointment is made, changed or deleted. You can activate and configure this option from the settings menu. Updates are made using POST in JSON format and include all of the relevant appointment information, together with an action: - 1 - create - 2 - update - 3 - cancel - 5 - expire If a webhook notification fails for any reason (does not return status 200), the system will retry after 2, 4, 8, 60, 120, 240, 960 and 1440 minutes, after which time the update will become inactive. You can reset the count from the settings menu. ### Webhook Fields | Field | Description | |-------|-------------| | id | ID of the webhook notification (not site specific) | | action | Appointment action: 1=create, 2=update, 3=cancel, 5=expire | | apptid | Unique appointment ID | | apptstatus | Appointment status: 1=live, 0=cancelled, 5=expired | | customerid | Unique customer ID | | showstatus | Did the customer show up: 0=not updated, 1=yes, 2=no | | iscoming | Did the customer confirm they are coming: 0=not updated, 1=yes, 2=no | | tmp_expire_date | Appointment will automatically expire if no action (such as payment) is taken | | af1 - af20 | Custom fields related to appointment | | cf1 - cf10 | Custom fields related to customer | | marketing | If customer agreed to receive marketing | | sh | A digital SHA256 signature of (id + the key shown in the settings menu) | | updateby | The staffid that made the update. 99 for external users (customer via booking widget) | **Sample Webhook Data:** ```json { "id": "123456", "status": "1", "recordupdatedate": "01/01/2021 20:00:00", "action": "1", "nextoutdate": "01/01/2021 20:00:00", "nexttrynum": "1", "Siteid": "1234", "apptid": "123456789", "apptstatus": "1", "From_date": "01/01/2021 13:30:00", "to_date": "01/01/2021 14:00:00", "customerid": "12345678", "serviceid": "123456", "staffid": "12345", "Mt_notes": "", "conf": "AEOPBS9MG7DB3DZT", "customerfirst": "משה", "customerlast": "כהן", "servicename": "פגישה", "staffname": "אבי שלו", "showstatus": "0", "iscoming": "0", "slotid": "123456789", "participants": "1", "customeremail": "a@a.com", "customercell": "0555555555", "customertz": "123456789", "tmp_expire_date": "12/08/2021 00:10:00", "ax1": "", "ax2": "", "ax3": "", "ax4": "", "ax5": "", "ax6": "", "ax7": "", "ax8": "", "ax9": "", "ax10": "", "ax11": "", "ax12": "", "ax13": "", "ax14": "", "ax15": "", "ax16": "", "ax17": "", "ax18": "", "ax19": "", "ax20": "", "cf1": "", "cf2": "", "cf3": "", "cf4": "", "cf5": "", "cf6": "", "cf7": "", "cf8": "", "cf9": "", "cf10": "", "marketing": "", "zoomcode": "", "snifid": "", "sh": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146a", "updateby": "12345" } ``` --- ## Endpoints ### Site Info — General - **URL:** `https://www.tor4you.co.il/api/siteinfo` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | **Sample Response:** ```json { "status": 1, "siteid": "12345", "busname": "עסק לדוגמה", "address": "קפריסין 10", "city": "תל אביב", "zip": "", "phone": "03-544-8485", "email": "service@tor4you.co.il", "created": "200101011010", "web": "https://www.tor4you.co.il", "ext_name": "Tor4You", "service_email": "service@tor4you.co.il", "service_phone": "03-544-8485", "usetimeslots": "True" } ``` --- ### Branches - **URL:** `https://www.tor4you.co.il/api/branches` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | showcancelled | numeric | no | default = 0 | **Sample Response:** ```json { "status": 1, "branches": [ { "id": "10792", "status": "1", "number": "101", "name": "דרום", "address": "", "city": "", "zip": "", "email": "", "phone": "", "waze": "" } ] } ``` --- ### Staff - **URL:** `https://www.tor4you.co.il/api/staff` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | showcancelled | numeric | no | default = 0 | **Sample Response:** ```json { "status": 1, "staff": [ { "id": "123456", "status": "1", "createdby": "123456", "first": "משה", "last": "כהן", "email": "moshe@tor4you.co.il", "cell": "0544444444", "admin": "1", "access": "2", "branch": "0", "zoomcode": "https://www.zoom.com/123456789" }, { "id": "1234567", "status": "0", "createdby": "123456", "first": "רינת", "last": "גבאי", "email": "rinat@tor4you.co.il", "cell": "0555555555", "admmin": "0", "access": "2", "branch": "0", "zoomcode": "https://www.zoom.com/12345" } ] } ``` --- ### Services - **URL:** `https://www.tor4you.co.il/api/services` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | showcancelled | numeric | no | default = 0 | **Sample Response:** ```json { "status": 1, "services": [ { "id": "12345678", "status": "1", "name": "לא זמין", "duration": "60", "price": "", "can_ext": "0", "ext_can_cancel": "0", "min_cancel_period": "180", "max_create_period": "90", "min_create_period": "180" }, { "id": "12345679", "status": "1", "name": "פגישה", "duration": "75", "price": "1", "can_ext": "1", "ext_can_cancel": "1", "min_cancel_period": "180", "max_create_period": "365", "min_create_period": "180" } ] } ``` --- ### Staff / Service - **URL:** `https://www.tor4you.co.il/api/staffservice` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | showcancelled | numeric | no | default = 0 | **Sample Response:** ```json { "status": 1, "staffservice": [ { "staff": "12345", "service": "123456", "status": "1" }, { "staff": "12345", "service": "1234567", "status": "1" } ] } ``` --- ### Slot Info - **URL:** `https://www.tor4you.co.il/api/slotinfo` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | slotid | numeric | yes | | **Sample Response:** ```json { "status": 1, "slot": [ { "id": "12345678", "created": "20000131101000", "cancelled": "", "status": "1", "from": "202001311010", "to": "202001311040", "staff": "12345", "services": "123456", "maxmembers": "1", "participants": "5", "zoomcode": "https://www.zoom.com/123456789", "vfib": "1234567890ABCDEF" } ] } ``` --- ### Add Slot - **URL:** `https://www.tor4you.co.il/api/addslot` - **Method:** POST | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | staff | numeric | yes | | | services | string | no | default = 0 (all services) | | from | YYYYMMDDhhmm | yes | | | to | YYYYMMDDhhmm | yes | | | maxmembers | numeric | no | default = 1 | | zoom | url | no | | **Sample Response:** ```json { "status": 1, "slot": [ { "id": "123456789", "created": "20200131103000", "cancelled": "", "status": "1", "from": "202011131200", "to": "202011131255", "staff": "12345", "services": "123456", "maxmembers": "5", "zoom": "", "vfib": "1234567890ABCDEF" } ] } ``` --- ### Delete Slot - **URL:** `https://www.tor4you.co.il/api/delslot` - **Method:** POST | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | slotid | numeric | yes | | | vfib | string | yes | | **Sample Response:** ```json { "status": 1 } ``` --- ### List Time Slots The call is limited to a maximum of 1000 time slots or 60 days. - **URL:** `https://www.tor4you.co.il/api/slotlist` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | showcancelled | numeric | no | 0 = no (default), 1 = yes | | from | YYYYMMDD | yes | | | to | YYYYMMDD | yes | | | service | numeric | no | | | staff | numeric | no | | **Sample Response:** ```json { "status": 1, "slots": [ { "id": "123456789", "status": "1", "from": "202010010730", "to": "202010010800", "staff": "12345", "staffname": "מטפל", "services": "123456", "maxmembers": "4", "participants": "3", "zoom": "", "vfib": "92DB91525CE1D835" } ] } ``` --- ### Appointment Info - **URL:** `https://www.tor4you.co.il/api/apptinfo` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | apptid | numeric | yes | | **Sample Response:** ```json { "status": 1, "appt": [ { "id": "123456789", "slotid": "123456789", "created": "20200131101000", "cancelled": "", "status": "1", "from": "202001311000", "to": "202001311030", "staff": "12345", "staffname": "משה כהן", "service": "12345", "servicename": "טיפול", "ax1": "", "ax2": "", "ax3": "", "ax4": "1", "ax5": "", "ax6": "", "ax7": "", "ax8": "", "ax9": "", "ax10": "", "ax11": "", "ax12": "", "ax13": "", "ax14": "1", "ax15": "", "ax16": "", "ax17": "", "ax18": "", "ax19": "", "ax20": "", "customertz": "", "customerid": "123456789", "customerfirst": "אלי", "customerlast": "ישראלי", "customeremail": "eli@gmail.com", "customercell": "0544444444", "cx1": "", "cx2": "1", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "", "vfib": "1234567890ABCDEF" } ] } ``` --- ### Appointment History - **URL:** `https://www.tor4you.co.il/api/appthistory` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | apptid | numeric | yes | | **Sample Response:** ```json { "status": 1, "history": [ { "id": "20265314", "recordupdatedate": "11/28/2023 4:55:24 PM", "updateaction": "3", "updatedby": "12345", "updateip": "1.1.1.1", "apptid": "12345678", "siteapptid": "5876", "status": "0", "From_date": "11/30/2023 4:00:00 PM", "to_date": "11/30/2023 5:00:00 PM", "customerid": "1234567", "tz": "", "custname": "משה כהן", "custemail": "", "custcell": "0555555555", "serviceid": "123456", "staffid": "12345", "createdate": "11/28/2023 4:55:11 PM", "canceldate": "11/28/2023 4:55:23 PM", "Mt_notes": "", "created_by": "12345", "servicename": "בדיקה", "staffname": "משה כהן", "updatedbyname": "משה כהן", "showstatus": "0", "color": "2", "recurid": "", "lastupdateby": "73", "invoiceid": "", "iscoming": "0", "iscoming_updated": "", "slotid": "27596587", "participants": "1", "tmp_expire_date": "" }, { "id": "20265313", "recordupdatedate": "11/28/2023 4:55:19 PM", "updateaction": "2", "updatedby": "12345", "updateip": "1.1.1.1", "apptid": "12345678", "siteapptid": "5876", "status": "1", "From_date": "11/30/2023 4:00:00 PM", "to_date": "11/30/2023 5:00:00 PM", "customerid": "1234567", "tz": "", "custname": "משה כהן", "custemail": "", "custcell": "0555555555", "serviceid": "123456", "staffid": "12345", "createdate": "11/28/2023 4:55:11 PM", "canceldate": "", "Mt_notes": "", "created_by": "12345", "servicename": "בדיקה", "staffname": "משה כהן", "updatedbyname": "משה כהן", "showstatus": "0", "color": "2", "recurid": "", "lastupdateby": "0", "invoiceid": "", "iscoming": "0", "iscoming_updated": "", "slotid": "27596587", "participants": "1", "tmp_expire_date": "" }, { "id": "20265312", "recordupdatedate": "11/28/2023 4:55:11 PM", "updateaction": "1", "updatedby": "12345", "updateip": "1.1.1.1", "apptid": "12345678", "siteapptid": "5876", "status": "1", "From_date": "11/30/2023 9:00:00 AM", "to_date": "11/30/2023 10:00:00 AM", "customerid": "1234567", "tz": "", "custname": "משה כהן", "custemail": "", "custcell": "0555555555", "serviceid": "123456", "staffid": "12345", "createdate": "11/28/2023 4:55:11 PM", "canceldate": "", "Mt_notes": "", "created_by": "12345", "servicename": "בדיקה", "staffname": "משה כהן", "updatedbyname": "משה כהן", "showstatus": "0", "color": "2", "recurid": "", "lastupdateby": "0", "invoiceid": "", "iscoming": "0", "iscoming_updated": "", "slotid": "27596580", "participants": "1", "tmp_expire_date": "" } ] } ``` --- ### Add Appointment - **URL:** `https://www.tor4you.co.il/api/addappt` - **Method:** POST | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | slotid | numeric | yes* | Specify slotid and vfib when using time slots, from and to dates otherwise | | vfib | string | yes* | Specify slotid and vfib when using time slots, from and to dates otherwise | | from | YYYYMMDDhhmm | yes* | Specify slotid and vfib when using time slots, from and to dates otherwise | | to | YYYYMMDDhhmm | yes* | Specify slotid and vfib when using time slots, from and to dates otherwise | | staff | numeric | yes | | | service | numeric | yes | | | islozamin | numeric | no | default = 0. If islozamin = 1 then all customer fields are ignored | | tz | numeric | yes* | Required when istz=2 | | first | string | yes | | | last | string | yes | | | email | string | no | Must be valid email | | cell | numeric | yes | 10 digits starting with 05 | | street | string | no | | | city | string | no | | | participants | numeric | no | default = 1 | | color | numeric | no | 0-9, default = 0 | | notes | string | no | | | ax1 - ax20 | string | no | If in use, appointment extra fields 1-20 | | cx1 - cx10 | string | no | If in use, customer extra fields 1-10 | | zoom | string | no | Specify only if not using time slots | | sendnotice | numeric | no | Applies notice settings from site | **Sample Response:** ```json { "status": 1, "appt": [ { "id": "123456789", "created": "20200131101000", "cancelled": "", "status": "1", "from": "202001311000", "to": "202001311030", "staff": "12345", "staffname": "משה כהן", "service": "12345", "servicename": "טיפול", "ax1": "", "ax2": "", "ax3": "", "ax4": "1", "ax5": "", "ax6": "", "ax7": "", "ax8": "", "ax9": "", "ax10": "", "ax11": "", "ax12": "", "ax13": "", "ax14": "1", "ax15": "", "ax16": "", "ax17": "", "ax18": "", "ax19": "", "ax20": "", "customertz": "", "customerid": "123456789", "customerfirst": "אלי", "customerlast": "ישראלי", "customeremail": "eli@gmail.com", "customercell": "0544444444", "cx1": "", "cx2": "1", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "", "vfib": "1234567890ABCDEF" } ] } ``` --- ### Delete Appointment - **URL:** `https://www.tor4you.co.il/api/delappt` - **Method:** POST | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | apptid | numeric | yes | | | vfib | string | yes | | | sendnotice | numeric | no | Applies notice settings from site | **Sample Response:** ```json { "status": 1 } ``` --- ### List Appointments Returns multiple appointments based on search criteria. The call is limited to a maximum of 1000 appointments or 60 days. **Important:** If you are using this endpoint to regularly retrieve the same queries (for example each hour getting all of today's appointments), you MUST use the last updated (lu) parameter. The lu parameter indicates the datetime of the latest information you already have. If there is no new information, the endpoint will return "no new information". For example: a call is made on 1/1/2020 12:34:56.000 to retrieve all of today's appointments. The endpoint will return the appointments and a parameter lu=20200101123456000. The next time the same call is made, it should include the parameter lu=20200101123456000. If there are changes after the lu value, the endpoint will return the information normally. If there are no updates, it will return "no new information". - **URL:** `https://www.tor4you.co.il/api/apptlist` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | format | numeric | no | 1 = short (default), 2 = long | | showcancelled | numeric | no | 0 = no (default), 1 = yes | | from | YYYYMMDD | yes (or use createdate) | Enter either from/to for appointment date, or createfrom/createto for appointment create date | | to | YYYYMMDD | yes (or use createdate) | Enter either from/to for appointment date, or createfrom/createto for appointment create date | | createfrom | YYYYMMDD | yes (or use appointment date) | Enter either from/to for appointment date, or createfrom/createto for appointment create date | | createto | YYYYMMDD | yes (or use appointment date) | Enter either from/to for appointment date, or createfrom/createto for appointment create date | | service | numeric | no | | | staff | numeric | no | | | customer | numeric | no | | | slotid | numeric | no | | **Sample Response:** ```json { "status": 1, "lu": "202001311200000000", "appts": [ { "id": "123456789", "slotid": "123456789", "status": "1", "from": "202010010730", "to": "202010010800", "staff": "12345", "staffname": "משה כהן", "service": "123456", "servicename": "טיפול", "cid": "12345678", "tz": "", "first": "אלי", "last": "ישראלי", "email": "", "cell": "0544444444", "vfib": "VFIBVFIBVFIBVFIB" } ] } ``` --- ### Current Appointment Lookup by Cell or Tz Performs a lookup of a customer's appointments. The default call returns the customer's appointments for the current day. To include past or future appointments, use the showpast or showfuture flags. The lookup can be performed by the customer's cell or tz. - **URL:** `https://www.tor4you.co.il/api/apptbycellortz` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | showcancelled | numeric | no | 0 = no (default), 1 = yes | | showpast | numeric | no | 0 = no (default), 1 = yes | | showfuture | numeric | no | 0 = no (default), 1 = yes | | cell | numeric | yes, or tz | 10 digits starting with 05 | | tz | numeric | yes, or cell | 9 digits | **Sample Response:** ```json { "id": "123456", "status": "1", "recordupdatedate": "01/01/2021 20:00:00", "action": "1", "nextoutdate": "01/01/2021 20:00:00", "nexttrynum": "1", "Siteid": "1234", "apptid": "123456789", "apptstatus": "1", "From_date": "01/01/2021 13:30:00", "to_date": "01/01/2021 14:00:00", "customerid": "12345678", "serviceid": "123456", "staffid": "12345", "Mt_notes": "", "conf": "AEOPBS9MG7DB3DZT", "customerfirst": "משה", "customerlast": "כהן", "servicename": "פגישה", "staffname": "אבי שלו", "showstatus": "0", "iscoming": "0", "slotid": "123456789", "participants": "1", "customeremail": "a@a.com", "customercell": "0555555555", "customertz": "123456789", "tmp_expire_date": "12/08/2021 00:10:00", "ax1": "", "ax2": "", "ax3": "", "ax4": "", "ax5": "", "ax6": "", "ax7": "", "ax8": "", "ax9": "", "ax10": "", "ax11": "", "ax12": "", "ax13": "", "ax14": "", "ax15": "", "ax16": "", "ax17": "", "ax18": "", "ax19": "", "ax20": "", "cf1": "", "cf2": "", "cf3": "", "cf4": "", "cf5": "", "cf6": "", "cf7": "", "cf8": "", "cf9": "", "cf10": "", "marketing": "", "zoomcode": "", "snifid": "", "sh": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146a", "updateby": "12345" } ``` --- ### Update Iscoming Status Updates whether a customer has responded that they will show up for a specific appointment. - **URL:** `https://www.tor4you.co.il/api/iscoming` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | apptid | numeric | yes | ID of appointment to be updated | | vfib | string | yes | vfib of appointment to be updated | | iscoming | numeric | yes | 0 = not updated, 1 = will show, 2 = will not show | **Sample Response:** ```json { "status": "1" } ``` --- ### Update Show Status Updates whether a customer has shown up for a specific appointment. - **URL:** `https://www.tor4you.co.il/api/showstatus` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | apptid | numeric | yes | ID of appointment to be updated | | vfib | string | yes | vfib of appointment to be updated | | showstatus | numeric | yes | 0 = not updated, 1 = show, 2 = noshow | **Sample Response:** ```json { "status": "1" } ``` --- ### Update Extra Fields Updates extra fields AF1 - AF20 of a specific appointment. - **URL:** `https://www.tor4you.co.il/api/updateaf` - **Method:** POST | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | apptid | numeric | yes | ID of appointment to be updated | | vfib | string | yes | vfib of appointment to be updated | | af1 - af20 | text | no | Send only the fields you wish to update. To set an empty value, send minus (-) | **Sample Response:** ```json { "status": "1" } ``` --- ### Customer Info - **URL:** `https://www.tor4you.co.il/api/custinfo` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | customerid | numeric | yes | | **Sample Response:** ```json { "status": 1, "customer": [ { "id": "12345678", "status": "1", "tz": "123456789", "first": "משה", "last": "כהן", "email": "moshe@tor4you.co.il", "cell": "0544444444", "street": "", "city": "", "cx1": "", "cx2": "", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "" } ] } ``` --- ### Add Customer - **URL:** `https://www.tor4you.co.il/api/addcust` - **Method:** POST | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | tz | numeric | no | Unique, required based on site settings | | first | string | yes | first + cell must be unique | | last | string | yes | | | email | string | no | | | cell | numeric | yes | first + cell must be unique | | street | string | no | | | city | string | no | | | cx1 - cx10 | string | no | | **Sample Response:** ```json { "status": 1, "customers": [ { "id": "12345678", "status": "1", "tz": "123456789", "first": "משה", "last": "כהן", "email": "moshe@tor4you.co.il", "cell": "0544444444", "street": "", "city": "", "cx1": "", "cx2": "", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "" }, { "id": "12345677", "status": "1", "tz": "123456788", "first": "משה", "last": "כהן", "email": "moshe1@tor4you.co.il", "cell": "0544444443", "street": "", "city": "", "cx1": "", "cx2": "", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "" } ] } ``` --- ### Edit Customer **Important:** Updating customer info will NOT trigger a webhook notice of customer's appointments. Not sending a field is equal to sending an empty field. For example if a customer's city is Tel Aviv and you send an update without specifying a new value for city, the city field will be updated with blank. - **URL:** `https://www.tor4you.co.il/api/editcust` - **Method:** POST | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | customerid | numeric | yes | | | tz | numeric | no | Unique, required based on site settings | | first | string | yes | first + cell must be unique | | last | string | yes | | | email | string | no | | | cell | numeric | yes | first + cell must be unique | | street | string | no | | | city | string | no | | | cx1 - cx10 | string | no | | **Sample Response:** ```json { "status": 1, "customers": [ { "id": "12345678", "status": "1", "tz": "123456789", "first": "משה", "last": "כהן", "email": "moshe@tor4you.co.il", "cell": "0544444444", "street": "", "city": "", "cx1": "", "cx2": "", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "" }, { "id": "12345677", "status": "1", "tz": "123456788", "first": "משה", "last": "כהן", "email": "moshe1@tor4you.co.il", "cell": "0544444443", "street": "", "city": "", "cx1": "", "cx2": "", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "" } ] } ``` --- ### Delete Customer - **URL:** `https://www.tor4you.co.il/api/delcust` - **Method:** POST | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | customerid | numeric | yes | | | vfib | string | yes | | **Sample Response:** ```json { "status": 1 } ``` --- ### List Customers The call is limited to a maximum of 500 customers. - **URL:** `https://www.tor4you.co.il/api/custlist` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | showcancelled | numeric | no | 0 = no (default), 1 = yes | | minid | numeric | no | | | maxid | numeric | no | | | mincreatedate | YYYYMMDD | no | | | maxcreatedate | YYYYMMDD | no | | | hasappointment | numeric | no | 1 = yes, 2 = no, blank = any | | hasfutureappointment | numeric | no | 1 = yes, 2 = no, blank = any | **Sample Response:** ```json { "status": 1, "customers": [ { "id": "12345678", "status": "1", "tz": "123456789", "first": "משה", "last": "כהן", "email": "moshe@tor4you.co.il", "cell": "0544444444", "street": "", "city": "", "cx1": "", "cx2": "", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "" }, { "id": "12345677", "status": "1", "tz": "123456788", "first": "משה", "last": "כהן", "email": "moshe1@tor4you.co.il", "cell": "0544444443", "street": "", "city": "", "cx1": "", "cx2": "", "cx3": "", "cx4": "", "cx5": "", "cx6": "", "cx7": "", "cx8": "", "cx9": "", "cx10": "" } ] } ``` --- ### List Customer Appointments The call is limited to a maximum of 25 appointments. - **URL:** `https://www.tor4you.co.il/api/custappts` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | showcancelled | numeric | no | 0 = no (default), 1 = yes | | showpast | numeric | no | 0 = no (default), 1 = yes | | tz | numeric | yes* | 9 digits. Either customerid or tz or first name and cell must be provided | | first | string | yes* | Either customerid or tz or first name and cell must be provided | | cell | numeric | yes* | 10 digits starting with 05. Either customerid or tz or first name and cell must be provided | | customerid | numeric | yes* | Either customerid or tz or first name and cell must be provided | **Sample Response:** ```json { "status": 1, "appointments": [ { "id": "12345678", "tz": "123456789", "first": "משה", "last": "כהן", "email": "test@tor4you.co.il", "cell": "0544444444", "ax1": "", "ax2": "", "ax3": "", "ax4": "", "ax5": "", "ax6": "", "ax7": "", "ax8": "", "ax9": "", "ax10": "", "ax11": "", "ax12": "", "ax13": "", "ax14": "1", "ax15": "", "ax16": "", "ax17": "", "ax18": "", "ax19": "", "ax20": "", "from": "202010010730", "to": "202010010830", "serviceid": "123456", "service_name": "טיפול", "stuff": "12345", "staffname": "nypk", "status": "1", "mt_notes": "", "createdate": "202010010630", "canceldate": "" } ] } ``` --- ### Subscription Info - **URL:** `https://www.tor4you.co.il/api/subinfo` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | customerid | numeric | yes | | **Sample Response:** ```json { "status": 1, "customerid": 1234567, "customername": "משה כהן", "sub": [ { "subid": "12345", "status": "1", "subname": "מנוי זוגי 3 פגישות", "servicename": "פגישה", "fromdate": "01/01/24", "todate": "01/01/50", "credits": "0", "totalappts": "3" } ] } ``` --- ### Subscription Usage - **URL:** `https://www.tor4you.co.il/api/subusage` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | subid | numeric | yes | | **Sample Response:** ```json { "status": 1, "subid": 12345, "usage": [ { "fromdate": "01/10/24 09:15", "todate": "01/10/24 10:15", "serviceid": "12345", "servicename": "פגישה", "staffid": "12345", "staffname": "משה כהן" }, { "fromdate": "01/11/24 19:15", "todate": "01/11/24 20:15", "serviceid": "12345", "servicename": "פגישה", "staffid": "12345", "staffname": "משה כהן" } ] } ``` --- ### Availability This endpoint is used to find available time slots or appointment times based on specific criteria. The availability returned is according to rules that apply to external customers (for example minimum and maximum time periods, external services, etc.). The call is limited to a maximum of 500 available spots or 31 days (60 days for timeslot accounts). To enable selection of dates first, set the dateonly parameter to 1. The endpoint will return all available dates. After the user selects a date, send dateonly=0 and the requested date to get available times. When not using slots, the openhours returned are unique and randomly distributed among the available staff to ensure equal allocation. For example if there are five available staff at the same date, only one will be selected randomly and shown. - **URL:** `https://www.tor4you.co.il/api/availability` - **Method:** GET | Parameter | Type | Required | Comments | |-----------|------|----------|----------| | authentication parameters | | no | Required only when using signed parameters method | | from | YYYYMMDD | yes | | | to | YYYYMMDD | yes | | | service | numeric | yes | | | staff | numeric | no | | | branch | numeric | no | | | participants | numeric | no | default = 1 | | dateonly | numeric | no | default = 0. Whether to return only dates or all available dates and times | | internal | numeric | no | default = 0. Whether to allow services that external users are not allowed to book | **Sample Response (dateonly=1):** ```json { "status": 1, "dates": [ "20201109", "20201110" ] } ``` **Sample Response (dateonly=0, using slots):** ```json { "status": 1, "slots": [ { "id": "123456788", "vfib": "VFIBVFIBVFIBVFIB", "from": "202011091600", "to": "202011091650", "staff": "12345" }, { "id": "123456789", "vfib": "VFIBVFIBVFIBVFIB", "from": "202011091600", "to": "202011091700", "staff": "12345" } ] } ``` **Sample Response (dateonly=0, without slots):** ```json { "status": 1, "duration": 30, "openhours": [ { "staff": "12345", "date": "202011091600" }, { "staff": "12346", "date": "202011091630" } ] } ``` --- ## Contact For technical support, usage limits, bugs, special requests, or custom options, contact: api@tor4you.co.il