curl --request POST \
--url https://api.pincast.fm/v1/sets/{set}/claims \
--header 'Content-Type: application/json' \
--header 'X-Pincast-Key: <api-key>' \
--data '
{
"from": "guest-7f3c9a2e5b41",
"to": "q8n2v5x7c1z4"
}
'const options = {
method: 'POST',
headers: {'X-Pincast-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({from: 'guest-7f3c9a2e5b41', to: 'q8n2v5x7c1z4'})
};
fetch('https://api.pincast.fm/v1/sets/{set}/claims', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pincast.fm/v1/sets/{set}/claims"
payload = {
"from": "guest-7f3c9a2e5b41",
"to": "q8n2v5x7c1z4"
}
headers = {
"X-Pincast-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"app": "demo",
"set": "central-park-trees",
"claimed": 2,
"moved": 2,
"merged": 0
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}Move a guest's cards to the person who just signed in
Your app vouches for both ids: it has signed the person in (to) and sent their sign-in token with POST /people, and it read this device’s guest token itself (from), never from what the person sent. Only cards collected as a guest move. A card the person already holds is merged into theirs (the earlier first collect, the later last collect, the counts added) and the guest’s copy is kept, marked as claimed.
Safe to send again until you hear back: a claim with nothing left to move answers claimed 0. With an Idempotency-Key, a retry answers the first answer instead (claimed 2, say).
curl --request POST \
--url https://api.pincast.fm/v1/sets/{set}/claims \
--header 'Content-Type: application/json' \
--header 'X-Pincast-Key: <api-key>' \
--data '
{
"from": "guest-7f3c9a2e5b41",
"to": "q8n2v5x7c1z4"
}
'const options = {
method: 'POST',
headers: {'X-Pincast-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({from: 'guest-7f3c9a2e5b41', to: 'q8n2v5x7c1z4'})
};
fetch('https://api.pincast.fm/v1/sets/{set}/claims', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pincast.fm/v1/sets/{set}/claims"
payload = {
"from": "guest-7f3c9a2e5b41",
"to": "q8n2v5x7c1z4"
}
headers = {
"X-Pincast-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"app": "demo",
"set": "central-park-trees",
"claimed": 2,
"moved": 2,
"merged": 0
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}{
"url": "<string>",
"statusCode": 499,
"statusMessage": "<string>",
"message": "<string>",
"stack": "<string>",
"data": {
"code": "key_missing",
"fix": "<string>",
"field": "<string>"
}
}Authorizations
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
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.
^[\x21-\x7E]{1,255}$Path Parameters
Body
Response
The claim is done. moved counts cards that moved; merged counts cards the person already held; claimed is the two added.