The Lexi Controller API includes the following functionality
/status - Intended for use with instances mode, GET a JSON encoded array of information about Lexi's status, including the Encoder's current access code, instance ID, and instance status. This status is pulled from the cloud server and should always accurately describe whether the instance is on or off.
curl http:///asr/api/status
JSON encoded data will be returned with the following format
{
"access_code":"<Access Code>",
"instance_id":"<Instance ID>",
"instance_state":"<Instance State>"
"icap_status":"<iCap Status>"
}
This set of endpoints can be used to enable and disable Lexi. An instance ID can be included to control a specific instance, or the instance currently configured on the encoder will be used by default. Including an instance ID will also switch the encoder to the instance's corresponding access code. To use Jobs mode, simply omit the instance ID. The /on and /off endpoints use the same mechanism as the Enable Lexi checkbox on the webpage, and response indicates the state of this checkbox rather than true Lexi status
/set-lexi/on - Enable currently configured instance
curl http:///asr/api/set-lexi/on
/set-lexi/off - Disable currently configured instance
curl http:///asr/api/set-lexi/off
To control a specific instance with ID instance_id, use
curl http:///asr/api/set-lexi/on/instance_id
curl http:///asr/api/set-lexi/off/instance_id
JSON encoded data will be returned with the following format if an instance ID is included, if it's omitted then only the "lexi" field will be returned. The JSON will be returned immediately, however it will take a few seconds for the changes to take effect.
{
"access_code":"<Access Code>",
"instance_id":"<Instance ID>",
"lexi":"<Instance State>"
}
The API can also be used to extend scheduled events past their previously scheduled end time, as long as the "Extend Scheduled Event" setting is checked.
/scheduled-event/extend - Extend current scheduled event
curl http:///asr/api/scheduled-event/extend
/scheduled-event/cancel - Stop extending event
curl http:///asr/api/scheduled-event/cancel
JSON encoded data will be returned if a valid request was made.
{
"success":"<Action>",
"status":"<Scheduling Status>",
}