Skip to content

Question

A Question is what a shopper or guest asks about a product, a place or a listing (about). Its answers are Answers whose parentItem is the Question, listed in suggestedAnswer (GraphQL); the one chosen is acceptedAnswer. upvoteCount and downvoteCount are counters your app keeps; who voted isn't stored. Your app moderates: the default access policy shows anonymous callers only Questions tagged visibility = public. See Wishlists, questions and messages.

Modeled on schema.org/Question · JSON Schema · ABAC object type Question

Example

Create one with POST /questions:

{
  "name": [
    {
      "at_language": "en",
      "at_value": "Is it quiet when it boils?"
    }
  ],
  "about": {
    "at_id": "https://apis.objectsgrid.com/products/kettle-1"
  },
  "author": {
    "at_id": "https://apis.objectsgrid.com/persons/7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
  }
}

Fields

Required: name.

Field Type Required Description
at_context https://schema.org JSON-LD @context, always https://schema.org.
at_type Question 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 Question name. See schema.org/name.
text list of LanguageTaggedString The question in full
about Reference to Accommodation or Brand or Course or Event or Menu or MenuItem or Offer or Organization or Place or Product or ProductGroup or ProductModel or RealEstateListing or Service What it asks about
author Reference to Person or Organization Who asked: the URL of a Person or Organization, stored as ?version=
dateCreated date-time When it was asked
upvoteCount integer Up votes, kept by the app
downvoteCount integer Down votes, kept by the app
acceptedAnswer Reference to Answer The answer chosen as the right one
suggestedAnswer computed: list of Answer Its answers. Computed, read-only: the objects whose Answer.parentItem 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 /questions
List and search GET /questions
Create up to 100 at once POST /questions/batch
Retrieve GET /questions/{id}
Retrieve as a JSON-LD document for your pages GET /questions/{id} with Accept: application/ld+json; see JSON-LD for your pages
Replace PUT /questions/{id}
Update some fields PATCH /questions/{id}
Delete DELETE /questions/{id}

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

GraphQL

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

Operation Field
Query question(id: ID!, version: String): Question
Query questions(where: QuestionWhereInput, orderBy: [QuestionOrderByInput!], first: Int, after: String): QuestionConnection!
Query questionsGroupBy(by: [QuestionGroupByField!]!, where: QuestionWhereInput, having: QuestionHavingInput, orderBy: [QuestionGroupByOrderByInput!], first: Int, after: String): QuestionGroupByConnection!
Mutation createQuestion(input: CreateQuestionInput!): Question!
Mutation updateQuestion(input: UpdateQuestionInput!, expectedVersion: String): Question!
Mutation deleteQuestion(id: ID!, expectedVersion: String): Boolean!

Webhook events

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

QuestionCreated, QuestionUpdated, QuestionPatched, QuestionDeleted.