Skip to main content

Getting Started

Steps to obtain a token and make your first API call.

1. Client credentials

In the closed beta you use an issued client_id / client_secret (bound to a shop_id). Contact the operator if you have not been issued credentials.

2. Get an access token (client_credentials)

curl -s -X POST https://api.dev.developers.atouch.jp/v1/oauth/token \
--data-urlencode grant_type=client_credentials \
--data-urlencode client_id=YOUR_CLIENT_ID \
--data-urlencode client_secret=YOUR_CLIENT_SECRET \
--data-urlencode "scope=read_items"

Response:

{ "access_token": "eyJ...", "token_type": "Bearer", "expires_in": 3600, "scope": "read_items" }
Scope

The scope you request must be within the scopes granted to your client. Requesting beyond that returns 400 invalid_scope (see Authentication & Scopes).

3. List items

TOKEN=eyJ... # the access_token from above
curl -s "https://api.dev.developers.atouch.jp/v1/items?limit=2" \
-H "Authorization: Bearer $TOKEN"

4. Get an item

curl -s "https://api.dev.developers.atouch.jp/v1/items/1408" \
-H "Authorization: Bearer $TOKEN"

Reading errors

HTTPMeaning
401Missing / invalid token
403Insufficient scope (insufficient_scope)
404Resource not found for your shop
400Bad request (invalid_scope, etc.)

See the API Reference in the left menu for per-endpoint details.