Happy Business Starts Here

Re: Getting 500 response on /action/query endpoint

Highlighted
Student

Getting 500 response on /action/query endpoint

Is the /action/query endpoint broken?

 

Running any example described on this page (whether on production or in the sandbox environment) fails with a 500 status response:

https://knowledgecenter.zuora.com/Central_Platform/Query/ZOQL

 

curl --request GET \
  --url https://rest.apisandbox.zuora.com/v1/action/query \
  --header 'authorization: Bearer XXXX' \
  --header 'content-type: application/json' \
  --data '{
"queryString": "select AccountId from Account"
}'

 

What I'm trying to do is to get the payment methods linked to a given account. A query for which there is no dedicated endpoint, other than using ZOQL query:

curl --request GET \
  --url https://rest.apisandbox.zuora.com/v1/action/query \
  --header 'authorization: Bearer XXXX' \
  --header 'content-type: application/json' \
  --data '{
	"queryString": "select Id from PaymentMethod where AccountId = '\''XXX'\''"
}'

 

Tags (4)
1 ACCEPTED SOLUTION

Accepted Solutions
Student

Re: Getting 500 response on /action/query endpoint

Turns out, the method ("GET") was wrong, it should have been a "POST".

 

Returning a 405 instead of a 500 would have made this clearer though.

View solution in original post

1 REPLY 1
Student

Re: Getting 500 response on /action/query endpoint

Turns out, the method ("GET") was wrong, it should have been a "POST".

 

Returning a 405 instead of a 500 would have made this clearer though.

View solution in original post