Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-06-2019 12:11 PM
Hey guys,
Pretty new here and having problems making an API call in the neo4j browser:
with 'https://api.domo.com/xxxxxxx' as url call apoc.load.jsonParams(url,{Authorization:"Bearer xxxx"}, '{ "sql": "SELECT * FROM table" }') YIELD value as df return df
I get an error response that says "Server returned HTTP response code: 400" among other things indicating that domo feels the request is malformed. I can run the same request through Postman and everything seems fine and I can make a similar request successfully in neo4j. I couldn't find any examples using Google where somebody passed a payload. A search in this forum turned up only one. I modified my request to match the example:
with 'https://api.domo.com/xxxxxxx' as url call apoc.load.jsonParams(url,{Authorization:"Bearer xxxx", Method:"Post"}, apoc.convert.toJson({sql: "SELECT * FROM table" })) YIELD value as df return df
but still get a 400 error. I'm out of options...any ideas?
Solved! Go to Solution.
09-06-2019 02:53 PM
Hallelujah, I finally figured it out:
with 'https://api.domo.com/xxxxxxx' as url call apoc.load.jsonParams(url,{`Content-Type`:"application/json", Authorization:"Bearer xxxx", Method:"Post"}, apoc.convert.toJson({sql: "SELECT * FROM table" })) YIELD value as df return df
I had forgotten the Content-Type in the header.
09-06-2019 02:53 PM
Hallelujah, I finally figured it out:
with 'https://api.domo.com/xxxxxxx' as url call apoc.load.jsonParams(url,{`Content-Type`:"application/json", Authorization:"Bearer xxxx", Method:"Post"}, apoc.convert.toJson({sql: "SELECT * FROM table" })) YIELD value as df return df
I had forgotten the Content-Type in the header.
All the sessions of the conference are now available online