EvoconHelp Center

API and integrations · Guide 5 of 8

Evocon API - Connecting OEE and Losses production data to Excel

How Evocon report API URLs are built and how to load OEE and Losses data into Excel with Power Query and Basic Authentication.

On this page
  1. General information
  2. Available API endpoints for common use cases
  3. Authentication
  4. Step by step guide to set up a connection
  5. Authentication errors
  6. Choosing which fields to show

General information

  • Base Evocon API URL is as follows
    • https://api.evocon.com/api/reports/
  • Report name is defined next. For example oee_json looks like
    • https://api.evocon.com/api/reports/oee_json
  • Report parameter(s) and their value(s) are defined next
    • ? is placed between report name and the first parameter
    • & is used between parameters if there are more than one
    • Examples
      • https://api.evocon.com/api/reports/oee_json?stationId=1
      • https://api.evocon.com/api/reports/oee_json?stationId=1&stationId=2
      • https://api.evocon.com/api/reports/oee_json?stationId=1&stationId=2&startTime=2025-01-01&endTime=2027-12-31
    • Which parameters can (or must) be used is defined by the custom report. Different reports may require or support different parameters based on their purpose.

Available API endpoints for common use cases

  • OEE endpoint - This returns time usage and quantity information needed for calculating OEE.
    • https://api.evocon.com/api/reports/oee_json?stationId=X&startTime=YYYY-MM-DD&endTime=YYYY-MM-DD
    • startTime and endTime are mandatory parameters!
    • Returned fields
  • Losses endpoint - This returns information about the stops and speed losses.
    • https://api.evocon.com/api/reports/losses_json?stationId=X&startTime=YYYY-MM-DD&endTime=YYYY-MM-DD
    • startTime and endTime are mandatory parameters!

Additional endpoints can be created upon request via support@evocon.com.

When requesting additional endpoints, make sure to add information about which parameters (filters) should be set and which fields the endpoint should return. An example of the table with mock data in Excel will help us give the best response about the possibility, implementation time and cost.

Authentication

Create an API key (instructions here).

The connection to Evocon API uses Basic Authentication. Excel has built-in support for connecting using Basic Authentication. The steps to connect and authenticate are below.

