Diamra Developer Docs
All pages

API

The API lets your server work with your store. The path carries the version: inside /v1 things are only added, never renamed or removed. Every call except Health takes an API key, which you create in your store's Developer Console. The first calls sign your customers up and log them in on your own website, keep the photos they send, list your store's catalog, make jewelry designs from what they describe, those photos and your products, and start projects from the designs they pick. The API comes with the Retail plan.

Base URLhttps://api.diamra.com/v1

Call it over HTTPS. A request over plain HTTP gets a 403 and is never redirected, so an http:// address fails on the first call instead of working while it sends your key in clear text.

Every response carries a Request-Id header. Quote it when you write to us about a call. Errors come as an error object with a type, a message in plain words and, where your code can act on it, a code to branch on. When one parameter is at fault, param names it.

Calls that take time

A design, an estimate and a new set of views take from a few seconds to about two minutes. The call that starts one answers at once, with a status of processing and a timing object. Ask for it again every few seconds until the status changes. A status means the same on all three:

StatusWhat to do
processing
It's still running. Show a countdown from timing, and ask again.
failed
It stopped. Stop asking. The call's page says what to do next.
Any other
It's done. The call's page says what each status means.
FieldWhat it is
timing.elapsed_ms
How long it has run, in milliseconds.
timing.expected_ms
How long one of its kind takes now, in milliseconds: the median of the last three made on Diamra.

The time left is expected_ms minus elapsed_ms. Some take longer than expected, so once elapsed_ms passes expected_ms, say it's almost ready instead of counting below zero. timing is null whenever the status isn't processing.

In this part