Answered

I am trying to search in conversations but using your example: I get a 400 "Query body must contain a query hash". When using contact search everything works fine

  • 23 February 2021
  • 7 replies
  • 395 views

I am trying to search in conversations but using your example:

I get a 400 "Query body must contain a query hash".

When using contact search everything works fine
icon

Best answer by Roy 4 March 2021, 03:43

View original

7 replies

Badge

Hello @user919​ , Can you post the full API request?

Hi,

 

we call https://api.intercom.io/conversations/search/p>

with body params:

{

 "query": {

  "field": "contact_ids",

  "operator": "=",

  "value": "600bfa5ff56b2ea78672f2d0"

 }

 

}

Badge

@user919​ , I just tested this out, it's working fine from me. Can you confirm that you are sending JSON request from Postman?

(I think there some problems with your Postman configuration).

Yes, I confirm that.

I am using postman. This API https://developers.intercom.com/intercom-api-reference/reference#search-for-conversations/p>

  • with Bearer Token: <mytoken>
  • with header Accept: Application/json

with body: {

 "query": {

  "field": "contact_ids",

  "operator": "=",

  "value": "600bfa5ff56b2ea78672f2d0"

 }

}

 

But we still get 400 Bad request and response:

{

    "type": "error.list",

    "request_id": "001do3dkinhl2i45r9dg",

    "errors": [

        {

            "code": "invalid_query",

            "message": "Query body must contain a query hash"

        }

    ]

}

 

Any hint?

Badge

@user919​ , Sorry for the late reply here, Sending you some Postman Configuration screenshots:

Body:

Intercom-APIHeaders:

Intercom-API2Can you change the configuration like this and try once again to send the request?

 

Looking forward.

Thank you very much.

It seems that Content-Type: application/json fixed the issue for us.

 

Thanks again,

Apostolis

Badge

@user919​ , 🙌 Anytime, Always happy to help.

 

🦄 Have a great day.

Reply