Skip to content

How Do I Fetch All The Conversations That Belong To A Contact? #117

@heroddube

Description

@heroddube

Currently The code i have fetches everything then filters on all results, the payload can be heavy in the future for this.

[HttpGet("{contactId}")]
public List GetConversations(string contactId, [FromHeader(Name = "keys")] string headerKeys)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
MessageBirdKeys mbKeys = serializer.Deserialize(headerKeys);

        var restClient = new RestClient(CONVERSATIONS_ENDPOINT, mbKeys.AccessKey, null);
        var client = Client.Create(restClient);

        ConversationList conversations = client.ListConversations();
        return conversations.Items.Where(i => i.ContactId == contactId).ToList();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions