JSONObject¶
A JSONObject keeps a JSON document of your own type: objectType names the type (for example
checkout-form), namespace groups your types, and data holds the document, any JSON object up to 256 KB.
dataSchema can name a JSON Schema your apps follow; ObjectsGrid stores it and doesn't check it. Lists filter on
objectType, namespace, name and tags; data is returned, not searched.
Use a GenericObject instead when you want typed attributes you can filter on, and a built-in type when one fits.
JSON Schema ยท ABAC object type JSONObject
Example¶
Create one with POST /jsonobjects:
{
"objectType": "checkout-form",
"namespace": "com.example.shop",
"name": "Checkout",
"data": {
"fields": [
{
"name": "email",
"type": "email",
"required": true
}
],
"version": 3
}
}
Fields¶
Required: objectType, data.
| Field | Type | Required | Description |
|---|---|---|---|
at_type |
JSONObject |
JSON-LD @type, the object's type name. |
|
at_id |
URL | The object's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>, its JSON-LD @id: what References to it hold. Assigned by ObjectsGrid. |
|
id |
string | The object's id. Assigned by ObjectsGrid when the object is created. | |
identifier |
string | The object's id, as Schema.org identifier. Assigned by ObjectsGrid. |
|
url |
URL | The object's own URL, https://apis.objectsgrid.com/<path>/<id>. Assigned by ObjectsGrid. |
|
objectType |
string | Yes | Your type's name, e.g. checkout-form |
namespace |
string | Groups your types, e.g. com.example.shop | |
name |
string | A name for the document | |
data |
object | Yes | The JSON document. At most 256 KB. Stored and returned, not searchable. |
dataSchema |
URL | The URL of a JSON Schema the data follows, for your apps: stored, not checked | |
tags |
list of Tag | Tags your ABAC policy decides on. Created empty when not sent, kept by a PUT that leaves them out, cleared by null or []. |
|
meta |
ObjectMeta | Read-only metadata: version, type, creation and last update. |
REST API¶
Base URL https://apis.objectsgrid.com. Every request sends the X-ObjectsGrid-AccessPoint and Authorization: Bearer <access token> headers; see the REST API guide.
| Operation | Request |
|---|---|
| Create | POST /jsonobjects |
| List and search | GET /jsonobjects |
| Create up to 100 at once | POST /jsonobjects/batch |
| Retrieve | GET /jsonobjects/{id} |
| Replace | PUT /jsonobjects/{id} |
| Update some fields | PATCH /jsonobjects/{id} |
| Delete | DELETE /jsonobjects/{id} |
JSONObject objects have no JSON-LD document: asked for one (Accept: application/ld+json), GET answers 406.
The OpenAPI contract, with every parameter and response: JSONObjects (JSON).
GraphQL¶
Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.
| Operation | Field |
|---|---|
| Query | jSONObject(id: ID!, version: String): JSONObject |
| Query | jsonObjects(where: JSONObjectWhereInput, orderBy: [JSONObjectOrderByInput!], first: Int, after: String): JSONObjectConnection! |
| Query | jsonObjectsGroupBy(by: [JSONObjectGroupByField!]!, where: JSONObjectWhereInput, having: JSONObjectHavingInput, orderBy: [JSONObjectGroupByOrderByInput!], first: Int, after: String): JSONObjectGroupByConnection! |
| Mutation | createJSONObject(input: CreateJSONObjectInput!): JSONObject! |
| Mutation | updateJSONObject(input: UpdateJSONObjectInput!, expectedVersion: String): JSONObject! |
| Mutation | deleteJSONObject(id: ID!, expectedVersion: String): Boolean! |
Webhook events¶
Subscribe to these events in your webhook configuration to be called when a JSONObject changes:
JSONObjectCreated, JSONObjectUpdated, JSONObjectPatched, JSONObjectDeleted.