Message¶
A Message is one entry of a Conversation (isPartOf), from a sender to its
recipients. Its text is personal data: when the sender is a Person, it is encrypted with that Person's
key, so erasing the Person erases their words, and the other side's messages stay
readable. dateSent is the time it was created unless you send one; dateRead is your app's to set. Attachments are
URLs of files your app stores. It is never searchable by its text and has no JSON-LD document.
Modeled on schema.org/Message · JSON Schema · ABAC object type Message
Example¶
Create one with POST /messages:
{
"isPartOf": {
"at_id": "https://apis.objectsgrid.com/conversations/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
},
"sender": {
"at_id": "https://apis.objectsgrid.com/persons/7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
},
"recipient": [
{
"at_id": "https://apis.objectsgrid.com/organizations/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d"
}
],
"text": "Can we check in early?"
}
Fields¶
Required: isPartOf, sender.
| Field | Type | Required | Description |
|---|---|---|---|
at_context |
https://schema.org |
JSON-LD @context, always https://schema.org. |
|
at_type |
Message |
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. |
|
text |
string | What it says. Personal: encrypted with the Person key of the sender, when the sender is a Person, so erasing the sender erases it; the other side's messages stay readable. | |
isPartOf |
Reference to Conversation | Yes | The Conversation it belongs to |
sender |
Reference to Person or Organization | Yes | Who sent it: the URL of a Person or Organization, stored as |
recipient |
list of References to Person or Organization | Who it is for: URLs of Persons and Organizations, stored as |
|
dateSent |
date-time | When it was sent; the time it was created when not given | |
dateRead |
date-time | When the recipient read it, set by the app | |
messageAttachment |
list of URL | Attached files: URLs of files the app stores, as for images | |
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 /messages |
| List and search | GET /messages |
| Create up to 100 at once | POST /messages/batch |
| Retrieve | GET /messages/{id} |
| Retrieve as a JSON-LD document for your pages | GET /messages/{id} with Accept: application/ld+json; see JSON-LD for your pages |
| Replace | PUT /messages/{id} |
| Update some fields | PATCH /messages/{id} |
| Delete | DELETE /messages/{id} |
The OpenAPI contract, with every parameter and response: Messages (JSON).
GraphQL¶
Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.
| Operation | Field |
|---|---|
| Query | message(id: ID!, version: String): Message |
| Query | messages(where: MessageWhereInput, orderBy: [MessageOrderByInput!], first: Int, after: String): MessageConnection! |
| Query | messagesGroupBy(by: [MessageGroupByField!]!, where: MessageWhereInput, having: MessageHavingInput, orderBy: [MessageGroupByOrderByInput!], first: Int, after: String): MessageGroupByConnection! |
| Mutation | createMessage(input: CreateMessageInput!): Message! |
| Mutation | updateMessage(input: UpdateMessageInput!, expectedVersion: String): Message! |
| Mutation | deleteMessage(id: ID!, expectedVersion: String): Boolean! |
Webhook events¶
Subscribe to these events in your webhook configuration to be called when a Message changes:
MessageCreated, MessageUpdated, MessagePatched, MessageDeleted.