Message

Message

Message 

Overview

Member to member communication is handled through the Hip eCommerce Message system. Only the Sender and Receiver of the Message will have access to it.

Searching Messages

By default, the method findAllMessages returns all unarchived Messages on Hip eCommerce, received by the current User, paginated by newest Messages first. Use the optional parameters (such as filter, etc.) to changed or narrow these results. The sort parameter can be used to change the order of returned results. 

Fields

Field
Visibility
Type
Description
id
public
int

topic_id
public
int
When a new message (not a reply) is first sent, it's assigned a topic_id. All future responses to that message will have the same topic_id. Within the Members Area > Messages section, this servers to thread messages together.
topic_type
public
string

topic_title
public
string
The title of the first message with the same topic_id (ie: the original message in the thread).
title
public
string
The title of this message.
content
public
string
The content (body) of this message.
sender_username
public
username

receiver_username
public
username

flag_read
public
bool
If the message had been read by the receiver by opening it online. Note that accessing messages through the API does not mark messages as read.
created_at
public
time

Methods

getMessage 

Method Name: getMessage 
Synopsis: Retrieves a Message by id.
HTTP Method: GET
URI: /messages/:id
Parameters:
Name
Required
Type
Notes
id
Y
int
The id of the Message to retrieve.

replyToMessage 

Method Name: replyToMessage
Synopsis: Replies to an existing message.
HTTP Method: PUT
URI: /messages/:id
Parameters:
Name
Required
Type
Notes
id
Y
int
The id of the Message you want to reply to.
title
N
int
The title of your reply message.
content
Y
int
The content (body) of your reply message.

archiveMessage

Method Name: archiveMessage
Synopsis: Archives the specified message for the current user.
HTTP Method: DELETE 
URI: /messages/:id
Parameters:
Name
Required
Type
Notes
id
Y
int
The id of the Message you want to archive. 

findAllMessages

Method Name: findAllMessages
Synopsis: Finds all Messages for the current user (defaults to received and unarchived messages only).
HTTP Method: GET
URI: /messages 
Parameters:
Name
Required
Type
Notes
limit
N
int
Default: 25
page
N
int
Default: 1
filter
N
enum (received, sent)
Default: received
unread
N
bool

archived
N
bool
Default: 0
keywords
N
string
Limit the results to messages which contain these keywords in the title or content, or where the sender or receiver's username is an exact match to the keywords string.

Examples

findAllMessages

Request:
Response:
{
    "count": 15,
    "results": [
        {
            "id": "50",
            "topic_id": "25",
            "topic_type": "sale_transaction",
            "topic_title": "",
            "title": "Re: Fantastic Four",
            "content": "Hi - Do you have a tracking number for me?\r\n\r\nThanks",
            "sender_username": "Joe",
            "receiver_username": "Mark",
            "flag_read": "1",
            "created_at": "2018-06-27 14:23:05"
        }
    ],
    "params": {
        "limit": "1"
    }
}