Skip to main content
POST
Record that a person collected a card

Authorizations

X-Pincast-Key
string
header
required

Your app's key, sent on every call from your server only. It reads pck_, your app id, an underscore, then a secret of 20 or more letters, digits, underscores or hyphens. Never put it in a web page, an app bundle or a query string. Placecard stores only its sha256.

Your app can hold two live keys at once, so a key is replaced with no outage: the new key works at once, and the old one keeps working until its expiry (seven days after the new key is made, unless you ask for less). A revoked key is refused from the next call.

X-Placecard-Key, the older name of this header, is taken too, at either address. Send one of the two; if both come and they differ, the call answers 400 key_conflict.

Headers

Idempotency-Key
string

Optional, on the three writes. A string your app makes for one request, a UUID for example, and sends again unchanged with each retry of that request. Placecard keeps the first 200 answer to it for 24 hours, for your app only. A retry with the same key and the same request (method, path and body; the order of keys in the body does not matter) answers that answer again, marked Idempotent-Replayed: true, and runs nothing. The same key with a different request answers 422. A refused call keeps nothing, so its retry runs again. 1 to 255 visible ASCII characters, with no spaces.

Pattern: ^[\x21-\x7E]{1,255}$

Path Parameters

set
string
required

Your set's id, chosen by your app. Lowercase letters, digits, underscores and hyphens, starting with a letter or digit, 64 characters at most.

Pattern: ^[a-z0-9][a-z0-9_-]{0,63}$

Body

application/json
card
required

The card's key, or the whole card to register or update it first.

Pattern: ^[A-Za-z0-9][A-Za-z0-9:_.-]{0,127}$
actor
object
required
at
string<date-time>

When it was collected, on your app's clock. Not more than five minutes ahead of Placecard's clock, and not before 2015. Leave it out for now.

lat
number
required if lng is set

Where it was collected. Sent with lng.

Required range: -90 <= x <= 90
lng
number
required if lat is set

Sent with lat.

Required range: -180 <= x <= 180
accuracy
number

How sure the place is, in metres.

Required range: x >= 0

Response

The collect is recorded. first is true when this collect's time is this person's first hold of the card: on their first collect, on a resend of it, and on a collect dated before their first. count is how many times they collected it directly.

collected
any
required
first
boolean
required

True when this collect's time is this person's first hold of the card, so a resend answers as the first send did.

count
integer
required

How many times this person collected the card directly.

Required range: x >= 1
collectedAt
string<date-time>
required

This person's first collect of the card.

card
object
required
parent
object | null
required

The parent card, held through this one; null when the card has none.