Schedule a Patient Appointment

Log Patient In using SSO Token and Schedule An Appointment
Step 1: Obtain patient access token from POST /users/sso API call
The API will return you the token (data.token.token) look like this 66bcd0acff324e8a44992d9596b5d361. User's ID (data.id) will also be used as member_id later in Step 3.
curl --location 'https://api.vseepreview.com/vc/stable/api_v3/users/sso?fields=vsee' \
--header 'X-AccountCode: sandbox' \
--header 'X-ApiKey: 8acd6ac0a7193ad17f56ce694e94df2f' \
--header 'X-ApiSecret: 8ece42756425bb1ec31aee0f29d02a87' \
--header 'Content-Type: application/json' \
--data-raw '{
    "first_name": "VSee Edward",
    "last_name": "Patient Sandbox",
    "type": 200,
    "email": "edward+002.patient.sandbox@vseelab.com",
    "code": "edward+002.patient.sandbox@vseelab.com"
}'
Step 2: Get room information from room data GET /rooms/:code API
This API will return room information and consultations list to use in Step 3
curl --location 'https://api.vseepreview.com/vc/stable/api_v3/rooms/sandbox' \
--header 'X-AccountCode: sandbox' \
--header 'Content-Type: application/json' \'
Step 3: Create intake object via POST /intakes API
Use the SSO token from Step 1 in the X-ApiToken header field. You will get an intake ID in the response (data.id), e.g. 61165a8e-d8cc-47da-bd8e-597d64457b1f
curl --location 'https://api.vseepreview.com/vc/stable/api_v3/intakes' \
--header 'X-AccountCode: sandbox' \
--header 'X-ApiToken: {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": 1,
    "room_code": "sandbox",
    "reason_for_visit": "followup"
}'
Step 4: Get appointment available slots from GET /availability API
Use the SSO token from Step 1 in the X-ApiToken header field, consultation_id from step 2 (payment.consultations), intake_id from Step 3. You will get a list of slots.
curl --location 'https://api.vseepreview.com/vc/stable/api_v3/availability' \
-d member_id=183937 \
-d start=1725756794 \
-d end=1726361594 \
-d duration=900 \
-d consultation_id={{consultation_id}} \
-d intake_id={{intake_id}} \
--header 'X-AccountCode: sandbox' \
--header 'X-ApiToken: {{token}}' \
--header 'Content-Type: application/json' \
Step 5: Create a scheduled appointment visit via POST /visits API
Use the SSO token from Step 1 in the X-ApiToken header field and intake_id from Step 2. You will get a visit ID in the response (data.id) e.g. 67258
If your clinic is configured to use one time appointment links then the visit object will also contain data.one_time_link_token, e.g. f7gybzjd9o
curl --location 'https://api.vseepreview.com/vc/stable/api_v3/visits' \
--header 'X-AccountCode: sandbox' \
--header 'X-ApiToken: {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "member_id": "183937",
    "slot_start": "{{slot_start}}",
    "slot_end": "{{slot_end}}",
    "room_code": "sandbox",
    "intake_id": "{{intake_id}}",
    "type": 2
}'
Step 6: You can build a link using the format below and send it to the patient:
https://sandbox.vseepreview.com/vc/stable/members/appointment/{{visit_id}}?token={{one_time_link_token}}
Your Clinic Domain URL: https://sandbox.vseepreview.com/vc/stable