Query device data from Fogwing using API

Learn to query your IoT device data from Fogwing IIoT Storage using API

Harry avatar
Written by Harry
Updated over a week ago

Fogwing Industrial IoT Platform provides inbuilt data storage for aggregating all machine or device data received through IoThub. These data can be extracted by users or application and send to any third party system or cloud storage environment without any limitations.

There are 2 different way to take the data from Fogwing storage to any applications or systems.

  • Open API Integration

  • Zapier Integration

In this article, we will be learning about data extraction through Data Storage API interface hosted in the Fogwing IIoT Platform.

Please note that Fogwing IIoT Platform supports key based API interface for standard integration.

Pre-condition:

Before go further detail into API interface and integration approach, you should have the following in your Fogwing account.

  • Account Admin privilege to create API keys for inbuilt interfaces

  • You should have Application, Edge Device and IoTHub access to receive data from device.

  • You must have sent IoT data to Fogwing Platform prior to run API query for proper API response.

How to create API Key in Fogwing Platform?

1. Login into your Fogwing account and navigate to Administration -> Settings -> API Keys.

2. Click on Add key button to generate API-KEY for all services as shown below.

3. Once API-KEY is successfully generated, you will find the Key with other details as shown below.

Now, API Key has been created for Fogwing API interfaces. Using API key, you can access the data from any of the API Client application from anywhere.

If you are unfamiliar with API client programming and accessing the API using key, you may try with Postman tool.

How to validate Data Storage API using Postman?

The Fogwing Data Storage API is using API Key for authentication. Any program should pass the API Key with keyword apiKey in query parameter along additional parameter of devEui, startDate & endDate.

An example using postman would look like this:

If you do not have Postman, please download the Postman using below link. https://www.postman.com/downloads/

Query Params:

apiKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
devEui: xxxxxxxxxxxxxxxx
startDate: DD-MM-YY
endDate: DD-MM-YY

How to validate Data Storage API using Swagger doc?

The Fogwing APIs are also available with Swagger documentation. The Data Storage API's swagger doc is available in this path:

The following steps will guide you to access the swagger doc and validate the APIs easily.

1. Open the above link in any web browser, you see something as shown below.

2. Click on All contain methods provided by Data Storage API, it will show all the

methods available in the API.

Select the second from the list that is getData/withApiKey.

3. Open the API by clicking on GET button, provide the all the necessary details, and click on Execute button to fetch all the data.

For example:

apiKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
devEui: xxxxxxxxxxxxxxxxxxx
startDate: DD-MM-YY
endDate: DD-MM-YY

4. Provided everything goes in line with the above-mentioned instructions, you will be able to see all the data from Fogwing Data Storage.

How to extract data from Fogwing using Token based API?

In addition to key based API, Fogwing also provides token based API for third party applications directly integrate with Fogwing Platform.

Data Storage API with Swagger docs: https://enterprise.fogwing.net/api/dstorage/doc

1. Open the above link in any web browser, you see something as shown below.

2. Now when you choose All contain methods supplied by Data Storage API, all the API's methods will be displayed. First select the /getApiToken method from the list as the as shown below.

3. Click on POST button and enter the Fogwing Platform credentials by clicking on Try it out button. Once the credentials are entered hit the execute button.

If the entered credentials are successfully validated than it will generate a Token, as shown below.

4. Authorize the API by clicking on Authorize button and paste the Token into value field.

Once Successfully validated, then close the window.

5. Once authorization is done, select the getData/withApiToken/{dev_eui}/{start_date}/{end_date} method from the list as the as shown below.

6. Click on GET and enter dev_eui, start_date, end_date and hit execute button.

For example:

            dev_eui: xxxxxxxxxxxxxxxxx
start_date: DD-MM-YY
end_date: DD-MM-YY

7. Provided everything goes in line with the above-mentioned instructions, you will be able to see all the data from Fogwing Data Storage.

For any feedback and enquires on the functionalities, write to our support team at

Did this answer your question?