Hey bubblers,
I’m working on querying our elastic search Database using the API connector.
Elastic search recommends using request body get requests, but I can’t seem to find out if this is supporter by bubble and if so, how to do it.
I can get basic data back using query string in the URL, but can’t get the data I need this way.
Any contents would be greatly appreciated.
1 Like
Jici
May 20, 2020, 1:34am
2
Yes this si supported.
You can use different way like using parameters, json body and setting param=¶m2= or use in the link ?param=[params]¶ms2=[params2] … this depend of the API you are calling.
So can I do nested response body queries?
GET /twitter/_search
{
“query” : {
“term” : { “user” : “kimchy” }
}
}
Jici
May 20, 2020, 1:42am
4
Yes. If you provide link to api endpoint, it will be easier to help.
but in your case, if this is json
you will set this like that:
{
“query” : {
“term” : { “user” : “<user>” }
}
}
@Jici How do you produce that structure in the API connector though?
Jici
May 20, 2020, 2:36am
6
The way I show you.
Maybe you can provide screenshot of your setting
Jici
May 20, 2020, 3:09am
8
Your call is a GET so it won’t allow your to POST a json. Normally a GET request use url parameter. Do you have any API doc? In some case, the request quand use a form like
url?query={json payload}
Jici
May 20, 2020, 3:17am
10
According to this link. You can do both. GET or POST
if you switch to POST, you will have json body
oh yes, you are right! I missed that, thanks. Let me test a few things with Post.
Jici
May 20, 2020, 3:18am
12
If you use GET /twitter/_search?q=user:kimchy
If you use POST, I suggest to use
{
“query” : {
“term” : { “user” : “kimchy” }
}
}
Still seam to have an issue? I am getting this error:
There was an issue setting up your call.
undefined error: this header name is not correct undefined