Skip to content

No access to thread ratings #331

@thomasplevy

Description

@thomasplevy

It appears that while ratings are returned by the mailbox API when retrieving threads, the SDK has no support for interacting with thread ratings:

https://developer.helpscout.com/mailbox-api/endpoints/conversations/threads/list/#rating-response-fields

public function hydrate(array $data, array $embedded = [])
{
if (isset($data['id'])) {
$this->setId((int) $data['id']);
}
$this->type = $data['type'] ?? null;
$this->status = $data['status'] ?? null;
$this->state = $data['state'] ?? null;
if (isset($data['text'])) {
$this->text = $data['text'];
} elseif (isset($data['body'])) {
$this->text = $data['body'];
}
if (isset($data['action'])) {
$this->actionType = $data['action']['type'] ?? null;
$this->actionText = $data['action']['text'] ?? null;
}
if (isset($data['source']) && is_array($data['source'])) {
$this->hydrateSource($data['source']);
}
if (isset($data['createdBy'])) {
$this->hydrateCreatedBy($data['createdBy']);
}
$this->assignedTo = $data['assignedTo'] ?? null;
$this->savedReplyId = $data['savedReplyId'] ?? null;
if (isset($data['to'])) {
if (is_array($data['to'])) {
$this->to = $data['to'];
} else {
$this->to = [
(string) $data['to'],
];
}
}
if (isset($data['cc'])) {
$this->hydrateCC($data['cc']);
}
if (isset($data['bcc'])) {
$this->hydrateBCC($data['bcc']);
}
$this->createdAt = $this->transformDateTime($data['createdAt'] ?? null);
$this->openedAt = $this->transformDateTime($data['openedAt'] ?? null);
if (isset($embedded['attachments'])) {
$attachments = [];
foreach ($embedded['attachments'] as $attachmentData) {
$attachment = new Attachment();
$attachment->hydrate($attachmentData);
$attachments[] = $attachment;
}
$this->setAttachments(new Collection($attachments));
}
if (isset($data['imported']) && $data['imported']) {
$this->setImported(true);
}
}

Currently the only solution I can find is to make an additional request outside of the SDK in order to retrieve this data.

Am I reading the functionality correctly?

If so are there any plans to include ratings in a future release?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions