Callbacks: Tracking the Shoot Lifecycle

The SpyneShootListener provides callbacks that notify you of various events during the shoot process. These callbacks are crucial for tracking and responding to the different stages of the shoot, such as when the shoot starts, completes, or exits.

You’ll implement the following callbacks to track the shoot’s initiation, completion, and exit. Let’s first explain the common parameters used across these callbacks, then dive into each callback’s details.


1. Common Parameters

All the callbacks (onShootInitiated, onShootCompleted, and onShootExit) use the following parameters:

ParameterTypeDescription
shootDataObjectContains details about the shoot (e.g., vehicle VIN, stock number, registration number).
dealerVinIdStringUnique identifier for the inventory record created for this shoot.
mediaIdStringUnique identifier for the shoot session (used to track media files).

2. Callbacks:

2.1. onShootInitiated

This callback is triggered when the shoot process starts. It provides the initial details about the shoot, including the status, inventory ID, and media ID.

Code Example:

override fun onShootInitiated(
    shootData: ShootData,
    dealerVinId: String,
    mediaId: String,
    status: String
) {
    Log.d(TAG, "onShootInitiated - ShootData: $shootData, dealerVinId: $dealerVinId, Media ID: $mediaId, Status: $status")
}

Description:

  • shootData: Contains all the details of the shoot (e.g., vehicle identifiers, shoot configuration).
  • dealerVinId: The ID for the inventory record created for this shoot in Spyne's system.
  • mediaId: Another unique ID that is created in the Spyne's sytem, mainly refers to the set the media files.
  • status: The status of the shoot (e.g., “Draft”, “In Progress”).

2.2. onShootCompleted

This callback is triggered when the shoot has finished. It provides details about the shoot, including whether it is a reshoot of a previous session.

Code Example:

override fun onShootCompleted(
    shootData: ShootData,
    dealerVinId: String,
    mediaId: String,
    isReshoot: Boolean
) {
    Log.d(TAG, "onShootCompleted - ShootData: $shootData, dealerVinId: $dealerVinId, Media ID: $mediaId, Is Reshoot: $isReshoot")
}

Description:

  • shootData: Contains all the details of the shoot (e.g., vehicle identifiers, shoot configuration).
  • dealerVinId: The ID for the inventory record created for this shoot in Spyne's system.
  • mediaId: Another unique ID that is created in the Spyne's sytem, mainly refers to the set the media files.
  • isReshoot: A boolean flag indicating whether this shoot is a reshoot (true) or a new shoot (false).

2.3. onShootExit

This callback is triggered when the shoot process is exited. It is useful for capturing when the user or system leaves the shoot process prematurely, either due to a manual exit or an error.

Code Example:

override fun onShootExit(
    shootData: ShootData,
    dealerVinId: String,
    mediaId: String
) {
    Log.d(TAG, "onShootExit - ShootData: $shootData, dealerVinId: $dealerVinId, Media ID: $mediaId")
}

Description:

  • shootData: Contains all the details of the shoot (e.g., vehicle identifiers, shoot configuration).
  • dealerVinId: The ID for the inventory record created for this shoot in Spyne's system.
  • mediaId: Another unique ID that is created in the Spyne's sytem, mainly refers to the set the media files.

3. Receiving the processed media

When processing completes, you can retrieve output via our Webhook or GET API. Use the dealerVinId from callbacks to match results.

→ View Retrieve Transformed Media for setup, payloads and examples.

Heads up: configure your webhook endpoint before going live. If you don’t use webhooks, you can poll the GET API with inventoryId/dealerVinId.

Webhook Guide


Key Takeaways

  • shootData, inventoryId, and mediaId are shared across all three callbacks (onShootInitiated, onShootCompleted, and onShootExit).
  • onShootInitiated: Fired when the shoot starts, logging the shoot’s status and initial details.
  • onShootCompleted: Fired when the shoot finishes, including whether it’s a reshoot.
  • onShootExit: Fired when the shoot is exited, either manually or due to an error.