Home > Software design >  Postman request - how to get data from endpoint based on API documentation
Postman request - how to get data from endpoint based on API documentation

Time:11-09

I want to retrieve data from a data warehouse that has a web-based API, I need to use an API key for authentication and use the GET / Customers command to retrieve the list of customers data, but when I am using that same thing in postman, it's returning the same documentation page of the data warehouse?

I am new to this any help will be really appreciated.

screenshot from the postman app

CodePudding user response:

The URL doesn't look valid:

enter image description here

You need a base URL, endpoint, http method, authentication scheme, and credential or a token etc.

I don't know details about your system and API, so let's see an example:

  • base url is https://stackoverflow.com; your current base url is localhost:4444, is your server running on your machine? If so, it might be correct, but I assumer you're talking about a server running somewhere else, not on your computer
  • endpoint (path parameter) is /questions/69883697, in your case /customers
  • http method is GET and you find it here in Postman; it also means it will not go into query parameters where you put it: enter image description here
  • authentication scheme - your docs mentions an api key that goes into a header called Authorization, so you have to set it in Headers, not as a query parameter: enter image description here

Read carefully what's on your screen, Postman uses the same language as your API documentation, so if your doc speaks about headers, you need to go into Headers tab in Postman.

  • Related