DefinedTermSet¶
A DefinedTermSet is a set of coded terms, such as the error codes of one of your APIs: its
DefinedTerms point to it in inDefinedTermSet, and it lists them in hasDefinedTerm (GraphQL).
domain, such as example.com, says who defines the codes: your API returns it with each code, and a code is unique
within its domain. mainEntityOfPage is your page for the set. See
Explain your API's errors.
Modeled on schema.org/DefinedTermSet · JSON Schema · ABAC object type DefinedTermSet
Example¶
Create one with POST /definedtermsets:
{
"name": [
{
"at_language": "en",
"at_value": "Orders API errors"
}
],
"domain": "example.com",
"mainEntityOfPage": "https://docs.example.com/errors/"
}
Fields¶
Required: name, domain.
| Field | Type | Required | Description |
|---|---|---|---|
at_context |
https://schema.org |
JSON-LD @context, always https://schema.org. |
|
at_type |
DefinedTermSet |
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. |
|
name |
list of LanguageTaggedString | Yes | The set's name, e.g. Orders API errors |
description |
list of LanguageTaggedString | What the set is | |
mainEntityOfPage |
URL | Your page about it, e.g. https://docs.example.com/errors/ | |
domain |
string | Yes | Who defines the set's codes, your domain, e.g. example.com: your API returns it with each code, as ObjectsGrid's own errors return objectsgrid.com. ObjectsGrid's own field. |
hasDefinedTerm |
computed: list of DefinedTerm | The terms of the set. Computed, read-only: the objects whose DefinedTerm.inDefinedTermSet points to this object, listed from that type; never stored or written. | |
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 /definedtermsets |
| List and search | GET /definedtermsets |
| Create up to 100 at once | POST /definedtermsets/batch |
| Retrieve | GET /definedtermsets/{id} |
| Replace | PUT /definedtermsets/{id} |
| Update some fields | PATCH /definedtermsets/{id} |
| Delete | DELETE /definedtermsets/{id} |
DefinedTermSet objects have no JSON-LD document: asked for one (Accept: application/ld+json), GET answers 406.
The OpenAPI contract, with every parameter and response: DefinedTermSets (JSON).
GraphQL¶
Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.
| Operation | Field |
|---|---|
| Query | definedTermSet(id: ID!, version: String): DefinedTermSet |
| Query | definedTermSets(where: DefinedTermSetWhereInput, orderBy: [DefinedTermSetOrderByInput!], first: Int, after: String): DefinedTermSetConnection! |
| Query | definedTermSetsGroupBy(by: [DefinedTermSetGroupByField!]!, where: DefinedTermSetWhereInput, having: DefinedTermSetHavingInput, orderBy: [DefinedTermSetGroupByOrderByInput!], first: Int, after: String): DefinedTermSetGroupByConnection! |
| Mutation | createDefinedTermSet(input: CreateDefinedTermSetInput!): DefinedTermSet! |
| Mutation | updateDefinedTermSet(input: UpdateDefinedTermSetInput!, expectedVersion: String): DefinedTermSet! |
| Mutation | deleteDefinedTermSet(id: ID!, expectedVersion: String): Boolean! |
Webhook events¶
Subscribe to these events in your webhook configuration to be called when a DefinedTermSet changes:
DefinedTermSetCreated, DefinedTermSetUpdated, DefinedTermSetPatched, DefinedTermSetDeleted.