Web API Components
The DivePort Web API has many different features and operations that allow users to run dives, send custom queries, and get DiveLine information.
Parameters
Parameters are used in a Web API request to provide authorization, specify projects and files to access, and more.
Parameter Name—token
Supplies a user access token or session token to authorize the request. The Token parameter is always required. If the token is a user access token, then the request will log in using that token. If it is a session token, then the existing session will be used. Note that sessions time out after being idle for 2 minutes. Alternatively, the token can be supplied in the HTTP Authorization header, as in Authorization: Bearer <token>.
For example:
-
https://my-site.example.com/diveport/api/query/Project/data/my-output.cbase?token=ditok-AAAAAAAAAAAAAAAAAAAA supplies a user access token.
A cURL request using the HTTP Authorization header:
curl --location 'https://www.mywebsite.com/api/admin/project/file/data/my-cbase.cbase' \
--header 'Authorization: Bearer ditok-aaaaaaaaaaaaaaaaaaaaaa'
Parameter Name—timing
Indicates that a timing report should be made for the request. A timing report is a breakdown of the tasks performed during the request and how long they took. A timing report is recommended for debugging slow requests. If this is set, the timing report is returned as a property `"timing"` in a JSON response. For non-JSON responses, this has no effect. `timing` can be set to "true" or "false". The default is "false". If `timing` is given in the URL with no value (i.e. no `=`), then it is considered "true".
For example:
-
https://my-site.example.com/diveport/api/query/Project/data/my-output.cbase?timing includes a request for a timing report. This is equivalent to setting timing=true.
-
https://my-site.example.com/diveport/api/query/Project/data/my-output.cbase?timing=true includes a request for a timing report.
-
https://my-site.example.com/diveport/api/query/Project/data/my-output.cbase?timing=false indicates that a timing report is not made for the request.
The name of a project on the DiveLine server.
For example:
-
https://my-site.example.com/diveport/api/query/Project/data/my-output.cbase The red highlighted section is the project name.
The path to a folder in the project. It must begin with a slash. The trailing slash is optional.
For example:
-
https://my-site.example.com/diveport/api/query/Project/data/my-output.cbase The red highlighted section is the folder name.
The path to a file in the project. It must begin with a slash.
For example:
-
https://my-site.example.com/diveport/api/admin/project/file/Project/data/json-output.json The red highlighted section is the file name.
The path to a data source in the project. It must begin with a slash. A data source here can be:
-
a cBase
-
a cPlan
-
a factory-output folder
-
a .txt file (treated as tab-delimited text)
-
a .csv file (treader as comma-delimited text)
For example:
-
https://my-site.example.com/diveport/api/query/Project/data/my-output.cbase The red highlighted section is the data source.
Parameter Name—param:{parameter-name}
A parameter to pass to a dive. The structure of the parameter string is:
param:{parameter-name}={parameter-value}
The dive script must declare the parameter with a take-parameter tag. If the parameter is declared as a selection using the selection=true tag, then you can pass multiple values to the parameter by supplying this URL parameter multiple times.
For example:
Given a dive script:
dive {
take-parameter "Year" {
default "2020"
}
take-parameter "State" selection=true {
default "Alaska"
}
cplan {
cbase-input "/cbases/states-and-years.cbase"
}
window {
dimension "State"
dimension "Year"
column "Revenue"
filter `and(param_match("Year", "Year"), param_match("State", "State"))`
}
}
-
https://my-site.example.com/diveport/api/dive/Project?token=ditok-aaaaaaaaaaaa¶m:Year=2022 filters dive results on the year 2022.
-
https://my-site.example.com/diveport/api/dive/Project?token=ditok-aaaaaaaaaaaa¶m:State=Massachusetts¶m:State=New%20Hampshire filters dive results on either Massachusetts or New Hampshire.
Parameter Name—param-all-values:{paramter-name}
Sets a parameter in the dive to "all values". The structure of the parameter string is:
param-all-values:{parameter-name}
The dive script must declare the parameter with a take-parameter tag and the parameter must be declared as a selection using the selection=true tag.
For example:
Given a dive script:
dive {
take-parameter "Year" {
default "2020"
}
take-parameter "State" selection=true {
default "Alaska"
}
cplan {
cbase-input "/cbases/states-and-years.cbase"
}
window {
dimension "State"
dimension "Year"
column "Revenue"
filter `and(param_match("Year", "Year"), param_match("State", "State"))`
}
}
-
https://my-site.example.com/diveport/api/dive/Project?token=ditok-aaaaaaaaaaaa¶m-all-values=State¶m:State=2022 filters dive results on the year 2022.
Parameter Name—param:{parameter-name}
A parameter value to pass to the data source. The structure of the parameter string is:
param:{parameter-name}={parameter-value}
The cplan script must declare the parameter with a take-parameter tag. For a factory-output data source, the factory config script must declare the parameter using a runtime-parameters tag. If the parameter is declared as a selection using the selection=true tag, then you can pass multiple values to the parameter by supplying this URL parameter multiple times.
NOTE: cBases, txt files, and csv files cannot take parameters.
For example:
Given a cPlan:
cplan {
take-parameter "Year" {
default "2020"
}
take-parameter "State" selection=true {
default "Alaska"
}
cbase-input "/cbases/states-and-years.cbase" {
filter `and(param_match("Year", "Year"), param_match("State", "State"))`
}
dimension "State"
dimension "Year"
calc "Revenue"
}
-
https://my-site.example.com/diveport/api/query/Project/programs/my-cplan.cplan?token=ditok-aaaaaaaaaaaaa¶m:Year=2022 filters the cPlan results on the year 2022.
-
https://my-site.example.com/diveport/api/query/Project/programs/my-cplan.cplan?token=ditok-aaaaaaaaaaaaa¶m:State=Massachusetts¶m:State=New%20Hampshire filters the cPlan results on either Massachusetts or New Hampshire
Parameter Name—param-all-values:{parameter-name}
Sets a parameter in the query to "all values". The structure of the parameter string is:
param-all-values:{parameter-name}
For a cPlan data source, the cPlan must declare the parameter with a take-parameter tag. For a factory-output data source, the factory config script must declare the parameter under a runtime-parameters tag. Note that some data sources, such as cBases, cannot take parameters. The parameter must be declared as a selection using the selection=true tag.
For example:
-
param-all-values:State
Parameter Name—filter={expression}
Filters the data source using a Spectre expression. This is useful for complex filters. For simple value filters use:
filter={expression}
All filters are applied before grouping.
For example:
-
filter=ytd(value("Date")) filters the results to only include rows
-
filter=substr(value("State"),1,4)="New%20"
Parameter Name—{name}:{filter}
Filters the data source by comparing values in a column.
{name}:{filter}
{name} is the name of the column, and {filter} describes the kind of comparison. The {filter} value is composed of:
{column}:{operation}={value}
Valid operations are:
-
eq—equal (default)
-
ne—not equal
-
gt—greater than
-
gte—greater than or equal
-
lt—less than
-
lte—less than or equal
You can provide multiple filters for a given column, with some restrictions:
-
Multiple eq filters will keep a record if any of the values match.
-
Multiple ne filters will keep a record if none of the values match.
-
You can combine one gt or gte filter with one lt or lte filter to filter to a range of values.
All filters are applied before grouping.
For example:
-
filter:State=Massachusetts filters the results to only include rows where State equals Massachusetts. This is equivalent to filter:State:eq=Massachusetts.
-
filter:State:ne=Massachusetts&filter:State:ne=New%20Hampshire filters the results to only include rows where the State does not equal Massachusetts or New Hampshire.
-
filter:Year:gte=2020&filter:Year:lte=2022 filters the results to only include rows where the Year is greater than or equal to 2020 and less than or equal to 2022.
Parameter Name—dimension
Groups records in the data source. This is similar to a dive in ProDiver. Multiple dimension parameters can be provided, in which case records are grouped on all given dimension, similar to a MultiTab in ProDiver. Dimension columns are automatically selected to be returned in the query response. As a result of this, the column parameter is not needed. When this parameter is absent, records are not grouped.
NOTE: Because a cPlan can contain multiple inputs and there isn't a single collection of records to return, grouping must be performed on cPlans.
For example:
-
dimension=State returns records grouped by the State dimension.
-
dimension=Product%20Family&dimension=Product%20Name returns records grouped by the Product Family and Product Name dimensions.
Parameter Name—column
Selects columns to be returned in the query response. If the records are being grouped with the dimension parameter, then this selects columns or calcs to be summarized in the result. The summary function used depends on the data source. For cBases, this must refer to a column, which will be summarized using the summary-type of the column. For cPlans, this can refer to a calc in the cPlan or columns in the cPlan's inputs. For factory-output data sources, this must refer to measures. If the records are not being grouped, then the columns selected here are not summarized. If neither dimension nor column are specified, then all columns are selected.
For example:
-
column=Cost&column=Revenue returns the contents of the Cost and Revenue columns.
Parameter Name—sort
Sorts the rows returned in the query response by a column. You can supply the sort parameter multiple times. The second sort is used for records which have equal values according to the first sort column, and so on. By default, columns are sorted in ascending order. Columns can be sorted in descending order by adding :desc to the end of the column name. Columns can be explicitly sorted in ascending order with :asc. Sorting happens after grouping if the dimension parameter is present.
For example:
-
sort=State sorts results in ascending order by the State column.
-
sort=Date:desc sorts results in descending order by the Date column.
-
sort=Priority:desc&sort=Order%20ID sorts results in descending order by the Priority column, with any values that have the same value in Priority sorted in ascending order by the Order ID column.
Parameter Name—limit
Sets the maximum number of rows returned by the request. The default value is 10,000. The maximum limit is 1,000,000. To fetch more than a million rows, use multiple requests with the offset parameter.
For example:
-
limit=100 ensures that only 100 rows are returned by the request.
Parameter Name—offset
Skips the given number of rows before choosing rows to return. The default value is 0, meaning that the response begins with the first row.
For example:
-
offset=100 skips the first 100 rows and return the rest.
Parameter Name—format
Selects the format of the response data. The following response formats are available:
-
json—JSON
-
csv—comma-separated values
-
tsv/txt—tab-separated values
If this parameter is not present, the DivePort Web API chooses the response based on the HTTP `Accept` header. If the `Accept` header is absent, the data is returned in JSON format.
For example:
-
format=tsv returns the response data as a tab-separated file.
Parameter Name—formatted
Determines how non-string values are returned in the response. Spectre columns and calcs can have a format property which determines how they are displayed to users. This is recommended for user-facing displays, and not exporting to other This parameter chooses whether to apply that column format to values in the response. For instance, if a value 1234.5 has format `$#,###.00`, then with the formatted parameter set, the response will return `$1,234.50`. Without formatted it will return `1234.5`. The formatted parameter can be set to "true" or "false". The default is "false". If formatted is given in the URL with no value, then it is considered "true".
For example:
-
formatted
-
formatted=true
-
formatted=false
Paths
This request logs in and creates a session. This is required before using any asynchronous requests. It is not required for synchronous requests, but if you are planning to do multiple requests then logging in is recommended because it avoids the performance overhead of authenticating with each request. You must supply a user access token in the token parameter or in the Authorization HTTP header (formatted as Bearer <token>). On success, the response will include a session token, which you can use instead of the user access token in subsequent requests.
-
URL path—/api/login
-
Request Type—GET
Parameters
Response
{
"sessionToken": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
}
Example
cURL Request
curl --location --request POST 'https://www.mywebsite.com/api/login?token=ditok-AAAAAAAAAAAAA'
Python Request
import requests
url = "https://www.mywebsite.com/api/login?token=ditok-AAAAAAAAAAAAAAA"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
This request closes a given session. A session automatically times out after 2 minute of idle time. Logging out using this request before the automatic time out occurs frees up resources on the server. This request has no response.
- URL path—/api/logout
-
Request Type—POST
Parameters
- Token—The session token. This is created when the login request is made, and the session token value is returned by that request.
Example
cURL Request
curl --location --request POST 'https://www.mywebsite.com/api/logout?token=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/logout?token=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
This request returns server version and session information. For an interactive client, this can be used to keep the session alive and avoid a timeout (for example, the client can call this once per minute).
- URL path—/api/info
-
Request Type—GET
Parameters
Response
{
"sessionId":"aaaaaaaaaaa",
"diveportVersion":"8.0 (2)",
"divelineVersion":"8.0 (6)"
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/info?token=ditok-aaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/info?token=ditok-aaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
This request returns a list of the DiveLine projects.
- URL path—/api/projects
Request Type—GET
Parameters
Response
{
"projects": [
{
"name": "my-project-A"
},
{
"name": "my-project-B"
}
]
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/projects?token=ditok-aaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/projects?token=ditok-aaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
This request returns the files and folders found in a given project folder.
- URL path—/api/project/files/{project}{path}
Request Type—GET
Parameters
Response
{
"files": [
{
"name": "folder-example",
"type": "folder"
},
{
"name": "file-example.txt",
"type": "file"
},
{
"name": "cbase-example.cbase",
"type": "file"
}
]
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/project/files/project-path/file-path?token=ditok-aaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/project/files/project-path/file-path?token=ditok-aaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
This request performs a query against a cBase, cPlan, or Measure Factory, and returns the results. For a cBase or cPlan, the path parameter is the path to the file. For Measure Factory information, the path parameter is the /factory-output folder.
- URL path—/api/query/{project}{path-file}
Request Type—GET
Parameters
- Token
-
Window Formatted
Response
{
"columns": [
{
"name": "Column A",
"type": "string"
}
],
"dimensionCount": 1,
"rowCount": 2,
"rows": [
{
"Column A": "Value 1"
},
{
"Column A": "Value 2"
}
]
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/query/project-path/file-path?token=ditok-aaaaaaaaaaaaaa&dimension=Salesperson&limit=10000¶m%3AYear=2022&sort=Revenue&filter%3ARevenue%3Agt=1500'
Python Request
import requests
url = "https://www.mywebsite.com/api/query/project-path/file-path?token=ditok-aaaaaaaaaaaaaa&dimension=Salesperson&limit=10000¶m:Year=2022&sort=Revenue&filter:Revenue:gt=1500"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
This request runs a custom dive script and returns the results. The dive script must be provided in the body of the request. Paths found in the script will be resolved relative to the root of the project selected in the URL.
- URL path—/api/dive/{project}
Request Type—POST
Parameters
-
Token
-
Timing
-
Dive Parameter
-
Dive Parameter All Values
-
Window Format
-
Window Formatted
Response
{
"columns": [
{
"name": "Column A",
"type": "string"
}
],
"dimensionCount": 1,
"rowCount": 2,
"rows": [
{
"Column A": "Value 1"
},
{
"Column A": "Value 2"
}
]
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/query/project-path/file-path?token=ditok-aaaaaaaaaaaaaa&limit=10000¶m%3AYear=2022' \
--header 'Content-Type: text/plain' \
--data 'dive {
take-parameter "Year" selection=true {
default "2020"
}
cplan {
cbase-input "/cbases/my-output.cbase"
}
window {
dimension "Salesperson"
column "Revenue"
filter `param_match("Year")`
}
}'
Python Request
import requests
url = "https://www.mywebsite.com/api/query/project-path/file-path?token=ditok-aaaaaaaaaaaaaa&limit=10000¶m:Year=2022"
payload = "dive {\r\n take-parameter \"Year\" selection=true {\r\n default \"2020\"\r\n }\r\n cplan {\r\n cbase-input \"/cbases/my-output.cbase\"\r\n }\r\n window {\r\n dimension \"Salesperson\"\r\n column \"Revenue\"\r\n filter `param_match(\"Year\")`\r\n }\r\n}"
headers = {
'Content-Type': 'text/plain'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
This request fetches information about a cBase, cPlan, or Measure Factory. For a cBase or cPlan, the {path} parameter is the path to the file. For Measure Factory information, {path} is /factory-output. The response includes information about dimensions and measures in the data source. For cBases, "dimensions" refers to columns which were built with suggested-dimension=true, or (by default) all non-numeric column. "Measures" refers to column that are not dimensions. For cPlans, "dimensions" refers to dimensions in any of the cPlan's inputs, and "expression dimensions" defined in the cPlan. "Measures" refers to input columns that are not dimensions, and calcs defined in the cPlan. For Measure Factories, "dimensions" and "measures" are as defined in the factory.
- URL path—/api/metadata/{project}{path}
Request Type—GET
Parameters
-
Timing
-
Data Source Parameter
-
Data Source Parameter All Values
Response
{
"measures": [
{
"name": "Column A",
"type": "string"
},
{
"name": "Column B",
"type": "integer"
}
],
"dimensions": [
{
"name": "Dimension A",
"type": "string"
},
{
"name": "Dimension B",
"type": "integer"
}
]
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/metadata/projectpath/data/my-cbase.cbase?token=ditok-aaaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/metadata/projectpath/data/my-cbase.cbase?token=ditok-aaaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
This starts an asynchronous job to perform a query against a cBase, cPlan, or Measure Factory, and returns the ID of that job. For a cBase or cPlan, the {path} parameter is the path to the file. For Measure Factory information, {path} is /factory-output.
- URL path—/api/async/query/{project}{path}
Request Type—POST
Parameters
- Token
-
Timing
-
Project
-
Path File
-
Data Source Parameter
-
Data Source Parameter All Values
-
Query Filter Expression
-
Query Filter
-
Query Dimension
-
Query Column
-
Query Sort
Response
{
"jobId":"j1"
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/async/query/project-path/my-cbase.cbase?token=ditok-aaaaaaaaaaaaaa&limit=10000¶m%3AYear=2022'
Python Request
import requests
url = "https://www.mywebsite.com/api/async/query/project-path/my-cbase.cbase?token=ditok-aaaaaaaaaaaaaa&limit=10000¶m:Year=2022"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
This starts an asynchronous job to run a custom dive script and returns the ID of that job. The dive script must be provided in the body of the request. Paths found in the script will be resolved relative to the root of the project selected in the URL.
- URL path—/api/async/dive/{project}
Request Type—POST
Parameters
- Token
-
Timing
-
Dive Parameter
-
Dive Parameter All Values
-
Window Format
-
Window Formatted
Response
{
"jobId":"j1"
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/async/dive/project-path?token=ditok-aaaaaaaaaaaaaa&limit=10000¶m%3AYear=2022' \
--header 'Content-Type: text/plain' \
--data 'dive {
take-parameter "Year" selection=true {
default "2020"
}
cplan {
cbase-input "/cbases/my-output.cbase"
}
window {
dimension "Salesperson"
column "Revenue"
filter `param_match("Year")`
}
}'
Python Request
import requests
url = "https://www.mywebsite.com/api/async/dive/project-path?token=ditok-aaaaaaaaaaaaaa&limit=10000¶m:Year=2022"
payload = "dive {\r\n take-parameter \"Year\" selection=true {\r\n default \"2020\"\r\n }\r\n cplan {\r\n cbase-input \"/cbases/my-output.cbase\"\r\n }\r\n window {\r\n dimension \"Salesperson\"\r\n column \"Revenue\"\r\n filter `param_match(\"Year\")`\r\n }\r\n}"
headers = {
'Content-Type': 'text/plain'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
This request returns whether an asynchronous query has completed. If it has completed this also returns information about the query results such as column names and row count. If the status in the response is "complete", the Get Asynchronous Job Results request can fetch the data from the query results.
- URL path—/api/async/job/{jobId}
Request Type—GET
Parameters
-
Token
-
Job ID
Response
{
"result":
{
"columns":
[
{
"name":"Column A",
"type":"string"
},
{
"name":"Column B",
"type":"date"
},
],
"dimensionCount":0,
"rowCount":2329,
"dimensions":
[
{
"name":"Dimension A",
"type":"string"
}
]
}
"status":"complete"
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/async/job/j1?token=ditok-aaaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/async/job/j1?token=ditok-aaaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
This request cancels an asynchronous query in progress, or closes the query results if it has already completed. Call this when you are finished using a query to free up resource on the server. Query results are automatically closed when the session ends.
- URL path—/api/async/job/{jobID}
Request Type—DELETE
Parameters
-
Token
-
Job ID
Response
No Response
Examples
cURL Request
curl --location --request DELETE 'https://www.mywebsite.com/api/async/job/j1?token=ditok-aaaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/async/job/j1?token=ditok-aaaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
This request returns data from the results of an asynchronous query.
- URL path—/api/async/job/{jobId}/data
Request Type—GET
Parameters
-
Token
-
Job ID
Response
{
"columns":
[
{
"name":"Column A",
"type":"string"
},
{
"name":"Column B",
"type":"integer"
}
],
"dimensionCount":0,
"rowCount":2,
"rows":
[
{
"Column A":"Value 1",
"Column B": "Value 2"
},
{
"Column A":"Value 3",
"Column B":"Value 4"
}
]
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/async/job/j1/data?token=ditok-aaaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/async/job/j1/data?token=ditok-aaaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
This request returns a list of DiveLine users. The current user must be a DiveLine administrator.
- URL path—/api/admin/users
Request Type—GET
Parameters
-
Token
Response
{
"users": [
{
"name": "User",
"description": "User description",
"fullname": "John Smith",
"shortname": "jsmith",
"email": "[email protected]"
}
]
}
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/admin/users?token=ditok-aaaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/admin/users?token=ditok-aaaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
This request returns the contents of a file from a DiveLine project.
- URL path—/api/admin/project/file/{project}{path}
Request Type—GET
Parameters
-
Token
-
Project
-
Path File
Response
The contents of the given file.
Examples
cURL Request
curl --location 'https://www.mywebsite.com/api/admin/project/file/projectpath/myfile.txt?token=ditok-aaaaaaaaaaaaaaa'
Python Request
import requests
url = "https://www.mywebsite.com/api/admin/project/file/projectpath/myfile.txt?token=ditok-aaaaaaaaaaaaaaa"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)