Message

The Message object represents a message in the system sent either internal or externally.


GET/v3/message/:id

Find Message

Find one Message by id

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the object to retrieve

200 Response

  • Name
    data
    Type
    object Required
    Description
    Message schema
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Properties for data object

  • Name
    id
    Type
    string Required
    Description
  • Name
    meta
    Type
    object Required
    Description
    the metadata about the most recent change to the row
  • Name
    metadata
    Type
    object
    Description
    metadata reserved for customers to control
  • Name
    createdDate
    Type
    string Required
    Description
  • Name
    updatedDate
    Type
    string Required
    Description
  • Name
    locationId
    Type
    string Required
    Description
  • Name
    companyId
    Type
    string Required
    Description
  • Name
    text
    Type
    string Required
    Description
    appears in message center/thread (content of message if SMS, plaintext/preview if email)
  • Name
    sendEmail
    Type
    boolean Required
    Description
    if an email should be sent, is null if author is a Customer
  • Name
    emailSubject
    Type
    string Required
    Description
    overrides default email subject
  • Name
    emailStatus
    Type
    string Required
    Description
  • Name
    emailError
    Type
    string Required
    Description
    error sending email, if any
  • Name
    sendSms
    Type
    boolean Required
    Description
    if an sms should be sent, is null if author is a Customer
  • Name
    smsStatus
    Type
    string Required
    Description
  • Name
    smsError
    Type
    string Required
    Description
    error sending sms, if any
  • Name
    authorType
    Type
    string Required
    Description
  • Name
    origin
    Type
    string Required
    Description
  • Name
    isOrderShare
    Type
    boolean Required
    Description
    true if this message created via Order Share modal
  • Name
    orderShareType
    Type
    string Required
    Description
  • Name
    customerId
    Type
    string Required
    Description
    the id of the customer that authored or was sent the message
  • Name
    userId
    Type
    string Required
    Description
    the user who authored the message
  • Name
    orderId
    Type
    string Required
    Description
    an order associated with this message
  • Name
    appointmentId
    Type
    string Required
    Description
    appointment associated with this message
  • Name
    vehicleId
    Type
    string Required
    Description
    a vehicle associated with this message
  • Name
    vendorId
    Type
    string Required
    Description
    a vendor associated with this message
  • Name
    shopRead
    Type
    boolean Required
    Description
    true if someone at the shop has read a Customer message, is null if author is a User
  • Name
    internal
    Type
    boolean Required
    Description
    true if internal note, is null if author is a Customer
  • Name
    detached
    Type
    boolean Required
    Description
    true if message is public but has no reference to a customer (only for migration purposes)
  • Name
    conversationId
    Type
    string Required
    Description
  • Name
    deleted
    Type
    boolean Required
    Description
    if the record has been deleted
  • Name
    deletedUserId
    Type
    string Required
    Description
    the user that deleted the record or null if not deleted
  • Name
    deletedDate
    Type
    string Required
    Description
    the date that the record was deleted or null if not deleted
  • Name
    deletedReason
    Type
    string Required
    Description
    the reason that the record was deleted
  • Name
    locationReviewRequestId
    Type
    string Required
    Description
    the id of the review request
  • Name
    suggestedReply
    Type
    string Required
    Description
    if we can suggest a reply, this will have a value to suggest to the user in the app
  • Name
    suggestedReplyState
    Type
    string Required
    Description
  • Name
    requestAppointmentConfirmation
    Type
    boolean Required
    Description
    if true, the email/sms will contain actions to confirm/decline an appointment
  • Name
    appointmentEvent
    Type
    string Required
    Description
  • Name
    avoidSMSQuietHours
    Type
    boolean Required
    Description
  • Name
    files
    Type
    array Required
    Description
  • Name
    orderNumber
    Type
    string
    Description
    the order number
  • Name
    userColor
    Type
    string
    Description
    the color for the user

Properties for meta object

  • Name
    userId
    Type
    string
    Description
    the user id that made the most recent change
  • Name
    sessionId
    Type
    string
    Description
    the session id for the most recent change
  • Name
    version
    Type
    number
    Description
    a monotonically increasing number for the most recent change

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request

GET
/v3/message/:id
curl https://api.shopmonkey.cloud/v3/message/ID \ 
  -H "Authorization: Bearer ${SM_TOKEN}"

Example Response
application/json

