Inbox-filter not working as expected

I can’t seem to get any messages to return from the inbox-search or inbox-filter APIs.

Using andSubjectIncludes=“string-I-know-exists” in inbox-search returns 0 matches. I’ve tried the full string, one word of the string, a letter, and get nothing back.

Hello,

Sorry for the trouble you are having with the API.

I’ve been able to produce a result inconsistent with our documentation, where if I use multiple query parameters nothing is returned.

For example

https://mailsac.com/api/inbox-filter\?andSubjectIncludes\=Bitcoin\&andTo\[email protected]

{
  "messages": []
}

will return nothing.

However, the query parameters used individually work.

https://mailsac.com/api/inbox-filter\?andSubjectIncludes\=Bitcoin

{
  "messages": [
    {
      "_id": "at5hZVxcNarYJN3BDGJSPQdM0-0",
      "from": [
        {
          "address": "[email protected]",
          "name": "Scott Perry"
        }
      ],
      "to": [
        {
          "address": "[email protected]",
          "name": "Recipients"
        }
      ],
      "cc": [],
      "bcc": [],
      "subject": "Bitcoin Payment!!",
      "savedBy": null,
      "inbox": "[email protected]",
      "originalInbox": "[email protected]",
...

https://mailsac.com/api/inbox-filter\?andTo\[email protected]

{
  "messages": [
    {
    "_id": "6fw7PxjC4ZfwNTsNduvJ6gLYQ-0",
      "from": [
        {
          "address": "[email protected]",
          "name": ""
        }
      ],
      "to": [
        {
          "address": "[email protected]",
          "name": ""
        }
      ],
...

The /api/inbox-filter endpoint will only search private addresses or custom domains you have verified.

Are you searching for a subject of an email that is in a private inbox and owned by you? Are you using more than one query parameter?

Hey Paul,

I think I got it figured out. I suspect you may be filtering based on “To” address. The “To” address is not necessarily the same as the inbox that they message was delivered to. In my example, the To query parameter I was using was [email protected], but if you look at the contents of the JSON in my previous reply you can see the To address was actually [email protected]. I suspect the same is true of your situation.

Hey Paul,

We pushed a change to the API. When you use the To query parameter it will check both the To and Inbox fields in the email messages metadata. This should solve the unexpected behavior you saw.