Skip to content

GenericObject

A GenericObject stores data of your own type when no built-in object fits. objectType names your type (for example loyalty-card), namespace groups your types, and objectID is your own identifier. The values go in typed attribute lists: strings, integers, floats, booleans, dates, JSON objects, and references to other objects.

Prefer a built-in type when one fits: built-in types are modeled on Schema.org and validated field by field.

JSON Schema ยท ABAC object type GenericObject

Example

Create one with POST /genericobjects:

{
  "objectType": "loyalty-card",
  "namespace": "com.example.loyalty",
  "objectID": "card-000187",
  "stringAttributes": [
    {
      "name": "tier",
      "val": "gold"
    }
  ],
  "intAttributes": [
    {
      "name": "points",
      "val": 1840
    }
  ],
  "dateAttributes": [
    {
      "name": "memberSince",
      "val": "2024-03-01T00:00:00Z"
    }
  ]
}

Fields

Required: objectType.

Field Type Required Description
id string The object's id. Assigned by ObjectsGrid when the object is created.
at_type GenericObject 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.
objectID string The user defined Object ID
objectType string Yes The type of the Object
namespace string The Namespace of the Object
intAttributes list of object Custom Object Attributes of type Integer
intAttributes[].name string
intAttributes[].val integer
floatAttributes list of object Custom Object Attributes of type Float
floatAttributes[].name string
floatAttributes[].val number
stringAttributes list of object Custom Object Attributes of type String
stringAttributes[].name string
stringAttributes[].val string
booleanAttributes list of object Custom Object Attributes of type Boolean
booleanAttributes[].name string
booleanAttributes[].val boolean
dateAttributes list of object Custom Object Attributes of type Date Time ISO 8601
dateAttributes[].name string
dateAttributes[].val date-time
objectAttributes list of object Custom Object Attributes of type string - Object JSON
objectAttributes[].name string
objectAttributes[].val string
referenceAttributes list of object Custom Object Attributes of type string - Reference link to an Object
referenceAttributes[].objectType string
referenceAttributes[].objectID string
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 [].

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 /genericobjects
List and search GET /genericobjects
Create up to 100 at once POST /genericobjects/batch
Retrieve GET /genericobjects/{id}
Replace PUT /genericobjects/{id}
Update some fields PATCH /genericobjects/{id}
Delete DELETE /genericobjects/{id}

GenericObject objects have no JSON-LD document: asked for one (Accept: application/ld+json), GET answers 406.

The OpenAPI contract, with every parameter and response: GenericObjects (JSON).

GraphQL

Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.

Operation Field
Query genericObject(id: ID!, version: String): GenericObject
Query genericObjects(where: GenericObjectWhereInput, orderBy: [GenericObjectOrderByInput!], first: Int, after: String): GenericObjectConnection!
Query genericObjectsGroupBy(by: [GenericObjectGroupByField!]!, where: GenericObjectWhereInput, having: GenericObjectHavingInput, orderBy: [GenericObjectGroupByOrderByInput!], first: Int, after: String): GenericObjectGroupByConnection!
Mutation createGenericObject(input: CreateGenericObjectInput!): GenericObject!
Mutation updateGenericObject(input: UpdateGenericObjectInput!, expectedVersion: String): GenericObject!
Mutation deleteGenericObject(id: ID!, expectedVersion: String): Boolean!

Webhook events

Subscribe to these events in your webhook configuration to be called when a GenericObject changes:

GenericObjectCreated, GenericObjectUpdated, GenericObjectPatched, GenericObjectDeleted.