{
  "success": true,
  "data": {
    "id": "id",
    "meta": {
      "userId": "userId",
      "sessionId": "sessionId",
      "version": 1
    },
    "createdDate": "createdDate",
    "updatedDate": null,
    "locationId": "locationId",
    "companyId": "companyId",
    "text": "text",
    "sendEmail": true,
    "emailSubject": null,
    "emailStatus": null,
    "emailError": null,
    "sendSms": true,
    "smsStatus": null,
    "smsError": null,
    "authorType": "authorType",
    "origin": "origin",
    "isOrderShare": true,
    "customerId": null,
    "userId": null,
    "orderId": null,
    "vehicleId": null,
    "vendorId": null,
    "shopRead": true,
    "internal": true,
    "detached": true,
    "conversationId": null,
    "deleted": true,
    "deletedUserId": null,
    "deletedDate": null,
    "deletedReason": null,
    "files": [
      {
        "id": "id",
        "url": "url",
        "thumbnailUrl": "thumbnailUrl",
        "fileSize": 1,
        "fileType": "fileType",
        "fileName": "fileName"
      }
    ]
  }
}

GET/v3/message

List Messages

Find all messages

200 Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    array Required
    Description
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    meta
    Type
    object
    Description
  • Name
    success
    Type
    boolean Required
    Description

Properties for meta object

  • Name
    hasMore
    Type
    boolean Required
    Description
    if there are more records available
  • Name
    sums
    Type
    object
    Description
  • Name
    total
    Type
    number Required
    Description
    the total number of records

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request

GET
/v3/message
curl https://api.shopmonkey.cloud/v3/message \ 
  -H "Authorization: Bearer ${SM_TOKEN}"

Example Response
application/json

{
  "success": true,
  "data": [
    {
      "id": "id",
      "createdDate": "createdDate",
      "updatedDate": null,
      "locationId": "locationId",
      "companyId": "companyId",
      "text": "text",
      "sendEmail": true,
      "emailSubject": null,
      "emailStatus": null,
      "emailError": null,
      "sendSms": true,
      "smsStatus": null,
      "smsError": null,
      "authorType": "authorType",
      "origin": "origin",
      "isOrderShare": true,
      "customerId": null,
      "userId": null,
      "orderId": null,
      "vehicleId": null,
      "vendorId": null,
      "shopRead": true,
      "internal": true,
      "detached": true,
      "conversationId": null,
      "deleted": true,
      "deletedUserId": null,
      "deletedDate": null,
      "deletedReason": null,
      "files": [
        {
          "id": "id",
          "url": "url",
          "thumbnailUrl": "thumbnailUrl",
          "fileSize": 1,
          "fileType": "fileType",
          "fileName": "fileName"
        }
      ]
    }
  ]
}

POST/v3/message

Create Message

Create a new customer message

Body parameters

  • Name
    sendEmail
    Type
    boolean
    Description
    if an email should be sent, is null if author is a Customer
  • Name
    emailSubject
    Type
    string
    Description
    overrides default email subject
  • Name
    sendSms
    Type
    boolean
    Description
    if an sms should be sent, is null if author is a Customer
  • Name
    isOrderShare
    Type
    boolean
    Description
    true if this message created via Order Share modal
  • Name
    orderShareType
    Type
    string
    Description
  • Name
    orderId
    Type
    string
    Description
    an order associated with this message
  • Name
    vehicleId
    Type
    string
    Description
    a vehicle associated with this message
  • Name
    suggestedReplyState
    Type
    string
    Description
  • Name
    text
    Type
    string Required
    Description
    appears in message center/thread (content of message if SMS, plaintext/preview if email)
  • Name
    customerId
    Type
    string Required
    Description
    the id of the customer that authored or was sent the message
  • Name
    files
    Type
    array
    Description
    an ordered array of file ids

200 Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message
  • Name
    data
    Type
    object Required
    Description
    Message schema

