GetAvailableTimeSlots
Retrieve a list of time slots available for new appointments. Can be filtered by doctor, location and visit type.
Alias: getTimeSlots
Call example:
string result = SageBridgeAPI.executeAPICall(
"cf389659-588c-4fd9-ab9e-7c37b438905c", // security token
"GetAvailableTimeSlots",
"bos5", // practice Path or Tax ID
"JSON", // output format (XML or JSON)
"--request parameters XML or JSON---" // request parameters
);
Request parameters:
Request parameter JSON string representing set of fields:
| startdate | (string) | Appointment dates range begin. |
| enddate | (string) | Appointment dates range end. |
| facilityid | (string) | Time slots for a given location.
|
| providerId | (string) | Time slots for a given provider. |
| visitTypeId | (string) | Time slots for a given visit type. |
| timeofday | (string) | 1-AM only, 2-PM only, 3-any time. |
| times | (string) | false - available dates only, true - full date time. |
| limit | (string) | integer value to limit number of slots to get. ("-1" - no limit) |
- Number of returned time slots can be limited even if limit parameter value set to "-1". Please contact Sophrona support for more details
JSON string request example:
{
"startdate":"08/17/2015",
"enddate":"08/18/2015",
"providerId":"15",
"visittypeId":"3",
"facilityId":"17",
"timeofday":3,
"times":false,
"limit":100
}
Response:
XML or JSON string representing APIResponse structure.
APIResponse payload element may be encrypted and delivered as Base64 string.
Payload element of APIResponse is a list of available time slots
WARNING: visitTypeId, providerId, facilityId output fields are populated for some practices only.
XML Response Example:
JSON Response Example:
[
{"startTime":"2015-09-08 16:10", "endTime":"2015-09-08 16:25", "visitTypeId":"3", "providerId":"15", "facilityId":"17"},
{"startTime":"2015-09-08 16:15", "endTime":"2015-09-08 16:30", "visitTypeId":"3", "providerId":"15", "facilityId":"17"},
{"startTime":"2015-09-08 16:30", "endTime":"2015-09-08 16:45", "visitTypeId":"3", "providerId":"15", "facilityId":"17"}
... etc ...
]
Call example (C#):
For the source code of working example see testGetAvailableTimeSlots() method in SageBridgeApiCallExecutor class of SageBrige.API.Tester project can be downloaded here.
Possible return values (see APIResponse )
- 0 - Success. Description can be vary per function
- -1 - General error. Description attribute will show more details about an error
- -2 - Function is not supported
- 500 - Invalid credentials provided
- 501 - License is expired
- 502 - License is not active
- 503 - Token is not active or expired
- 550 - Unknow functionName or not subscribed
- 551 - Unknown practice
- 552 - No Subscription found
- 553 - Subscription is inactive or expired
- 600 - Invalid or empty request parameters
- 601 - No valid route found for this subscription
- 602 - Unable to parse request parameters
This function may return other codes not listed above; they may vary by practice.
Notes:
All examples of source code and compiled version of SageBridge API can be found here.
Known Issues:
None
See Also:
API Functions,
APIResponse structure