Go live
Before you move from sandbox to production credentials, check your integration against this list. Each item prevents a failure that shows up only under real traffic.
Before you start
- An integration that protects or checks images with your sandbox credentials, as the quickstart does.
Checklist
- Switch to production credentials. Ask support@sasha.eu for your production Client ID and Client Secret, and replace the sandbox pair with them. The host stays
partner.api.sasha.eu, so nothing else changes. Keep both secrets on your servers, as Credentials describes. - Stop polling for job status. On REST, send a
callback_urlwith each job and let SASHA post the finished job to you, as Set up callback notifications shows. On gRPC, follow each job withWatchJob. Polling spends your rate limit on status reads. - Verify every callback. Check the Callback Payload Signature before you read the payload.
- Answer every callback correctly. Ignore a repeat delivery by its
job_id, and answer at thecallback_urlitself, with no redirect, as Delivery and retries describes. - Cache the access token. Reuse one token for every call, and renew it by the rule in When to renew. A token request per call wastes the rate limit and adds a round trip to each call.
- Retry a failed job only for
internal. The other job error codes are properties of the media, so the same media fails the same way. Jobs fail after the request succeeds lists them. - Retry a submit only when no job was created. A submit that failed with
503, or with anUNAVAILABLEthat is not a rate limit, may still have created the job, and a second submit can register a second Signature. Two refusals created no job, so the same request can be sent again: the reasonMEDIA_STAGING_FULL, after theRetry-Afterwait, as Media waiting to be processed describes, and the rate limit, as item 8 describes. - Back off on rate limiting. A
429with an HTML body on REST, or anUNAVAILABLEwith429 Too Many Requestsin its status message on gRPC, means the request was over the limit and did no work. Send it again after a random wait of up to 1 second, doubling that upper bound up to 60 seconds, and lower your request rate if it is still rejected, as Recover from a rejection describes. - Serve media from a URL SASHA can fetch. A
media_urlmust be HTTPS, publicly reachable, and answer with the image itself. SASHA does not follow redirects, so a URL that answers with a3xxfails the submit with400. SASHA stops waiting for the image after 30 seconds, and the image must be within the supported formats and sizes. - Download the protected image at once.
output_urlstops working atoutput_url_expires_at, one hour after the job completes. Store the image, itssignature_idand itsjob_idin your own system. - Page through the job list.
GET /jobsandListJobsreturn one page at a time. Read pages until a response comes back withoutnext_page_token, as List your jobs shows, or you miss every job after the first page. - Log
SASHA-Request-ID. Every response from the API carries it. Log it next to your own identifiers, as Log the request ID shows.
Get help
Email support@sasha.eu with the SASHA-Request-ID of the failing call, the job_id if a job failed, and the time of the call. A request rejected by the rate limit has no SASHA-Request-ID; send the time and the operation instead.
See also
- Handle API errors: read errors and decide what to retry
- Error handling: every status code and job error code
- Security and privacy: what SASHA keeps, and for how long