Happy Business Starts Here

Highlighted
Tutor

REST API response filtering

Hello everyone,

 

I am trying to use a Get request on Usage and ensure I am only seeing results where UsageForSubscription__c is equal to a specific order number. Is there a way to do this using REST API? I cannot seem to figure out how to filter my queries like I was able to do using SOAP. Thanks!

1 REPLY 1
Master

Re: REST API response filtering

Hi @agill86

 

Unfortunately, there is no way to filter custom fields in Get request.

 

Did you use query call when using SOAP?
https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E_SOAP_API_Calls/query_call

 

If so, query call can also be used in REST. This call is more appropriate for your situation than Get request.
REST Query call reference: https://www.zuora.com/developer/api-reference/#operation/Action_POSTquery

 

For example, you should make a request like this:

 

[POST] https://rest.apisandbox.zuora.com/v1/action/query
Body:

{
"queryString": "select Id from Usage where UsageForSubscription__c = 'a specific order number'"
}