Create an Appointment
1 min
code examples curl request post \\ \ url https //developer digitail io/api/v1/appointments \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "clinic id" 1, "vet id" 1, "patient id" 1, "visit type id" 1, "datetime start utc" "2022 06 16t13 42 38z", "datetime end utc" "2022 06 16t14 42 38z" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "clinic id" 1, "vet id" 1, "patient id" 1, "visit type id" 1, "datetime start utc" "2022 06 16t13 42 38z", "datetime end utc" "2022 06 16t14 42 38z" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //developer digitail io/api/v1/appointments", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //developer digitail io/api/v1/appointments") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "clinic id" 1, "vet id" 1, "patient id" 1, "visit type id" 1, "datetime start utc" "2022 06 16t13 42 38z", "datetime end utc" "2022 06 16t14 42 38z" }) response = https request(request) puts response read body import requests import json url = "https //developer digitail io/api/v1/appointments" payload = json dumps({ "clinic id" 1, "vet id" 1, "patient id" 1, "visit type id" 1, "datetime start utc" "2022 06 16t13 42 38z", "datetime end utc" "2022 06 16t14 42 38z" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful operation { "data" { "id" 1, "event id" 0, "clinic id" 1, "room id" 0, "guest" false, "pet id" 1, "record id" 0, "status" "1", "datetime" "2022 06 16 15 12 38", "end datetime" "2022 06 16 15 42 38", "datetime start utc" "2023 12 01t09 00 00 000000z", "datetime end utc" "2023 12 01t10 00 00 000000z", "observations" "", "user note" "", "pet name" "", "owner name" "", "patient" {}, "room" {}, "event" { "id" 1, "address id" 1, "clinic id" 1, "capacity" 25, "date" "2022 06 16 15 12 38", "name" "event name", "preferences" "", "appointments number" 5, "visit types" \[ "" ] }, "vet" {}, "owner email" "", "owner phone" "", "reminder notifications" {}, "newrequests" \[ {} ], "consentforms" \[ {} ], "video link" "https //example com/1234235345 mp4", "notification message" "", "cancellation reason" "", "recurrence" "freq=daily;count=10", "has google cal error" false, "duration" 0, "occasion" "", "token" "", "visit type id" 0, "visit type" {}, "last confirmed at" "2023 12 01t09 00 00 000000z", "confirmed by" "client", "confirmation source" "sms reminder", "reconfirmed" false, "is reschedulable" false, "is cancelable" false, "drop off" { "id" 1, "time" "09 00", "vet id" 1, "appointment id" 1, "vet" {}, "datetime" "2023 12 01t09 00 00z" } } }