Properties for data object

  • Name
    id
    Type
    string Required
    Description
  • Name
    createdDate
    Type
    string Required
    Description
  • Name
    updatedDate
    Type
    string Required
    Description
  • Name
    locationId
    Type
    string Required
    Description
  • Name
    companyId
    Type
    string Required
    Description
  • Name
    text
    Type
    string Required
    Description
    appears in message center/thread (content of message if SMS, plaintext/preview if email)
  • Name
    sendEmail
    Type
    boolean Required
    Description
    if an email should be sent, is null if author is a Customer
  • Name
    emailSubject
    Type
    string Required
    Description
    overrides default email subject
  • Name
    emailStatus
    Type
    string Required
    Description
  • Name
    emailError
    Type
    string Required
    Description
    error sending email, if any
  • Name
    sendSms
    Type
    boolean Required
    Description
    if an sms should be sent, is null if author is a Customer
  • Name
    smsStatus
    Type
    string Required
    Description
  • Name
    smsError
    Type
    string Required
    Description
    error sending sms, if any
  • Name
    authorType
    Type
    string Required
    Description
  • Name
    origin
    Type
    string Required
    Description
  • Name
    isOrderShare
    Type
    boolean Required
    Description
    true if this message created via Order Share modal
  • Name
    orderShareType
    Type
    string Required
    Description
  • Name
    customerId
    Type
    string Required
    Description
    the id of the customer that authored or was sent the message
  • Name
    userId
    Type
    string Required
    Description
    the user who authored the message
  • Name
    orderId
    Type
    string Required
    Description
    an order associated with this message
  • Name
    appointmentId
    Type
    string Required
    Description
    appointment associated with this message
  • Name
    vehicleId
    Type
    string Required
    Description
    a vehicle associated with this message
  • Name
    vendorId
    Type
    string Required
    Description
    a vendor associated with this message
  • Name
    shopRead
    Type
    boolean Required
    Description
    true if someone at the shop has read a Customer message, is null if author is a User
  • Name
    internal
    Type
    boolean Required
    Description
    true if internal note, is null if author is a Customer
  • Name
    detached
    Type
    boolean Required
    Description
    true if message is public but has no reference to a customer (only for migration purposes)
  • Name
    conversationId
    Type
    string Required
    Description
  • Name
    deleted
    Type
    boolean Required
    Description
    if the record has been deleted
  • Name
    deletedUserId
    Type
    string Required
    Description
    the user that deleted the record or null if not deleted
  • Name
    deletedDate
    Type
    string Required
    Description
    the date that the record was deleted or null if not deleted
  • Name
    deletedReason
    Type
    string Required
    Description
    the reason that the record was deleted
  • Name
    locationReviewRequestId
    Type
    string Required
    Description
    the id of the review request
  • Name
    suggestedReply
    Type
    string Required
    Description
    if we can suggest a reply, this will have a value to suggest to the user in the app
  • Name
    suggestedReplyState
    Type
    string Required
    Description
  • Name
    requestAppointmentConfirmation
    Type
    boolean Required
    Description
    if true, the email/sms will contain actions to confirm/decline an appointment
  • Name
    appointmentEvent
    Type
    string Required
    Description
  • Name
    avoidSMSQuietHours
    Type
    boolean Required
    Description
  • Name
    files
    Type
    array Required
    Description
  • Name
    orderNumber
    Type
    string
    Description
    the order number
  • Name
    userColor
    Type
    string
    Description
    the color for the user

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request
application/json

POST
/v3/message
curl https://api.shopmonkey.cloud/v3/message \ 
  -H "Authorization: Bearer ${SM_TOKEN}" \ 
  -X POST -H 'Content-Type: application/json' \ 
  --data '{ "text" : "value", "customerId" : "value" }'

Example Response
application/json

{
  "success": true,
  "data": {
    "id": "id",
    "createdDate": "createdDate",
    "updatedDate": null,
    "locationId": "locationId",
    "companyId": "companyId",
    "text": "text",
    "sendEmail": true,
    "emailSubject": null,
    "emailStatus": null,
    "emailError": null,
    "sendSms": true,
    "smsStatus": null,
    "smsError": null,
    "authorType": "authorType",
    "origin": "origin",
    "isOrderShare": true,
    "customerId": null,
    "userId": null,
    "orderId": null,
    "vehicleId": null,
    "vendorId": null,
    "shopRead": true,
    "internal": true,
    "detached": true,
    "conversationId": null,
    "deleted": true,
    "deletedUserId": null,
    "deletedDate": null,
    "deletedReason": null,
    "files": [
      {
        "id": "id",
        "url": "url",
        "thumbnailUrl": "thumbnailUrl",
        "fileSize": 1,
        "fileType": "fileType",
        "fileName": "fileName"
      }
    ]
  }
}

PUT/v3/message_thread_metadata/:id/read

Set a message thread to read.

Dedicated endpoint for marking a message thread as "read" for the user making the call. Users can only mark their own threads as read. Sets the unreadMessagesCount to 0.

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the MessageThreadMetadata

200 Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message
  • Name
    data
    Type
    object Required
    Description
    MessageThreadMetadata schema

