Start on API Map node docs

This commit is contained in:
Brenden Harrell committed 2021-06-03 21:49:34 -05:00
1 parent d3ff0c5c49
commit 25c007fb3f
5 files changed
+172 -37

No files matched your search

@@ -20,7 +20,7 @@
"updated": 1622685164654
},
{
"style": "Javascript",
"style": "Json",
"text": "{\n \"codeName\": \"currentBaseAsset\",\n \"isString\": false,\n \"isOptional\": false,\n \"description\": \"\",\n \"replaceBy\": \"@BaseAsset\"\n}",
"updated": 1622685104193
},
@@ -1,28 +1,43 @@
{
"type": "API Path Parameter",
"definition": {
"text": "Path parameter is the type of parameters that is embedded as part of an URL path. It could be fixed string of text or it could be a parameter that is replaced by the API Fetcher Bot for some value at runtime.",
"updated": 1621018173339
"text": "A path parameter defines the unique path to your endpoint. \nFor a full description of how to identify a path parameter see the API Path Parameters page.",
"updated": 1622774607176
},
"paragraphs": [
{
"style": "Text",
"text": "A path parameter can be a fixed string of text defined at an API Path Parameter node, or it can be dynamically replaced by the API Fetcher Bot for a value generated at runtime.",
"updated": 1622772709866
},
{
"style": "Title",
"text": "Configuration",
"updated": 1621018220723
},
{
"style": "Subtitle",
"text": "Important Properties"
"text": "Configuration Properties",
"updated": 1622772725049
},
{
"style": "List",
"text": "codeName: here you must write the exact string that is going to be used to form the URL path. ",
"updated": 1621950838675
"text": "codeName: This property holds the value used to help build the request URL.",
"updated": 1622773158340
},
{
"style": "Important",
"text": "Becareful to write the exact string specified in the API documentation. Extra spaces, or capital letters will break the URL and cause it to return an error.",
"updated": 1622773133088
},
{
"style": "List",
"text": "replaceBy: this property allows you to instruct the API Fetcher Bot to set a value to this parameter replacing the current default and using contextual information available only at runtime. ",
"updated": 1622477486319
"text": "replaceBy: This property allows you to instruct the API Fetcher Bot to set a value to this parameter replacing the current default and using contextual information available only at runtime.",
"updated": 1622773172219
},
{
"style": "Text",
"text": "Here is an example of an API Path Parameter config:"
},
{
"style": "Json",
"text": "{\n \"codeName\": \"currentBaseAsset\",\n \"isString\": true,\n \"isOptional\": false,\n \"description\": \"Get statistics for the current base asset\",\n \"replaceBy\": \"@BaseAssetNameLowercase\"\n}",
"updated": 1622774822924
},
{
"style": "Include",
@@ -1,22 +1,121 @@
{
"type": "API Path Parameters",
"definition": {
"text": "Path parameters are the type of parameters that are embedded as part of an URL path. They could be a fixed string of texts or they could be a parameter that is replaced by the API Fetcher Bot for some value at runtime.",
"updated": 1622336383876
"text": "API Path Parameters are embedded as part of an URL path. They allow you to specify the unique path to your endpoint.",
"updated": 1622771530317
},
"paragraphs": [
{
"style": "Text",
"text": "When found at an API Map they define the default values for each parameter, whicle when found at a Data Mine, they define the actual values to be used, which overrides the defaults.",
"updated": 1621022867854
},
{
"style": "Title",
"text": "How to identify them?"
"text": "How to identify API Path Parameters",
"updated": 1622772536805
},
{
"style": "Text",
"text": "The API your are trying to map shold have it's API Path Parameters documented. If not, check any example provided there of how to request the data and see if there are inner folders below the folder of the API Enpoint. These folders are, each one, one API Path Parameter that needs to be defined. As everything else in Superalgos, this current node children are considered clockwise, that defines the order in which the path will be constructed at runtime."
"text": "The API you are trying to map should have it's API Path Parameters documented. If not, check any examples they may provide for how to request the data and see if there are inner folders below the main folder of the API Enpoint. Each one of these folders are an API Path Parameter that needs to be defined.",
"updated": 1622772590217
},
{
"style": "Success",
"text": "As with everything else in Superalgos, node children are considered clockwise. This is important because it will affect the order in which Superalgos builds the URL request you will send to the API.",
"updated": 1622773291926
},
{
"style": "Text",
"text": "Here are some examples of API request URLs:"
},
{
"style": "Javascript",
"text": "https://api.coingecko.com/api/v3/coins/bitcoin?",
"updated": 1622773573541
},
{
"style": "Javascript",
"text": "https://data.messari.io/api/v1/assets/btc?",
"updated": 1622773581349
},
{
"style": "Subtitle",
"text": "Sections of an API Request URL",
"updated": 1622773855472
},
{
"style": "Text",
"text": "Let's break down one of these URLs and identify each part of it."
},
{
"style": "List",
"text": "Internet Protocol: This is the section on the very front of almost any internet link you will see.",
"updated": 1622774168610
},
{
"style": "Javascript",
"text": "https",
"updated": 1622774200879
},
{
"style": "Note",
"text": "You define this using the protocol config property in the main API Map node."
},
{
"style": "List",
"text": "Root Domain Name: This is the section of the URL that is before the first backslash:"
},
{
"style": "Javascript",
"text": "data.messari.io"
},
{
"style": "Note",
"text": "You define this using the hostName config property in the main API Map node. ",
"updated": 1622774031960
},
{
"style": "List",
"text": "API Path: This is the section that defines the main path to the API:"
},
{
"style": "Javascript",
"text": "api"
},
{
"style": "Note",
"text": "You define this using the path config property in the main API Map node.",
"updated": 1622773958109
},
{
"style": "List",
"text": "API Version Number: This is the section that defines the API version to which you are making requests."
},
{
"style": "Javascript",
"text": "v1"
},
{
"style": "Note",
"text": "You define this using the codename config property in the API Versioin node."
},
{
"style": "List",
"text": "Path Parameters: These are the remaning sections of the path before the question mark:"
},
{
"style": "Javascript",
"text": "assets ",
"updated": 1622774373224
},
{
"style": "Javascript",
"text": "btc"
},
{
"style": "Note",
"text": "You define each of these using the codeName config property in the API Path Parameter node.",
"updated": 1622774459925
},
{
"style": "Text",
"text": ""
},
{
"style": "Include",
@@ -1,14 +1,18 @@
{
"type": "API Query Parameter",
"definition": {
"text": "This node represent a single query string parameter.",
"updated": 1621022326307
"text": "This node represent a single query parameter. For a full definition of what a query parameter is please see the API Query Parameters page.",
"updated": 1622771217708
},
"paragraphs": [
{
"style": "Success",
"text": "Even if you are not using every query parameter offered for an endpoint. For the sake of completness, it is a good idea to add it to the map and delete the value property.",
"updated": 1622765045028
},
{
"style": "Subtitle",
"text": "Configuration",
"updated": 1621022390398
"text": "Configuration"
},
{
"style": "List",
@@ -16,13 +20,28 @@
},
{
"style": "List",
"text": "value: It is the value to be used at this parameter. The API Map can define the value, that would be considered a default value. The same parameter defined at the Data Mine will have the actual value to be used replacing the default. If you are defining a API Map to be shared as a Plugin, you can avoid setting this property at the API Map level, and let the users set it at their Data Mine when they use your API Map. For completness, this parameter should be included at the the API Map even if the value property is not there.",
"updated": 1622160191941
"text": "value: This is the value to be used by the parameter. ",
"updated": 1622764598076
},
{
"style": "Note",
"text": "The value you type into the API Map will be considered the default value. The same parameter can be dynamically pulled from a users system using the replaceBy property. When the replaceBy property is used the default value will be overwritten.",
"updated": 1622771817973
},
{
"style": "List",
"text": "replaceBy: this property allows you to instruct the API Fetcher Bot to set a value to this parameter replacing the current default and using contextual information available only at runtime. ",
"updated": 1622477507235
"text": "replaceBy: This property allows you to instruct the API Fetcher Bot to set a value to this parameter replacing the current default and using contextual information available only at runtime.",
"updated": 1622773230818
},
{
"style": "Text",
"text": "Here is an example config setting a query option to false:",
"updated": 1622764541685
},
{
"style": "Json",
"text": "{\n \"codeName\": \"localization\",\n \"isString\": false,\n \"isOptional\": true,\n \"description\": \"Trim down responce object\",\n \"value\": false\n}",
"updated": 1622764527431
},
{
"style": "Include",
@@ -1,22 +1,24 @@
{
"type": "API Query Parameters",
"definition": {
"text": "Is a query string, that is a part of a uniform resource locator (URL) that assigns values to specified parameters. The query parameters commonly includes fields added to the base URL.",
"updated": 1621022301794
"text": "A query string is part of a uniform resource locator (URL). The query parameter is added to the base URL and assigns values to specified parameters in order to specify the request for data to the API. ",
"updated": 1622770771990
},
"paragraphs": [
{
"style": "Text",
"text": "In other words, Query Parameters are the parameters sent at any URL after the question mark ?",
"updated": 1621954104568
"text": "In other words, an API Query is part of the URL used to request information from an API. These values are held after the ? in the request URL. Queries are generally used to make adjustments to the type of data the api will return. For example, if an api endpoint accepts a time query, you will be able to request data from a specific time period.",
"updated": 1622765459697
},
{
"style": "Text",
"text": "Query Parameters in general do not need to be defined in any specific orders, so feel free to add children for this node in whatever order you like."
"style": "Note",
"text": "Query Parameters in general do not need to be defined in any specific order, so feel free to add children for this node in whatever order you like.",
"updated": 1622765484886
},
{
"style": "Success",
"text": "When found at the API Map will define the default values for each parameter. When found at the Data Mine will define the actual values to be used, these would replace the defaults."
"text": "When a API Query Parameter is found at the API Map, it will define the default values based on the value property of each API Query Parameter node. However, if the replaceBy property is used the system will pull the value from the user's system. Examples of this are the current time, current exchange being used, etc.",
"updated": 1622771917666
}
]
}