This topic will provide you with an overview of how to capture Snapshots with the Clickwrap API.
You can automatically capture Snapshots using our API on devices with native screenshot capabilities like mobile and smart devices. Like the Clickwrap snippet, you must embed a few simple pieces of code into your native applications.
Devices support screenshots in different ways depending on the operating system, device type, etc. For example, iOS offers the UIGraphicsGetImageFromCurrentImageContext() function. Ironclad does not actively update or monitor the evolution of screenshot functionality by native devices or their operating systems.
Snapshots captured with the API are captured the first time a valid user encounters the experience within the set frequency.
A basic overview of how to implement this is provided below. For more API implementation details, refer to our developer documentation.
Generate a Snapshot for a Native App Screen
Required Package: Growth, Pro, OR Custom
You can use your end user’s device to generate and capture a Snapshot for a native app Snapshot location. A Snapshot must be captured within 5 minutes of the initial GET request. The high-level steps follow, but refer to our developer documentation for detailed implementation details and examples.
- Perform a GET request to https://<response api domain>/load/json?group_key=<your group key>&site_id=<your site access id>&slo=<your site location key>.
- Look for the snapshot_params object. If the object is returned, a Snapshot needs to be taken.
- Perform a screenshot on the device using the operating system’s native APIs.
- Create a form-data post request using the snapshot_params object. Each field in the uploadParams.fields object must be a form-data field and be the exact value provided in the uploadParams object EXCEPT key.
- Construct the key object by taking the filename from uploadParams and add your file extension, including the required metadata properties within snapshot_params.metadataFields. The metadata values should use the value of snapshot_params.metadataFields as the field name. Note that the key must be the first value in the formdata object.
- Send the request. If this is being done in parallel, the app/script can continue functioning. Once the upload is complete, AWS will return a 204 status code. Any error you receive will be surfaced from AWS and be in XML format.
- Once the upload is complete it will be processed on the backend and updated in our database. No other actions are needed and there will be no other response from the API.