How to make REST Request to Baasbox server using POSTMAN extension? - json

I just installed Baasbox on my laptop and everything are work well. But when I try to make a request to create a new user, or anothe REST request using POSTMAN extension, I always got "Invalid Json" error. Is there any mistakes with my request?

it seems that you want to create a user.
In this case you have to set parameters like in the image below.
In particular you have to set "raw" instead of form-data, and also you do not need to set the Authorization header when signing up.
Further info here: BaasBox Signup API

Related

Set POST parameters correctly in an HTTP Retriever node

I want to hit a remote API using a post request. It's working fine with Python, but when it comes to my Knime workflow, the remote end is complaining that it can't find a needed parameter (type in the image below). What is the correct way to pass the post parameters in Knime? In Postman I would have a body tab for example to define everything I needed, but apparently I'm missing something in Knime.

React Native + fetch + API : DELETE request fails in App, works in Postman

We have an API that we are querying through React Native.
GET, POST request work flawlessly either in our app or in Postman.
DELETE doesn't work on the App, but the same request works with Postman.
What is even weirder is that :
If we delete the resource either with Django or Postman, making the exact same request from our app on the phone will give us a 404 response, telling us that indeed, it was deleted.
Which means that the call from our app is supposed to work since we get an answer from the API!
So, basically, the DELETE doesn't work from the app but if we delete the resource from elsewhere, it acts as if it works for real.
We tested it from two different phones, just in case...
And we are using Expo.
Example of our DELETE request :
https://apiurl/reservations/id_num {"method":"DELETE","headers":{"Accept":"application/json","Content-Type":"application/json","X-App-Token":"blablatoken","Authorization":"JWT blablasuperlongtoken"}}
UPDATE:
The question asked by MattyK14 was good, we get a 200 response which is supposed to be our GET response.
We investigated on this path but can't seem to find anything.
We are rebuilding the API using Axios as we can't find a thing and we will check.
FOUND THE ERROR!
We needed to add a trailing slash at the end of the API URL.
Django automatically transforms your DELETE request into a GET request if it doesn't get a trailing slash.
Thank you for your comments Matty and Arman.

I can`t connect from Node-RED to Freeboard.io using JSON

I trying to create a freeboard dashboard. I have a Arduino with four sensors that send their informations by mqtt. So, I on Node-RED I gen a JSON to response get request in /saida.
[{"id":"3f699b5.c91f064","type":"http response","z":"c7d4e8c8.509218","name":"","x":1184,"y":589,"wires":[]},{"id":"a3ed6250.1d64","type":"json","z":"c7d4e8c8.509218","name":"","x":1120.5,"y":540,"wires":[["3f699b5.c91f064"]]},{"id":"971f41c1.a1265","type":"function","z":"c7d4e8c8.509218","name":"","func":"msg.payload = {\"temperatura\":\"25\"}\nreturn msg;","outputs":1,"noerr":0,"x":1015.5,"y":584,"wires":[["a3ed6250.1d64"]]},{"id":"ed9f7a2a.604728","type":"http in","z":"c7d4e8c8.509218","name":"http in","url":"/saida","method":"get","swaggerDoc":"","x":850,"y":582,"wires":[["5b40d38c.5cc7ec","971f41c1.a1265"]]}]
In this moment, I`m using a static JSON to make a test. I have a use the host like:
my-public-host:1880/saida -> {"temperatura":"25"}
I access it by a proxy, the JSON returns ok. On ping.eu port check, the port is open. I ensure that my host is public.
But on my freeboard, I add it as datasource, then it says "never" update and I can`t read the JSON info.
What I should do to solve it?
I solved my problem.
There is a bug in freeboard.io. the thingproxy.freeboard.io don't work. The the browser don't let the freeboard.io make AJAX request for other link that isn't https. Besides, the browser don't let make a AJAX request for an other host.
There is two solutions:
Use sitelock on your host and add Access-Control-Allow-Origin to you response headers.
Use a https proxy and a browser extension to allow cross access.
bye!
Correct.
If the data source is flask based app, you can follow this link below to make freeboard read.
https://flask-cors.readthedocs.io/en/latest/

Chrome Postman missing wildfire headers (fire php)

I use FirePHP and FirePHP4Chrome to debug my applications, unfortunately in postman i don't see any Wildfire headars sent back along my responses. Is it possible to enable these headers and somehow use FirePHP4CHrome extension in the Postman to display messages on the console?
Had the same problem!
You need to manipulate the header of the request,
x-firephp-version:0.0.6
Then you get the messages.

how to reverse engineer an http API call using REST console

I'm trying to replicate a request I make on a website (ie zoominfo.com) using the same http POST parameters using chrome rest console, but it fails for some reason. I'm not sure if there is a missing field or it's not working because the origin of the request isn't valid.. can someone point me out in the right direction? Below is a detailed explanation of the experiment:
ORIGINAL CASE
basically if I go to zoominfo.com (registered and all) I see a form page that I need to fill:
if I hit enter.. the site makes an ajax call. If I open the chrome web dev tools, and open the network tab, I see the details of the ajax call:
notice the body of the POST has the name John Becker in it:
{"boardMember":{"value":"Include","isUsed":true},"workHistory":{"value":"CurrentAndPast","isUsed":true},"includePartialProfiles":{"value":true,"isUsed":true},"personName":{"value":"john%20becker","isUsed":true},"lastUpdated":{"value":0,"isUsed":true}}
the response is shown under the respones tag:
WHAT I'M TRYING TO DO
basically replicate what i've done above using a REST console (note: so there is nothing illegal here.. i'm just replacing a chrome browser action with a rest client action.. i'm not hacking anyone and i'm not getting information I can't get the normal way, but if someone feels otherwise.. please let me know)..
so I plug in the same parameters as above into the rest console:
now i'm not sure about authentication.. but just to be safe, i entered the same user name and pwd i have for the site into the REST console:
but then I keep on getting an error as a response to my rest console's request:
UPDATE: CORRECT ANSWER:
so according to JMTyler's answer.. I had to simply include criteria in the RAW body, and convert it to url encoding.. in addition to that, I had to explicitly set the encoding in the rest console body..
looking at the chrome inspector more closely, it turns out that I simply had to click on view source:
to get the url-encoded value that I needed to put in the RAW body in the rest console:
I also had to set encoding to gzip,deflate,sdch and things worked fine!
The form is posting all that JSON under the field criteria. You can see this in the screencap of the chrome dev console you posted.
Just start your raw body in rest console with criteria= and make sure the json has been url-encoded. That should do it.
No authentication is needed because none is passed through the headers in your screencap. Any cookies you have when you load the page normally will also be loaded through rest console, so you don't need to worry about explicitly setting them.
Reading your problems I'll make an educated guess:
zoominfo does not provide an RESTful API.
Rest-Console understands and uses HTTP Authentication, which is different from the authentication handler zoominfo implemented.
A possible way to work around may be:
Make a call to the login-page via rest console. you'll get back cookies and a lot more.
In subsequent requests to zoominfo be sure to include those cookies (likely holding some session information) in your request, therefore acting like a browser.