Documentation
Using the Quick Freeze API
Adding records to a tray
2. Create a tray through the dashboard
- Each tray requires an endpoint that is unique to your account. Once a tray is created the endpoint cannot be changed.
- Set the Freeze Option
Quick Freeze: Once data a read from a tray, it is automatically deleted
Deep Freeze: Requires a paid plan - data can be read from a tray as many times as needed
3. Use your account token and tray endpoint to make a POST request with the record you’d like to freeze as the body of the request. Quick Freeze will turn it into an “ice cube” and store it.
Adding a record to a tray
const trayEndpoint = '{{tray_endpoint}}';
const data = {...record};

const response = await fetch(trayEndpoint, {
	method: 'POST',
	headers: {
		'Content-Type': 'application/json',
		'Authorization': 'Bearer {{account_token}}'
	},
	body: JSON.stringify(data)
});
Retrieve records from a tray
1. Use an account token and a tray's endpoint to construct a GET request.
- There are not "where" clauses in Quick Freeze. Executing a GET request will retrieve all the records in a tray.
2. Make sure you understand the Freeze Option for the tray
3. Add a Custom Setting to the body of the request if needed
deleteOnComplete: Use with Deep Freeze - this will delete the data once it is retrieved. If never used, data will remain in the tray until it reaches it's data retention setting
Retrieve records from a tray
const trayEndpoint = '{{tray_endpoint}}';

const customSettings = {
    // Use with Deep Freeze to delete fetched data.
    deleteOnComplete: true
}

const response = await fetch(trayEndpoint, {
    headers: {
		'Content-Type': 'application/json',
		'Authorization': 'Bearer {{account_token}}'
    },
	// body is only required when using custom settings
	body: JSON.stringify(customSettings)
  });
}
Quick Freeze vs Deep Freeze: Storage options

Depending on your subscription, when creating a tray you’ll have the option to select Deep Freeze or Quick Freeze. These two options control what happens to your data once it is successfully retrieved.

Quick Freeze

- Once data a read from a tray, it is automatically deleted

Retrieve data from a quick freeze tray
const url = 'https://quickfreeze.io/api/ice_cubes/';
const trayEndpoint = '{{tray_endpoint}}';

const response = await fetch(url+trayEndpoint, {
    headers: {
	  'Content-Type': 'application/json',
      'Authorization': 'Bearer {{account_token}}'
    }
  });
}
Deep Freeze

- Requires a paid plan: data can be read from a tray as many times as needed

- Deep Freeze data can be retrieved up to its data retention date. If you would like to delete the data before its expiration date, you can include an optional parameter in your request

Retrieve and delete data in a deep freeze tray
const trayEndpoint = '{{tray_endpoint}}';

const response = await fetch(trayEndpoint, {
    headers: {
	  'Content-Type': 'application/json',
      'Authorization': 'Bearer {{account_token}}'
    },
	// will delete the data in a Deep Freeze tray
	body: JSON.stringify({deleteOnComplete: true})
  });
}