Step by step guide to set up a connection

  1. Open a new Excel sheet

  2. Optional - Set up dynamic parameters for the query. You can also write them in the API request URL and change them there if needed.

    1. Start time parameter - Required for most APIs
      1. Right click on a cell (A1 for example) and choose Define name.
      2. Write START in the Name field and click OK.
    2. End time parameter - Required for most APIs
      1. Right click on a cell (A2 for example) and choose Define name.
      2. Write END in the Name field and click OK.
    3. Station id parameter - Optional
      1. Right click on a cell (A3 for example) and choose Define name.
      2. Write STATION in the Name field and click OK.
    4. IMPORTANT - When the fields are named, select them, right click, choose Format cells and set the field type to Text. This way, Excel is not changing the format of the date.
  3. On the top ribbon, choose Data > Get Data > From Other Sources > From Web

    1. Click on the Advanced radio button
      1. Fill in the endpoint URL (you will have to use the parameters and actual dates at this stage). You can split the parameters up in parts.
      2. Click OK to load data.
  4. Access Web content window appears (if it does not, click here)

    1. Insert API key as User name and Secret key as Password.
    2. Click Connect
    Screenshot: Click Connect
  5. A Power Query Editor window appears

    1. You may see a "data privacy" message here. Choose Organizational for both data sources and click Save. Organizational level limits the visibility of a data source to a trusted group of people. It is isolated from all Public data sources, but is visible to other Organizational data sources. A common example is a Microsoft Word document on an intranet SharePoint site with permissions enabled for a trusted group.

      Screenshot: You may see a "data privacy" message here. Choose Organizational for both data sources and click Save. Organizational level limits the visibility of
    2. Click on List Tools > Transform on the top ribbon and then To Table in the top left corner. Click OK in the next window

      Screenshot: Click on List Tools  Transform on the top ribbon and then To Table in the top left corner. Click OK in the next window
    3. Click Transform on the top ribbon and then Expand in the far right. Make sure that all fields are checked, delete "Column1" from the Default column name prefix (optional) field and click OK

    4. Optional - If you set up parameters in step 2, right click oee_json?… in the left sidebar and choose Advanced editor

      1. You will see the Power Query code that makes the request.

        let Source =
        Json.Document(Web.Contents("https://api.evocon.com/api/rep
        stationId=1&stationId=2&startTime=2023-01-01&endTime=2025-
        #"Converted to Table" = Table.FromList(Source,
        Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        Column1" = Table.ExpandRecordColumn(#"Converted to Table",
        {"date", "technicalStopTimeSec", "lastModifiedTime", "tota
        "shift", "operatingTimeSec", "idealQty", "stationGroupId",
        "slowProduction", "station", "plannedTime", "plannedstops"
        "unplannedstops", "day", "stationId", "factory", "shiftId"
        "goodProdction", "goodProduction", "stationGroup", "goodQt
        "downtime", "month", "weekofyear", "uncommented"}, {"date"
        "technicalStopTimeSec", "lastModifiedTime", "totalQty", "s
        "operatingTimeSec", "idealQty", "stationGroupId", "slowPro
        "station", "plannedTime", "plannedstops", "unplannedstops"
        "stationId", "factory", "shiftId", "goodProdction", "goodP
        "stationGroup", "goodQty", "downtime", "month", "weekofyea
        "uncommented"}) in #"Expanded Column1"
        
      2. Here, add the lines between "let" and "Source" for the parameters that you set up in step 2. Do not add lines that are not configured in step 2.

        • "start" in the beginning is the parameter used in Power Query.
        • Name="START" specifies the name defined for a cell.
        start=Excel.CurrentWorkbook(){[Name="START"]}[Content]{0}
        [Column1], end=Excel.CurrentWorkbook(){[Name="END"]}
        [Content]{0}[Column1], station=Excel.CurrentWorkbook()
        {[Name="STATION"]}[Content]{0}[Column1],
        
      3. Then change the Source line to use the parameters. Below is an example for oee_json connection. Make sure to change the report name if you use a different endpoint.

        let start=Excel.CurrentWorkbook(){[Name="START"]}[Content
        end=Excel.CurrentWorkbook(){[Name="END"]}[Content]{0}[Colu
        station=Excel.CurrentWorkbook(){[Name="STATION"]}[Content
        Source =
        Json.Document(Web.Contents("https://api.evocon.com/api/rep
        stationId="&station&"&startTime="&start&"&endTime="&end)),
        to Table" = Table.FromList(Source, Splitter.SplitByNothing
        null, ExtraValues.Error), #"Expanded Column1" =
        Table.ExpandRecordColumn(#"Converted to Table", "Column1",
        "technicalStopTimeSec", "lastModifiedTime", "totalQty", "s
        "operatingTimeSec", "idealQty", "stationGroupId", "slowPro
        "station", "plannedTime", "plannedstops", "unplannedstops"
        "stationId", "factory", "shiftId", "goodProdction", "goodP
        "stationGroup", "goodQty", "downtime", "month", "weekofyea
        "uncommented"}, {"date", "technicalStopTimeSec", "lastModi
        "totalQty", "shift", "operatingTimeSec", "idealQty", "stat
        "slowProduction", "station", "plannedTime", "plannedstops"
        "unplannedstops", "day", "stationId", "factory", "shiftId"
        "goodProdction", "goodProduction", "stationGroup", "goodQt
        "downtime", "month", "weekofyear", "uncommented"}) in #"Ex
        Column1"
        
    5. You can edit the ordering of the columns, types of the fields and rename the columns as you wish.

    6. Finally, click Home on the top ribbon and then Close & Load.

  6. Now you have data from Evocon API connected to your Excel file. To reload data from the server, click Data on the top ribbon and then Refresh All. Activate the whole table and add a pivot table of pivot graph for further analysis.

Authentication errors

If the authentication window does not appear, it may be because there's already an existing data connection.

Screenshot: If the authentication window does not appear, it may be because there's already an existing data connection.

Example of an authentication error

To remove it, open Data > Get data > Data Source settings

And if there's anything with evocon.com in the Data sources in current workbook or Global permissions tabs, click on these lines and then click Edit Permissions….

Click Edit again

Screenshot: Click Edit again

Choose Basic and insert user name and password that were provided.

Screenshot: Keep in mind that this is not the same username and password that you use to log in at app.evocon.com.

After this step, try to get data from web again and Excel or Power BI should ask for the credentials.

Choosing which fields to show

We may add new fields to the report data from time to time. These will not change the way the report is calculated or grouped, but can include additional data about existing rows.

Click on the Data tab and Queries & Connections to open the sidebar.

Right-click on the query that you wish to edit and choose Edit.

Screenshot: Right-click on the query that you wish to edit and choose Edit.

Click Refresh Preview to load new data with latest available fields.

Screenshot: Click Refresh Preview to load new data with latest available fields.

Click the image for actual size