Skip to main content
Question

Search with Metadata not working

  • May 21, 2025
  • 4 replies
  • 58 views

Forum|alt.badge.img

I need to implement search api with metadata field search. For this i have passing all required parameters like templateKey, scope, filters to search api, but i am getting bad request response from search api. I am passing the values in json array format to search api. Also this Box account is enterprise account. Following is my search query.

https://api.box.com/2.0/search?mdfilters=%5B%7B%22templateKey%22%3A%22adaptPhase%22%2C%22scope%22%3A%22enterprise_86433%22%2C%22filters%22%3A%7B%22productType%22%3A+%22case%22%7D%7D%5D

Please guide me someone, how to implement Metadata search with Search api.

 

 

 

4 replies

Forum|alt.badge.img

Hello ,

the URL you've shared, once decoded, is: https://api.box.com/2.0/search?mdfilters=[{"templateKey":"adaptPhase","scope":"enterprise_86433","filters":{"productType":+"case"}}]

 

If we pretty-print that:

[

  {
    "templateKey": "adaptPhase",
    "scope": "enterprise_86433",
    "filters": {
      "productType": + "case"
    }
  }
]

 

I see here two things:

  1. there is a + there that shouldn't be here. Remove it and try again.
  2. In case that it is still not working try to add square brackets [] on the filters piece: "filters": [{"productType":"case"}]

 Let's see if this works for you 😉

 

Regards,


Forum|alt.badge.img

Thank you for your reply.


Forum|alt.badge.img

Thanks for that great post!

 

, did this solve your question? If so, give 'em props and tell the community by clicking the Accept Solution button beneath post!

 

Thanks for your time in the community and appreciate your help!


Forum|alt.badge.img

No. Actual issue with template key. I have changed my template key. Now my code is working fine with all type of metadata filters.