The REST API Callback allows to connect external end-points in order to receive callback events sent by the guiding and/or focusing loops.


The structure of JSON callback message is standard. 


The JSON response is structured as following:

Field

Description

status

“success” if event indicate a successful result

“error” in case of error

event

The name of the event who fired the callback

data

null if there is no data, otherwise the data returned by the method. It can be a boolean value, or a complex data structure.

message

null if there is no message, otherwise a string containing the message.


Event

Description

SKSS_GuiderCalibration

Event sent during the guider calibration process

SKSS_FocuserCalibration

Event sent during the focuser calibration process

SKSS_CameraOutputViewUpdated

Event sent when the guider frame has been pre-processed and displayed on the camera output viewport

SKSS_GuidingReferenceViewUpdated

Event sent when the guider reference frame has been updated on the reference viewport

SKSS_GuidingCorrelationCompleted

Event sent when the guider correlation has been completed. 

SKSS_FocusingCorrelationCompleted

Event sent when the focuser correlation has been completed.

SKSS_GuiderCameraStatusChanged

Event sent when the guider camera loop status has changed

SKSS_GuidingStatusChanged

Event sent when the basic guiding status has changed

SKSS_GuidingLoopStatusChanged

Event sent when the advanced guiding status has changed

SKSS_FocusingStatusChanged

Event sent when the basic focusing status has changed

SKSS_FocusingLoopStatusChanged

Event sent when the avanced focusing status has changed


As an example, a Powershell script is distributed with the SkySurveyor installation package. 

The script be found here: “SkyGuard_x86_ASCOM64_MDL6_v3.3.0000.00000\SDK\RESTCallbackListener.ps1


This example creates a HTTP request listener on port 8000.


Before running the powershell do the URL reservation with the netsh.exe command with the following command:



netsh http add urlacl url=http://+:18700/ user=DOMAIN\user



To make the URL reservation and Windows Command Prompt “CMD.exe” must be opened as administrator.

UAC requires administrator access. If the account does not have administrator privileges, an administrator user and password will be necessary to continue.

See http://go.microsoft.com/fwlink/?LinkId=70353 for details.

Once the URL reservation is done, the REST callback listener can be started by running the powershell script in the following screen capture:

To end the HTTP callback listener execution, do not stop the script, invoke the following URL via an internet browser or via Powershell Invoke-Request command: http://localhost:8000/end$