Project.
The key's project, read-only. Today it answers one thing: how a device's data partition is chosen — the value that decides which records of a partitioned dataset it reads.
The partition rule
- The project's switch. Setup › Project › Data partition: use the app's list, in the portal. Off by default: a device's partition is typed freely, whatever the app's manifest says, and the answer is
enabled: falsewith nothing else. - On, the rule is the
partitionblock of the newest branch manifest that has one: itscaption(what the portal calls it — "Branch"), whether a devicerequireds one, and itsoptions. - Options written in the manifest —
[{"value": "31", "caption": "Bristol"}, "hub"]— answersource: "manifest". - Options fed by a dataset —
{"dataset": "branches", "value": "id", "caption": "name"}— are that dataset's records now:source: "dataset". Feed the dataset through the records API and the list follows at once; a branch opening is a record, not a commit. The dataset is declared in the same manifest and is not itself partitioned. A record without the value field is skipped, a repeated value keeps its first record, the list is sorted by caption, and at most 1000 come back. (Devices read this form of the manifest from ArdaPlayer v1.1.17.) - A device already set to a value that has left the list keeps it: nothing moves a device's partition for it.
- No write, on purpose. A project's settings are changed in the portal by a person looking at them; every method but
GETis405 BAD_METHOD, and the key areaprojecthasrand nothing else.
GET/v1/projectThe key's project: how a device's data partition is chosen
The partition rule as the portal draws it on a device's Setup. The first answer is the test project with its switch on and a manifest whose options are fed by a dataset of three branches.
Key scope project:r — read project
Answer 200 The partition rule
| Field | Type | |
|---|---|---|
partition | Project partition rule | What a device's setup offers as its DATA PARTITION — the value that decides which records of a partitioned dataset it reads — exactly as the portal draws it. Read-only: it is set by the project's switch in the portal and by the app's manifest.json. |
Errors
| Status | Word | When |
|---|---|---|
| 403 | OUT_OF_SCOPE | The key's scopes do not allow this area and verb (or this dataset, for records). A key edited before an area existed has no entry for it and is refused there until it is edited again in the portal. |
| 404 | NO_SPACE | No space with that id or slug in the key's project — in /v1/spaces/{space}, a space field or parameter, or the Arda-Space header. unassigned is no space (the devices in none). Another project's space answers the same, so nothing can be probed for. |
And, like every keyed call: NO_KEY BAD_KEY KEY_REVOKED KEY_EXPIRED ACCOUNT_INACTIVE NO_API_ACCESS RATE_LIMITED INTERNAL.
curl "https://api.ardaform.net/v1/project" \
-H "Authorization: Bearer $ARDA_KEY"const res = await fetch('https://api.ardaform.net/v1/project', {
headers: {
Authorization: `Bearer ${process.env.ARDA_KEY}`
}
})
const answer = await res.json()
if (!res.ok) throw new Error(`${res.status} ${answer.error.code}: ${answer.error.message}`)
console.log(answer)import os
import requests
r = requests.get(
"https://api.ardaform.net/v1/project",
headers={"Authorization": f"Bearer {os.environ['ARDA_KEY']}"},
)
answer = r.json()
if not r.ok:
raise RuntimeError(f"{r.status_code} {answer['error']['code']}: {answer['error']['message']}")
print(answer){
"partition": {
"enabled": true,
"caption": "Branch",
"required": true,
"options": [
{
"value": "31",
"caption": "Bristol"
},
{
"value": "40",
"caption": "Kings Heath"
},
{
"value": "12",
"caption": "Oldbury"
}
],
"source": "dataset"
}
}
With the switch off (the default)
curl "https://api.ardaform.net/v1/project" \
-H "Authorization: Bearer $ARDA_KEY"const res = await fetch('https://api.ardaform.net/v1/project', {
headers: {
Authorization: `Bearer ${process.env.ARDA_KEY}`
}
})
const answer = await res.json()
if (!res.ok) throw new Error(`${res.status} ${answer.error.code}: ${answer.error.message}`)
console.log(answer)import os
import requests
r = requests.get(
"https://api.ardaform.net/v1/project",
headers={"Authorization": f"Bearer {os.environ['ARDA_KEY']}"},
)
answer = r.json()
if not r.ok:
raise RuntimeError(f"{r.status_code} {answer['error']['code']}: {answer['error']['message']}")
print(answer){
"partition": {
"enabled": false,
"caption": null,
"required": false,
"options": null,
"source": null
}
}
Any write
curl -X PUT "https://api.ardaform.net/v1/project" \
-H "Authorization: Bearer $ARDA_KEY" \
-H "Content-Type: application/json" \
-d '{"partition":{"enabled":true}}'const res = await fetch('https://api.ardaform.net/v1/project', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.ARDA_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ partition: { enabled: true } })
})
const answer = await res.json()
if (!res.ok) throw new Error(`${res.status} ${answer.error.code}: ${answer.error.message}`)
console.log(answer)import os
import requests
r = requests.put(
"https://api.ardaform.net/v1/project",
headers={"Authorization": f"Bearer {os.environ['ARDA_KEY']}"},
json={"partition": {"enabled": True}},
)
answer = r.json()
if not r.ok:
raise RuntimeError(f"{r.status_code} {answer['error']['code']}: {answer['error']['message']}")
print(answer){
"error": {
"code": "BAD_METHOD",
"message": "Use GET; a project is changed in the portal, not through the API."
}
}
A key made before the project area existed
curl "https://api.ardaform.net/v1/project" \
-H "Authorization: Bearer $ARDA_KEY"const res = await fetch('https://api.ardaform.net/v1/project', {
headers: {
Authorization: `Bearer ${process.env.ARDA_KEY}`
}
})
const answer = await res.json()
if (!res.ok) throw new Error(`${res.status} ${answer.error.code}: ${answer.error.message}`)
console.log(answer)import os
import requests
r = requests.get(
"https://api.ardaform.net/v1/project",
headers={"Authorization": f"Bearer {os.environ['ARDA_KEY']}"},
)
answer = r.json()
if not r.ok:
raise RuntimeError(f"{r.status_code} {answer['error']['code']}: {answer['error']['message']}")
print(answer){
"error": {
"code": "OUT_OF_SCOPE",
"message": "This key may not read project.",
"area": "project",
"action": "r"
}
}
The shape
Project partition rule
What a device's setup offers as its DATA PARTITION — the value that decides which records of a partitioned dataset it reads — exactly as the portal draws it. Read-only: it is set by the project's switch in the portal and by the app's manifest.json.
| Field | Type | |
|---|---|---|
enabled | boolean | The project's "Data partition: use the app's list" switch, set in the portal. Off by default, and then a device's partition is typed freely, whatever the manifest says — caption, required, options and source are null or false. |
caption | string, nullable | The manifest's name for the partition ("Branch"). Null when the switch is off or the manifest gives none. |
required | boolean | Whether a device must be given one. Always false while the switch is off. |
options | array of object, nullable | The choices, {value, caption}: value is what a device's data partition holds, caption what a person picks. The manifest's own list, or — when its options names a dataset — that dataset's CURRENT records, so a record your feeder adds is a choice at once and a deleted one is not. A record without the value field is skipped, a repeated value keeps its first record, sorted by caption, at most 1000. Null when the switch is off or the manifest gives no list. A device already set to a value no longer listed KEEPS it; nothing moves a device's partition for it. |
source | string — manifest or dataset, nullable | Where options came from: manifest (a list written in it) or dataset (built from a dataset it names). Null with no options. |