Requests to the SparkAI service can be made with one simple REST call. For users with an established program
, all that is required in a new engagement
request is a pointer to the content.
Polling flow
- (Optional) Upload an image file to the SparkAI image server by making a
POST
request to the/v1/image
route, storing the location URL for use in future API calls. - Make an API call to
POST
to theengagement
path, supplying either aprogram_name
orinstructions
, and acontent_location
. This API call will return atoken
. - Periodically poll the
engagement
resource using the returnedengagement
for status.
Webhook flow
- (Optional) Upload an image file to the SparkAI image server by making a
POST
request to the/v1/image
route, storing the location URL for use in future API calls. - Make an API call to
POST
to theengagement
path, supplying either aprogram_name
orinstructions
, and acontent_location
. This API call will return atoken
. - When the
engagement
changes status, the SparkAI service willPOST
theresolution
to a provided URL.