In this article, we will see how Postman is used with our API.
Postman is a platform for building and using APIs.
Postman can be used through your web browser after sign-up. The Postman app can be downloaded here.
GET
This is the window you will see once you have registered and opened Postman.
- GET – Here you will define what kind of operation you would like to perform. In RecMan, we use GET and POST, but in this example, we will use GET.
- URL – If you are performing a GET, you can type an URL with scope, type and fields here. See examples in the articles.
- Send – Once all the information is in place, you press Send in order to perform the selected operation and fetch information from your database.
-
This bar has some options, but when performing a GET, you only need to worry about the Headers button. The Header tab has to contain the following information:
- Displayed here is what your operation returned. In this example, the return was Job Posts, and the output is in JSON.
- Here you can see your previous operations. You can easily go back to previous operations and perform them again.
POST
When performing a POST, your screen will look slightly different, and you define scope, field and KEY in a different location.
Note
Please note that any operation performed with a POST will make changes to your system. You can potentially delete information in your RecMan system.
- POST – We have defined that we will perform a POST from the menu.
- The URL when performing a POST is always https://api.recman.no/post/.
Note
Make sure that the URL you use when performing a post is identical to this one. A single typing error will result in a failed operation.
- SEND – After you have defined everything, you press SEND in order to execute the operation.
- While the Header should look the same as it did on GET, the important field here is the Body. As shown in the example, your operation is now defined by a script rather than the URL, and here the syntax is important. Please see examples in the POST articles.
- The output. The only result you get when performing a POST is «success»: true or «success»: false, depending on the success of the operation.
- The log of your previous GETs and POSTs.