Introduction
We support webhook in Image to 3D.
The webhook URL can be set up in your profile page on 3d.csm.ai (opens in a new tab).
We expect a URL that accepts a POST request and the body of the request will be a JSON object with the following fields:
{
type: 'type of event',
payload: {
// payload of the event
}
}
Different values to types of events are:
spin_generate_processing
- Spin generation is going onspin_generate_done
- Spin generation is donespin_generate_failed
- Spin generation failedpreview_done
- Preview Mesh has been generatedpreview_failed
- Preview mesh generation failedrefine_done
- Refine mesh has been generatedrefine_failed
- Refine mesh generation failed
The payload will be different for different types of events.
Payload
Spin Generation
For a quick reference spin generation payload will look like:
{
session_id: 'SESSION_P_44569824122',
status: 'spin_generate_done',
spins: [ // Single Spin Url],
}
Preview Generation
For a quick reference preview generation payload will look like:
{
session_id: 'SESSION_P_44569824122',
status: 'preview_done',
preview_mesh_url: 'https://preview-mesh-url',
preview_mesh_url_fbx: 'https://preview-mesh-url-fbx',
selected_spin_index: 0,
}
Refine Generation
For a quick reference refine generation payload will look like:
{
session_id: 'SESSION_P_44569824122',
status: 'refine_done',
mesh_url: 'https://refine-mesh-url',
mesh_url_fbx: 'https://refine-mesh-url-fbx',
}