< Home

Information about Using the Visipec API

Technical Information

The Visipec API is a REST API. Responses to requests are returned in JSON or Excel format. All communication between server and client are require an HTTPS protocol to increase security in information transmission.

For specific technical documentation about Visipec API endpoints and parameters, visit API Documentation.

Requesting Access

VISIPEC was developed specifically for meatpacking companies (and monitoring companies) in Brazil to help strengthen supply chain management systems and improve the decision-making process for cattle purchases. It is freely available to the meatpacking industry in Brazil, and is intended to complement the meatpacker’s existing supply chain monitoring and traceability systems for direct suppliers by providing enhanced visibility to the complex network of indirect suppliers. It is not intended to replace existing systems. VISIPEC can also provide aggregate information and summary report for retailers, supermarkets, banks, investors, and financial intuitions.

Interested parties can contact Simon Hall (halls@nwf.org), or Lisa Rausch (lisa@visipec.com) to discuss receiving access credentials to use the Visipec API.

When sending a request, please include the following elements of information:

Using the Visipec API Client

To encourage adoption of the Visipec API, we have developed a simple API Client program that can be used to communicate directly with the Visipec API. Users will be required to have valid access credentials for the Client to communicate successfully with the Visipec API.

The Visipec API Client is available for Windows and Mac operating systems. Instructions for downloading and using the Visipec API Client follow. Use the Windows or Mac instructions below based on the operating system of your computer.

Visipec API Client (Windows Version)

  1. Request access credentials (see Requesting Access above).
  2. Download and install .NET Core on your Windows machine using the installer here.
  3. Download the Visipec Api Client here
  4. Once the zip file is downloaded, extract the Client program files from the zip file to a folder on your local computer. Ensure that you have write and execute privileges at this location.

        For example: C:\VisipecApiClient
  5. Open the new folder containing the extracted Client program files and navigate to the folder called “Properties”.
  6. Within the “Properties” folder, open the file called appSettings.json using a text editor (e.g., WordPad or Notepad).
  7. Replace the value for “userId” with the access credentials that were supplied to you and then save the file.

        For example:  "userId": "85146a97-dfaf-4165-ab31-39g80c0fdba7e",
  8. Open a new Command Prompt

        Windows Start Menu > Type “cmd”
  9. Navigate to the directory containing the Visipec API Client program files:

        cd "c:\VisipecApiClient"
  10. Type the following command to run a test to ensure the Client is functioning properly:

        dotnet VisipecApiClient.dll -information

    Example result should look like this:
    {"Successo":true,"Comunicaçao":null,"Resposta":{"Versao":"1.0","Lançado":"2018-11-08T00:00:00","Atualizado":"2018-11-08T00:00:00","TransaçoesContagem":15448871},"Pedido":null}

If you experience any issues setting up your Visipec API Client, please email your issues to support@visipec.com.

See Operating the Visipec API Client (Command Line Options) section below for details on how to use the Client now that you have it installed.

Visipec API Client (Mac OS Version)

  1. Request access credentials (see Requesting Access above).
  2. Download and install .NET Core on your machine using the installer here.
  3. Download the Visipec Api Client here
  4. Once the zip file is downloaded, extract the Client program files from the zip file to a to a folder on your local computer. Ensure that you have write and execute privileges at this location.

        For example: /users/username/desktop/VisipecApiClient
  5. Open the new folder containing the extracted Client program files and navigate to the folder called “Properties”.
  6. Within the “Properties” folder, open the file called appSettings.json using a text editor (e.g., TextEdit).
  7. Replace the value for “userId” with the access credentials that were supplied to you and then save the file.

        For example:  "userId": "85146a97-dfaf-4165-ab31-39g80c0fdba7e",
  8. Open a new Terminal window
  9. Navigate to the directory containing the Visipec API Client program files:

        For example:  cd /users/username/desktop/VisipecApiClient
  10. Type the following command to run a test to ensure the Client is functioning properly:

        dotnet VisipecApiClient.dll -information

    Example result should look like this:
    {"Successo":true,"Comunicaçao":null,"Resposta":{"Versao":"1.0","Lançado":"2018-11-08T00:00:00","Atualizado":"2018-11-08T00:00:00","TransaçoesContagem":15448871},"Pedido":null}

If you experience any issues setting up your Visipec API Client, please email your issues to support@visipec.com.

See Operating the Visipec API Client (Command Line Options) section below for details on how to use the Client now that you have it installed.


Operating the Visipec API Client (Command Line Options)

Note: Output of the Viispec API is JSON structured data. If you do not already use a JSON viewer and would like to view the data in an easy-to-read interface, free JSON viewers exist, e.g., http://jsonviewer.stack.hu or https://jsoneditoronline.org.

API Information Request

Usage:
dotnet VisipecApiClient.dll -information -out outputFilePath

Parameters:
Name Expectected Input Required Description
-out outputFilePath No Location to save response from server to. If left blank, output will be printed to the screen.

Property Search (JSON)

Usage:
dotnet VisipecApiClient.dll -property carNumbers -bp-start bpStartDate -bp-end bpEndDate -out outputFilePath

Parameters:
Name Expectected Input Required Description
-property carNumbers Yes Comma separated list of CAR numbers to request information on.
-out outputFilePath No Location to save response from server to. If left blank, output will be printed to the screen.
-bp-start bpStartDate No Transaction start date used to calculate Boas Practicas deforestation date ranges
-bp-end bpEndDate No Transaction end date used to calculate Boas Practicas deforestation date ranges

