Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
MarkM1
Contributor II
Contributor II

How do I format body for tREST post?

I am trying to connect to the Quickbooks API, I have worked through the OAUTH2 negotiation, and can make a single get request to work, but a POST to retrieve a list of accounts fails.

This is what I'm doing:

0695b00000qkuQ0AAI.png

0695b00000qktk0AAA.png

0695b00000qkuPrAAI.png

When run, this results in:

.-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------.

|                                               tLogRow_1                                               |

|=----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------=|

|Body                                                                                           |ERROR_CODE|

|=----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------=|

|{"Fault":{"Error":[{"Message":"Error parsing query","Detail":"QueryParserError: null","code":"4000","element":"Query"}],"type":"ValidationFault"},"time":"2023-10-23T08:40:40.002-07:00"}|400    |

'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------'

It seems to me that the body is not being encoded properly, but I can't determine the correct format for the body. The Query string works correctly in Postman, I copied it directly.

Labels (2)
2 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hello @Mark Murphy​ 

 

I haven't never used Quickbooks API, but looking into its doc it seems you should set the "Content type" header as "text/plain" and the HTTP Method would be GET instead of POST:

 

https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/companyinfo#query-companyinfo

MarkM1
Contributor II
Contributor II
Author

Turns out that POST is correct here, but I needed "Content-Type" = "application/text"