Properties for data object

  • Name
    id
    Type
    string Required
    Description
    autogenerated id
  • Name
    createdDate
    Type
    string Required
    Description
  • Name
    updatedDate
    Type
    string Required
    Description
  • Name
    locationId
    Type
    string Required
    Description
  • Name
    companyId
    Type
    string Required
    Description
  • Name
    unreadTimestamp
    Type
    string Required
    Description
    the timestamp when the first unread message was set
  • Name
    unreadMessagesCount
    Type
    integer Required
    Description
    a number of unread messages
  • Name
    important
    Type
    boolean Required
    Description
    a boolean to control if conversation is marked important
  • Name
    archived
    Type
    boolean Required
    Description
    a boolean to control if conversation is marked archived
  • Name
    userId
    Type
    string Required
    Description
    a reference to a user
  • Name
    customerId
    Type
    string Required
    Description
    a reference to a customer

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request
application/json

PUT
/v3/message_thread_metadata/:id/read
curl https://api.shopmonkey.cloud/v3/message_thread_metadata/ID/read \ 
  -H "Authorization: Bearer ${SM_TOKEN}" \ 
  -X PUT -H 'Content-Type: application/json' \ 
  --data '{}'

Example Response
application/json

{
  "success": true,
  "data": {
    "id": "id",
    "createdDate": "createdDate",
    "updatedDate": null,
    "locationId": "locationId",
    "companyId": "companyId",
    "unreadMessagesCount": null,
    "important": true,
    "archived": true,
    "userId": "userId",
    "customerId": "customerId"
  }
}

GET/v3/user/:id/inbox

Get Inbox

Get user inbox messages

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the user

200 Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    array Required
    Description
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    meta
    Type
    object
    Description
  • Name
    success
    Type
    boolean Required
    Description

Properties for meta object

  • Name
    hasMore
    Type
    boolean Required
    Description
    if there are more records available
  • Name
    sums
    Type
    object
    Description
  • Name
    total
    Type
    number Required
    Description
    the total number of records

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request

GET
/v3/user/:id/inbox
curl https://api.shopmonkey.cloud/v3/user/ID/inbox \ 
  -H "Authorization: Bearer ${SM_TOKEN}"

Example Response
application/json

{
  "success": true,
  "data": [
    {
      "id": "id",
      "createdDate": "createdDate",
      "updatedDate": null,
      "locationId": "locationId",
      "companyId": "companyId",
      "text": "text",
      "sendEmail": true,
      "emailSubject": null,
      "emailStatus": null,
      "emailError": null,
      "sendSms": true,
      "smsStatus": null,
      "smsError": null,
      "authorType": "authorType",
      "origin": "origin",
      "isOrderShare": true,
      "customerId": null,
      "userId": null,
      "orderId": null,
      "vehicleId": null,
      "vendorId": null,
      "shopRead": true,
      "internal": true,
      "detached": true,
      "conversationId": null,
      "deleted": true,
      "deletedUserId": null,
      "deletedDate": null,
      "deletedReason": null,
      "customer": {
        "id": "id",
        "customerType": "customerType",
        "firstName": null,
        "lastName": null,
        "companyName": null
      },
      "messageThreadMetadata": {
        "id": "id",
        "createdDate": "createdDate",
        "updatedDate": null,
        "locationId": "locationId",
        "companyId": "companyId",
        "unreadMessagesCount": null,
        "important": true,
        "archived": true,
        "userId": "userId",
        "customerId": "customerId"
      },
      "order": {
        "id": "id",
        "number": 1
      }
    }
  ]
}

GET/v3/user/:id/notification_config

Get notification config

Get user notification config

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the user

200 Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    array Required
    Description
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    meta
    Type
    object
    Description
  • Name
    success
    Type
    boolean Required
    Description

Properties for meta object

  • Name
    hasMore
    Type
    boolean Required
    Description
    if there are more records available
  • Name
    sums
    Type
    object
    Description
  • Name
    total
    Type
    number Required
    Description
    the total number of records

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request

GET
/v3/user/:id/notification_config
curl https://api.shopmonkey.cloud/v3/user/ID/notification_config \ 
  -H "Authorization: Bearer ${SM_TOKEN}"

Example Response
application/json

{
  "success": true,
  "data": [
    {
      "sendEmail": true,
      "sendInApp": true,
      "sendSms": true
    }
  ]
}

PUT/v3/user/:id/notification_config

Set notification config

Set user notification config

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the user

Body parameters

Array of objects with the following properties:















200 Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message
  • Name
    data
    Type
    null Required
    Description

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request
application/json

PUT
/v3/user/:id/notification_config
curl https://api.shopmonkey.cloud/v3/user/ID/notification_config \ 
  -H "Authorization: Bearer ${SM_TOKEN}" \ 
  -X PUT -H 'Content-Type: application/json' \ 
  --data '{}'

Example Response
application/json

{
  "success": true,
  "data": null
}