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, make jewelry designs from what they describe and those photos, and start projects from the designs they pick. The API comes with the Retail plan.
https://api.diamra.com/v1Call 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.
In this part
- API keysdmr_live_ keys from your Developer Console: send one in the Authorization header, keep it on your server, and revoke it at once if it leaks.
- AuthSign your customers up and log them in on your own website with an email and a password. Refresh and end sessions, and reset a forgotten password.
- ImagesUpload a customer's photo of a piece they like, or send a link to one: POST /v1/images answers an image id that a design can follow as a reference.
- DesignsMake jewelry designs from a customer's words, their photos, or both: POST /v1/designs answers the design's id at once, and GET /v1/designs/{id} returns its images.
- ProjectsStart a project from the design image a customer picks, list and search their projects, read one with its measurements, or delete it. Each opens on your Bench.
- HealthGET https://api.diamra.com/v1/health tells you whether the Diamra API is up. It needs no key and is never billed, so it suits uptime monitors.