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

Format of the ERP10 Web API requests

Last changed in 02/12/2020

The endpoints available in the Web API require request parameters and return different responses depending on the associated operation.

Although there are endpoints that provide specific operations for certain entities, depending on the business logic of these entities, the input parameters and the responses types of the following main operations are:

  • Creating/Updating a record (POST)
  • Cancelling a record (DELETE)
  • Viewing a record (GET)
  • Viewing record attributes (GET)

Creating and updating a record (POST)

URL:

http://localhost:2018/WebApi/Base/Artigos/Actualiza

Parameters:

  • In this case, the only parameter is the record to be created itself, serialized in JSON, in the body of the message.
  • To update a record, simply include the following information in the body of the message 'EmModoEdicao': true.

Expected status code:

  • 204 (No Content): indicates that the record was successfully created.

Viewing a record (GET)

URL

: http://localhost:2018/WebApi/Base/Artigos/Edita/{key}

Parameters:

  • key: the identifier or key of the record to be viewed.

Expected status code:

  • 200 (OK): indicates that the record was successfully returned.

Expected result:

  • The selected record, serialized in JSON, in the body of the message.

Viewing a record value (GET)

URL

: http://localhost:2018/WebApi/Base/Artigos/Edita/{chave}/{Attribute}

Parameters:

  • Key: the identifier or key of the record to be viewed.
  • Attribute: The name of the database field you want to view.

Expected status code:

  • 200 (OK): indicates that the record was successfully returned.

Expected result:

  • The selected record, serialized in JSON, in the body of the message.

Viewing several record values (GET)

URL:

http://localhost:2018/WebApi/Base/Artigos/Edita/{key}

Parameters:

  • Key: the identifier or key of the record to be viewed.

Message Body

  • Include the name of the fields of the several attributes to be viewed in JSON format in the body of the message.

Expected status code:

  • 200 (OK): indicates that the record was successfully returned.

Expected result:

  • The selected record, serialized in JSON, in the body of the message.

The results documented above correspond to successful situations in which the endpoint performs the expected operation without errors. The Web API returns other codes in case of error and, in such cases, may return other responses with information about the errors (for example, when a parameter validation fails).

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