Skip to main content

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​

  1. 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.
  2. Stop polling for job status. On REST, send a callback_url with each job and let SASHA post the finished job to you, as Set up callback notifications shows. On gRPC, follow each job with WatchJob. Polling spends your rate limit on status reads.
  3. Verify every callback. Check the Callback Payload Signature before you read the payload.
  4. Answer every callback correctly. Ignore a repeat delivery by its job_id, and answer at the callback_url itself, with no redirect, as Delivery and retries describes.
  5. 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.
  6. 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.
  7. Retry a submit only when no job was created. A submit that failed with 503, or with an UNAVAILABLE that 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 reason MEDIA_STAGING_FULL, after the Retry-After wait, as Media waiting to be processed describes, and the rate limit, as item 8 describes.
  8. Back off on rate limiting. A 429 with an HTML body on REST, or an UNAVAILABLE with 429 Too Many Requests in 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.
  9. Serve media from a URL SASHA can fetch. A media_url must be HTTPS, publicly reachable, and answer with the image itself. SASHA does not follow redirects, so a URL that answers with a 3xx fails the submit with 400. SASHA stops waiting for the image after 30 seconds, and the image must be within the supported formats and sizes.
  10. Download the protected image at once. output_url stops working at output_url_expires_at, one hour after the job completes. Store the image, its signature_id and its job_id in your own system.
  11. Page through the job list. GET /jobs and ListJobs return one page at a time. Read pages until a response comes back without next_page_token, as List your jobs shows, or you miss every job after the first page.
  12. 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​