Approve a frame
const url = 'https://api.shootika.com/v1/frames/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/approval';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.shootika.com/v1/frames/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/approval \ --header 'Authorization: Bearer <token>'Approves a ready frame: it is saved as a photo on its product and is kept instead of expiring. On a Shopify store it is also added to the product in Shopify, which can take up to about 15 seconds, so allow for a slow answer.
A frame that is still queued or processing answers 409 not_ready. A failed or canceled frame answers 409 not_ready with a message telling you to shoot it again. A frame that is already approved answers 409 attach_conflict, and so does a frame whose approval is still running (the message says which). A frame that has expired and been deleted answers 409 result_purged.
Send an Idempotency-Key to make a retry safe. Only 2xx answers are stored and replayed, for 24 hours. A request still running under the same key answers 409 idempotency_in_progress, and a claim older than 5 minutes is treated as abandoned.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”A unique string you choose, 1 to 255 characters, for this request. Repeating the request with the same key and the same body replays the first answer for 24 hours instead of doing the work again. Only 2xx answers are stored. Using the same key with a different request answers 409 idempotency_conflict.
Responses
Section titled “Responses”The frame, now approved.
object
object
The frame this one retries, or null.
queued waiting to start, processing being made, ready finished, failed could not be made (and refunded), canceled stopped.
When an unapproved frame is deleted. Null once the frame is approved.
True when the frame failed, because a failed frame is always refunded. Null otherwise.
Example
{ "frame": { "status": "queued", "error": { "code": "generation_failed" } }}bad_request: the request could not be read, for example a multipart body with no boundary.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}unauthorized: the Authorization header is missing, or the key is not valid or has been revoked.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}api_not_enabled when the API is not switched on for your store yet, store_uninstalled when the store has uninstalled Shootika, or forbidden when the key is not allowed to do that.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}not_found: no frame with that id exists in your store.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}method_not_allowed: this address does not accept that method. The Allow header lists the ones it does.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}Headers
Section titled “Headers”not_ready when the frame is not finished, or failed, or was canceled; attach_conflict when it is already approved or its approval is still running; result_purged when it expired; approval_unavailable when it cannot be approved in this store; media_processing_failed when Shopify could not process it (try again); idempotency_conflict or idempotency_in_progress for the Idempotency-Key.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}rate_limited: more than 120 requests in a minute with this key. Wait the number of seconds in Retry-After.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}Headers
Section titled “Headers”internal_error: something went wrong on our side. Try again.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}service_busy: Shootika is busy right now. Try again in a moment.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}