Data is the driving force behind Smart Contracts. Learn how to provide the data required to execute your smart contracts.
Prerequisites
-
Basic knowledge of how APIs work
-
Basic programming experience
-
API URL
-
API Key
-
Basic understanding of DG data models
-
Basic understanding of GraphQL
Sending data to Data Gumbo is done via our APIs. If for some reason accessing our APIs is not possible, reach out to the Customer Success team for other options.
Data Gumbo categorizes data into one of two buckets: “structured” and “unstructured”. There is no initial obvious demarcation between the two kinds of data except for which API is used. This article will focus on “structured” data.
Unstructured
“Unstructured” data is usually high-frequency data such as sensor readings. Due to the large and varying nature of these kinds of data sets, the “unstructured” API has been specifically designed to handle working with big data sets with many timestamps and differing formats. Sometimes this data can be referred to as “Time Series” data.
Structured
Everything that doesn’t fall into the “unstructured” bucket is considered “structured”. Another way to easily identify “structured” data is to cross-reference the model being used with the models detailed on the Voyager page. The bulk of data interactions happens with “structured” data.
The following instructions detail how to construct an HTTP request. Where and how the request is executed is completely up to the user and will not be covered in this article.
The API Playground can be used to interact with “structured” data. Postman is a tool that can be used to interact with both “structured” and “unstructured” data.
Structured
-
Get the Base URL using the link above
-
Add Request Headers
apiKey - this is a Data Gumbo provided key
-
Construct the JSON request payload
The request payload will differ for every kind of model but will follow this basic structure:
- Send Request via HTTP POST
- Verify returned data
A malformed payload will result in an error but the request will still return a 200 Status Code - The response must be checked for any errors
- Response WITH Error
- Response WITHOUT Error
There are multiple ways to construct a GraphQL Query. Here is an example.