Are there any tricks to getting the generic http integration working? I’m trying to add a new data fetch to a page by clicking on new data query and choosing the generic http integration. I’m getting an “Internal Server Error” when trying to load the schema or previewing any endpoints. When I use Postman with the exact same settings I am able to successfully get json data. Any ideas would be most welcome!
Context: I’m querying the Swell commerce backend API. The end goal is to create a data fetch that can give me the carts/checkout_url value, so I can use Swell’s hosted checkout.
Hi @distinct_lizard , we aren’t generally equipped to help with specific apis that plasmic is being connected to, but I can take a best effort look with some limited knowledge of swell… Can you share screenshots showing what exactly is the error you are getting back and what is the query you are specifying within plasmic?
Appreciate the help! I configured authorization as Basic in the header on the page before this screenshot, which I assume is working because I’m getting a 500 error. I guess I’m expecting to be able to query the api from here and get json back, if I enter a valid endpoint like “carts” into the “Path” field. Does it work that way?
Using Chrome dev tools to monitor the request - when i hit the “Preview” button I see errant request get logged. Its actually making a POST request, not a GET, even though GET is selected in the dropdown and is the only option available.
Makes sense then. When I curl that swell api endpoint or do a get request from postman I get a 200. The only difference I can think of is here I’m using the backend API for these requests, which is a different path and uses the private key vs the frontend API which uses a public key. The swell plasmic integration uses the frontend API public key. Maybe swell doesnt like proxied backend API requests?
I also saw your other thread/question, that would actually be better since even if you get this to work, the Swell cart API expects to be run from the browser so that it can store session-specific cart info per unique browser
(The HTTP querying UI you see here runs from the Plasmic backend, whereas the HTTP Fetcher component runs from the user’s browser - it’s a bit confusing but we’ll be cleaning this up in the coming months, just trying to clarify for now)