# Quickstart

For designers and integrators.

Integrators: create your account at [https://dapi.digital/integrator/sign-up](https://dapi.digital/integrator/sign-up).

The 3DAPI API lets sellers manage everything they do on the platform, and lets integrators build on top of it.

This guide takes you from no key to a first response. It takes about five minutes.

## The base URL

Every path in this API starts with `/v2`. The examples read the API base URL from `DAPI_API_URL` and your key from `DAPI_API_KEY`, so you can paste them as they are.

**Shell**

```bash
export DAPI_API_URL="<the API base URL>"
export DAPI_API_KEY="<your API key>"
```

All requests and responses are JSON over HTTPS.

## Get an API key

Create a key on the API keys page of your dashboard (designers: [https://dapi.digital/dashboard/public-api-keys](https://dapi.digital/dashboard/public-api-keys), integrators: [https://dapi.digital/integrator/api-keys](https://dapi.digital/integrator/api-keys)) and give it only the scopes your integration needs. Keep it on your server: anyone holding the key can act for your account.

Read [Authentication and scopes](https://public-api.dapi.digital/docs/guides/authentication.md) for what each scope allows.

## Make your first request

[Retrieve the current actor](https://public-api.dapi.digital/docs/reference/identity.md#get_me) answers with who the key belongs to and the scopes it carries. It is the quickest way to check that a key works.

**GET /v2/me (curl)**

```bash
curl "https://public-api.dapi.digital/v2/me" \
  -H "x-api-key: $DAPI_API_KEY"
```

**GET /v2/me (Node.js)**

```javascript
const response = await fetch(`${process.env.DAPI_API_URL}/v2/me`, {
  headers: {
    'x-api-key': process.env.DAPI_API_KEY,
  },
});
const data = await response.json();
```

**GET /v2/me (Python)**

```python
import os
import requests

response = requests.get(
    f"{os.environ['DAPI_API_URL']}/v2/me",
    headers={"x-api-key": os.environ["DAPI_API_KEY"]},
)
data = response.json()
```

**Response**

```json
{
  "object": "actor",
  "user_id": "44444444-4444-4444-8444-444444444444",
  "kind": "designer",
  "authenticated_with": "api_key",
  "scopes": [
    "order"
  ],
  "effective_scopes": [
    "orders:read",
    "orders:write"
  ],
  "approval": null
}
```

A `401` means the key is missing or wrong. Anything else follows the shape described in [Errors](https://public-api.dapi.digital/docs/guides/errors.md).

## Conventions

-   **Ids** are opaque strings with a type prefix, for example `prd_` for products and `var_` for variants. Store and compare them; never parse them.
-   **Money** is `{ "amount": 5000, "currency": "usd" }`: `amount` is an integer in the smallest currency unit (cents), so `5000` is $50.00. There are no decimal amounts anywhere in the API.
-   **Field names** are snake\_case. Every object has an `object` field naming its type. Timestamps are ISO 8601 in UTC.
-   **Missing values** are `null`; fields are never left out. The only exception is a field that appears only when requested with `expand[]`, which says so.

## Next steps

-   [Integrator onboarding](https://public-api.dapi.digital/docs/reference/integrator-onboarding.md): get your account approved so quotes are unlimited. (for integrators)
-   [Quotes](https://public-api.dapi.digital/docs/reference/quotes.md): price a model file for printing. (for integrators)
-   [Products](https://public-api.dapi.digital/docs/reference/products.md): create what you sell, with its designs and variants. (for designers)
-   [Orders](https://public-api.dapi.digital/docs/reference/orders.md): follow orders from every channel, or place your own. (for designers)
-   [Webhooks](https://public-api.dapi.digital/docs/guides/webhooks.md): hear about changes instead of polling for them. (for designers and integrators)

---

3DAPI API Docs. This page on the web: https://public-api.dapi.digital/docs/guides/quickstart. Index of every page: https://public-api.dapi.digital/docs/llms.txt.
