V10 ResourcesWeb API
ResourcesWeb API
Web API
Back | List of Articles

Using Postman to test the WebAPI

Last changed in 02/12/2020

Postman is a tool that allows you to test REST services (Web APIs) through an intuitive interface. In addition to sending HTTP requests, this tool analyzes the responses, presenting them in a way that is simple and easy to understand.

PRIMAVERA ERP 10

Getting started with Postman

1 - Download and install the Postman application available from https://www.getpostman.com;
2 - Press the Run in Postman button;
3 -
Select your desktop;
4 - Change the value of environment variables according to your installation;
5 - Select the token element from the tree and then Token Request;
6 - Press Send. The response will be displayed in the Body tab. In this case, the necessary authorization is returned so that you can make the following requests from the Web API.

 width=

Token request

The Token request must be the first request made when the Web API is used. This gives customers an authorization that will enable them to carry out the necessary operations. In the case of the PRIMAVERA ERP, there are two situations where this order can use different parameters, depending on the endpoint consumed. For example, to obtain a list of company codes, you do not need to specify the company, so this parameter can be skipped and the system will return the requested authorization. However, if this token is used to access another company-dependent resource, the system will return an unauthorized error.

 width=

Environment variables

These variables are a very important resource when working with multiple Collections in postman. To avoid always writing the same parameters in all requests, you can create and assign a value to environment variables. In this sense, in the ERP Collection, there is an 'ERPERP10-Env-Variables' environment that stores all used variables. To use this Collection, you need to modify these variables according to your reality.

  • ApiUrl: Web API URL, typically http://localhost:2018/WebApi/
  • Username: Username used for the ERP
  • Password: Password used for the ERP user
  • Company: Company code
  • Instance: ERP instance, typically 'Default'
  • GrandType: Authentication type used by the OAuth framework 2. In this case it will always be 'password'
  • FirstToken/SecondToken: Variables used by PRIMAVERA
Bookmark or share this article
Esta página foi útil?
Obrigado pelo seu voto.

login para deixar a sua opinião.

Obrigado pelo seu feedback. Iremos analisá-lo para continuarmos a melhorar!
Artigos Relacionados
Utilizar o Postman para testar a WebAPI Formato dos pedidos Web API ERP10 Características da Web API Como executar listas na WebAPI? Web API - Conceitos e Arquitetura