Skip to content

Conversation

A Conversation is a thread of Messages: a buyer asking about a listing, a guest writing to the hotel before arriving. about is what it's about (a listing, an Order, a Reservation...), participant who takes part, and status whether it's open or closed. Its Messages are listed in hasPart (GraphQL). It is a private record: it has no JSON-LD document, and the default access policy never shows it to anonymous callers. ObjectsGrid stores messages and calls your webhooks (MessageCreated); notifying people is your app's.

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

Example

Create one with POST /conversations:

{
  "name": [
    {
      "at_language": "en",
      "at_value": "Early check-in"
    }
  ],
  "about": {
    "at_id": "https://apis.objectsgrid.com/reservations/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b"
  },
  "participant": [
    {
      "at_id": "https://apis.objectsgrid.com/persons/7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
    },
    {
      "at_id": "https://apis.objectsgrid.com/organizations/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d"
    }
  ],
  "status": "Open"
}

Fields

Required: name.

Field Type Required Description
at_context https://schema.org JSON-LD @context, always https://schema.org.
at_type Conversation 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 subject
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 or Order or Reservation or Invoice What it is about
participant list of References to Person or Organization Who takes part: URLs of Persons and Organizations, stored as ?version=
dateCreated date-time When it started
status one of Open, Closed Whether it is open or closed. ObjectsGrid's, beyond Schema.org: Schema.org has no status for a conversation; left out of JSON-LD documents.
hasPart computed: list of Message Its Messages. Computed, read-only: the objects whose Message.isPartOf 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 /conversations
List and search GET /conversations
Create up to 100 at once POST /conversations/batch
Retrieve GET /conversations/{id}
Retrieve as a JSON-LD document for your pages GET /conversations/{id} with Accept: application/ld+json; see JSON-LD for your pages
Replace PUT /conversations/{id}
Update some fields PATCH /conversations/{id}
Delete DELETE /conversations/{id}

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

GraphQL

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

Operation Field
Query conversation(id: ID!, version: String): Conversation
Query conversations(where: ConversationWhereInput, orderBy: [ConversationOrderByInput!], first: Int, after: String): ConversationConnection!
Query conversationsGroupBy(by: [ConversationGroupByField!]!, where: ConversationWhereInput, having: ConversationHavingInput, orderBy: [ConversationGroupByOrderByInput!], first: Int, after: String): ConversationGroupByConnection!
Mutation createConversation(input: CreateConversationInput!): Conversation!
Mutation updateConversation(input: UpdateConversationInput!, expectedVersion: String): Conversation!
Mutation deleteConversation(id: ID!, expectedVersion: String): Boolean!

Webhook events

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

ConversationCreated, ConversationUpdated, ConversationPatched, ConversationDeleted.