Property Search Summary (Excel)

Usage:
dotnet VisipecApiClient.dll -property carNumbers -bp-start bpStartDate -bp-end bpEndDate -out outputFilePath

Parameters:
Name Expectected Input Required Description
-property-summary carNumbers Yes Comma separated list of CAR numbers to request information on.
-out outputFilePath No Location to save response from server to. If left blank, output will be printed to the screen.
-bp-start bpStartDate No Transaction start date used to calculate Boas Practicas deforestation date ranges
-bp-end bpEndDate No Transaction end date used to calculate Boas Practicas deforestation date ranges

Slaughterhouse Search (JSON)

Usage:
dotnet VisipecApiClient.dll -slaughterhouse sifNumber -bp-start bpStartDate -bp-end bpEndDate -out outputFilePath

Parameters:
Name Expectected Input Required Description
-slaughterhouse sifNumber Yes A single SIF number.
-out outputFilePath No Location to save response from server to. If left blank, output will be printed to the screen.
-bp-start bpStartDate No All transactions between suppliers and the SIF will be after this date. This date is also used to calculate Boas Practicas deforestation date ranges.
-bp-end bpEndDate No All transactions between suppliers and the SIF will be before this date
-car carFilter No A comma separated list of CAR numbers to filter output on

Slaughterhouse Search Summary (Excel)

Usage:
dotnet VisipecApiClient.dll -slaughterhouse sifNumber -bp-start bpStartDate -bp-end bpEndDate -out outputFilePath

Parameters:
Name Expectected Input Required Description
-slaughterhouse-summary sifNumber Yes A single SIF number.
-out outputDirectoryPath No Directory to save response from server to. If left blank, output will be printed to the screen.
-bp-start bpStartDate No All transactions between suppliers and the SIF will be after this date. This date is also used to calculate Boas Practicas deforestation date ranges.
-bp-end bpEndDate No All transactions between suppliers and the SIF will be before this date
-car carFilter No A comma separated list of CAR numbers to filter output on

Using a Custom or Generic REST API Client

For specific technical documentation about Visipec API endpoints and parameters, visit https://api.visipec.com/api-documentation.html.

Authentication

To initiate a valid user session with the Visipec API, users must first authenticate to the system using a POST request to the Jwt endpoint. Valid requests will receive a Jwt bearer token in response. This Jwt bearer token can be used to submit future requests to the Visipec API until the session expires.

For example, using a common generic client such as curl, a user could send the following request to the Visipec API:

curl -X POST "https://api.visipec.com/api/Jwt" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"Token\": \"YOUR-TOKEN-HERE\"}"

Jwt Bearer Tokens

The authentication POST above will return a Jwt (JSON Web Tokens) Bearer token that will be required for any valid request to Visipec API property and slaughterhouse endpoints.

Example Requests

Information endpoint: curl -X GET "https://api.visipec.com/api/informacao" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE" Property endpoint: curl -X GET "https://api.visipec.com/api/v10/propriedade?carNumbers=MT-5106158-DCA64AE01E2A440C83ACDC860E9A770F&pageNum=1" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE"
curl -X GET "https://api.visipec.com/api/v10/propriedade?carNumbers=MT-5106158-DCA64AE01E2A440C83ACDC860E9A770F&bpStartDate=1/1/2020&bpEndDate=2/1/2020&pageNum=1" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE"
Property summary endpoint: curl -X GET "https://api.visipec.com/api/v10/propriedade-resumo?carNumbers=MT-5106158-DCA64AE01E2A440C83ACDC860E9A770F&pageNum=1" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE" --output c:\temp\output.zip

curl -X GET "https://api.visipec.com/api/v10/propriedade-resumo?carNumbers=MT-5106158-DCA64AE01E2A440C83ACDC860E9A770F&bpStartDate=1/1/2020&bpEndDate=2/1/2020&pageNum=1" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE" --output c:\temp\output.zip
Slaughterhouse endpoint: curl -X GET "https://api.visipec.com/api/v10/frigorifico?sifs=4554&pageNum=1" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE"

curl -X GET "https://api.visipec.com/api/v10/frigorifico?sifs=4554&bpStartDate=1/1/2020&bpEndDate=2/1/2020&carFilter=MT-5106158-DCA64AE01E2A440C83ACDC860E9A770F&carFilter=PA-5106158-DCA64AE01E2A440C83ACDC860E9A770F&pageNum=1" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE"
Slaughterhouse summary endpoint: curl -X GET "https://api.visipec.com/api/v10/frigorifico-resumo?sifs=4554&pageNum=1" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE" --output c:\temp\output.zip

curl -X GET "https://api.visipec.com/api/v10/frigorifico-resumo?sifs=4554&bpStartDate=1/1/2020&bpEndDate=2/1/2020&carFilter=MT-5106158-DCA64AE01E2A440C83ACDC860E9A770F&carFilter=PA-5106158-DCA64AE01E2A440C83ACDC860E9A770F&pageNum=1" -H "accept: application/json" -H "Authorization: Bearer JWT TOKEN HERE" --output c:\temp\output.zip

Note that the Slaughterhouse endpoint is only available with permission from the Visipec API administrators. Please contact Simon Hall (halls@nwf.org), or Lisa Rausch (lisa@visipec.com) to discuss receiving access to search data related to a specified SIF number.