openapi: 3.0.0
info:
title: Altruistiq Datasource API
x-logo:
url: ./aq.svg
altText: Altruistiq Logo
version: 1.0.0
description: "# Definitions\n\nAn **Activity** is a business process that has taken place, which is relevant for emissions\
\ measurement. Examples of an **Activity** in Altruistiq\u2019s data model are **ElectricityUse** or **WasteGenerated**.\n\
A **Calculation Method** is an GHG Protocol compliant method to calculate emissions from Activity data. Calculation Methods\
\ have a unique set of data requirements, but are not unique to an **Activity**.\nA **Datasource** is a single data format\
\ that your data is shared with Altruistiq in. Alongside this function, a **Datasource** plays the role of linking a data\
\ format to key contextual information (e.g. relevant **Facilities**, relevant **Activities**, owner, chosen **Calculation\
\ Methods**, status).\n**Datasets** are then individual files ingested via that Datasource. Each **Dataset** has a live\
\ status for full data lineage and transparency that you can track in the application.\n\n# Datasource API Outline\n\n\
Primarily, Altruistiq\u2019s Datasource API enables the creation and management of Datasources and the upload of new Datasets.\
\ Alongside this there are a number of supporting functions.\n\nThe Datasource API is governed by the oauth2 protocol.\n\
\nThe Datasource API by default does not expect sudden bursts of data upload (e.g. 25x5GB of data transferred at once),\
\ but instead delta datasets. When uploading to the upload endpoint the files uploaded must be chunked into chunks < 100mb\
\ and if there are more than 1 part then chunks must be > 5mb (the last part can be below this). If this is not the case\
\ for your business, do raise this at your Kick Off call and we will accommodate this.\n\n# PACT API Outline\n\nPrimarily,\
\ Altruistiq\u2019s PACT API allows customers to export Product Carbon Footprint (PCF) data in a PACT conformant way.\
\ PACT is the Partnership for Carbon Transparency, a WRI and WBCSD funded NGO that is setting the calculation and technological\
\ standard for the exchange for Product Carbon Footprints between businesses. Today, Altruistiq is 1 of ~10 PACT conformant\
\ solutions globally.\n\nThe PACT API is is governed by the oauth2 protocol (see Security).\n\nFor full documentation\
\ of our PACT API, please go to https://wbcsd.github.io/data-exchange-protocol/v2/#api-examples. This provides the full\
\ documentation for product data exports, and the associated data model."
servers:
- url: https://app.altruistiq.com/
description: Altruistiq Server
tags:
- name: Security
description: "The Altruistiq API uses TLS and follows the OAuth 2.0 Client credentials flow as per [RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)\n\
\n### Generating `client_id` and `client_secret`\n\nIn order to generate your `client_id` and `client_secret`, go to the\
\ altruistiq application\u2019s organisation settings."
- name: Datasource
description: "### Altruistiq\u2019s datasource API enables you to:\n\n - Create new datasources\n - Manage existing datasources\
\ (read, update)\n - Upload data to a datasource\n\nA datasource is the place where you will share a single data format\
\ with altruistiq and where you will categorise it so that we can calculate emissions in an automated way."
- name: Export
description: "### Altruistiq\u2019s Export API enables you to:\n\n - Export corporate data\n\nExporting data is a key part\
\ of the Altruistiq platform. It allows you to take your data and use it in other systems, or to share it with other stakeholders.\n\
\nCurrently, our Export API allows you to export your Corporate Emissions data available in Altruistiq, down to a daily\
\ grain. We are working hard to also add Product Emissions data to your Export API. If you need to share Product emissions\
\ data today, see the PACT API.\n\nSchema of files which can be retrieved via this API (data dictionary):<br/>\n<table>\n\
\ <tbody><tr><th>Column</th><th>Data Type</th><th>Format</th><th>Optional</th><th>Description</th></tr>\n <tr>\n \
\ <td>fact_uuid</td>\n <td>string</td>\n <td>uuid</td>\n <td>no</td>\n <td>Unique identifier\
\ for emission record.</td>\n </tr>\n <tr>\n <td>calendar_date</td>\n <td>string</td>\n <td>date</td>\n\
\ <td>no</td>\n <td>Date of the emission record.</td>\n </tr>\n <tr>\n <td>calendar_year</td>\n\
\ <td>integer</td>\n <td></td>\n <td>no</td>\n <td>Year of the emission record.</td>\n \
\ </tr>\n <tr>\n <td>emission_quantity</td>\n <td>number | string</td>\n <td>decimal(28, 10)</td>\n\
\ <td>no</td>\n <td>Quantity of the emission record.</td>\n </tr>\n <tr>\n <td>emission_unit</td>\n\
\ <td>string</td>\n <td></td>\n <td>no</td>\n <td>Unit the emissions are in.</td>\n </tr>\n\
\ <tr>\n <td>calculation_input_quantity</td>\n <td>number | string | null</td>\n <td>decimal(28,\
\ 10)</td>\n <td>yes</td>\n <td>Input quantity used for the actual emission calculation (if applicable).</td>\n\
\ </tr>\n <tr>\n <td>calculation_input_quantity_unit</td>\n <td>string | null</td>\n <td></td>\n\
\ <td>yes</td>\n <td>Unit of the input quantity used for the actual emission calculation(if applicable).</td>\n\
\ </tr>\n <tr>\n <td>spend_usd</td>\n <td>number | string | null</td>\n <td>decimal(28, 10)</td>\n\
\ <td>yes</td>\n <td>Spend in USD used for the actual emission calculation (if applicable).</td>\n </tr>\n\
\ <tr>\n <td>spend_eur</td>\n <td>number | string | null</td>\n <td>decimal(28, 10)</td>\n \
\ <td>yes</td>\n <td>Spend in EUR used for the actual emission calculation (if applicable).</td>\n </tr>\n\
\ <tr>\n <td>spend_gbp</td>\n <td>number | string | null</td>\n <td>decimal(28, 10)</td>\n \
\ <td>yes</td>\n <td>Spend in EUR used for the actual emission calculation (if applicable).</td>\n </tr>\n\
\ <tr>\n <td>per_unit</td>\n <td>string</td>\n <td></td>\n <td>no</td>\n <td>Emission\
\ Factor divisor.</td>\n </tr>\n <tr>\n <td>input_dimensionality</td>\n <td>string</td>\n <td></td>\n\
\ <td>no</td>\n <td>Dimensionality of the input quantity for the emission factor.</td>\n </tr>\n <tr>\n\
\ <td>scope_category</td>\n <td>string</td>\n <td></td>\n <td>no</td>\n <td>Scope categories\
\ are a subdivision of GHG Scopes with more detail about the emission\u2019s cause. Scope categories are similar to, and\
\ overlapping with Activities.</td>\n </tr>\n <tr>\n <td>scope</td>\n <td>string</td>\n <td></td>\n\
\ <td>no</td>\n <td>Refers to the three scopes of the GHG Protocol.</td>\n </tr>\n <tr>\n <td>activity_area_name</td>\n\
\ <td>string</td>\n <td></td>\n <td>no</td>\n <td>Activity areas are groups of activities\
\ that have similar emissions calculation methodologies in the Altruistiq platform.</td>\n </tr>\n <tr>\n \
\ <td>activity_name</td>\n <td>string</td>\n <td></td>\n <td>no</td>\n <td>Activities areas\
\ are activities of a customer causing emissions.</td>\n </tr>\n <tr>\n <td>sub_activity_name</td>\n \
\ <td>string</td>\n <td></td>\n <td>no</td>\n <td>Sub-Activities areas are a sub-dicision activities\
\ of a customer causing emissions.</td>\n </tr>\n <tr>\n <td>aq_calc_method</td>\n <td>string</td>\n\
\ <td></td>\n <td>no</td>\n <td>Calculation Methodology used in the Altruistiq platform.</td>\n \
\ </tr>\n <tr>\n <td>ghg_calc_method</td>\n <td>string</td>\n <td></td>\n <td>no</td>\n\
\ <td>Calculation Methodology according to the GHG protocol.</td>\n </tr>\n <tr>\n <td>ef_specificity</td>\n\
\ <td>string</td>\n <td></td>\n <td>no</td>\n <td>Specificity level that Emission Factors\
\ refer to, e.g. Global Average or Country Average.</td>\n </tr>\n <tr>\n <td>accuracy_score</td>\n \
\ <td>integer</td>\n <td></td>\n <td>no</td>\n <td>A measure of how accurate emissions calculations\
\ are for a particular activity, based on the quality of data available and the calculation methodology applied as a result.</td>\n\
\ </tr>\n <tr>\n <td>accuracy_score_name</td>\n <td>string</td>\n <td></td>\n <td>no</td>\n\
\ <td>A measure of how accurate emissions calculations are for a particular activity, based on the quality of data\
\ available and the calculation methodology applied as a result.</td>\n </tr>\n <tr>\n <td>lifecycle</td>\n\
\ <td>string</td>\n <td></td>\n <td>no</td>\n <td>Emissions caused by an activity can be further\
\ subdivided by the lifecycle they are associated with. For example, a business trip in a company car will cause emissions\
\ from vehicle use (i.e. burning the fuel) and well-to-tank emissions (i.e. drilling for oil, fuel production, and any\
\ other activities in the supply chain).</td>\n </tr>\n <tr>\n <td>bu_uuid</td>\n <td>string</td>\n\
\ <td>uuid</td>\n <td>no</td>\n <td>Unique identifier for a BU.</td>\n </tr>\n <tr>\n \
\ <td>bu_name</td>\n <td>string</td>\n <td></td>\n <td>no</td>\n <td>Name of the BU this\
\ record belongs to.</td>\n </tr>\n <tr>\n <td>root_org_uuid</td>\n <td>string</td>\n <td>uuid</td>\n\
\ <td>no</td>\n <td>Unique identifier of the root organisation.</td>\n </tr>\n <tr>\n <td>root_org_name</td>\n\
\ <td>string</td>\n <td></td>\n <td>no</td>\n <td>Name of the root organisation this record\
\ belongs to.</td>\n </tr>\n <tr>\n <td>facility_name</td>\n <td>string | null</td>\n <td></td>\n\
\ <td>yes</td>\n <td>Name of the facility this record belongs to (if it is assigned at facility level).</td>\n\
\ </tr>\n <tr>\n <td>facility_uuid</td>\n <td>string | null</td>\n <td></td>\n <td>yes</td>\n\
\ <td>Unique identifier of the facility.</td>\n </tr>\n <tr>\n <td>facility_country_name</td>\n \
\ <td>string | null</td>\n <td></td>\n <td>yes</td>\n <td>Country this facility belongs to.</td>\n\
\ </tr>\n <tr>\n <td>facility_country_code</td>\n <td>string | null</td>\n <td></td>\n \
\ <td>yes</td>\n <td>Country code of the country this facility belongs to.</td>\n </tr>\n <tr>\n \
\ <td>facility_post_code</td>\n <td>string | null</td>\n <td></td>\n <td>yes</td>\n <td>Post\
\ code of this facility.</td>\n </tr>\n <tr>\n <td>facility_type</td>\n <td>string | null</td>\n \
\ <td></td>\n <td>yes</td>\n <td>Type of this facility.</td>\n </tr>\n <tr>\n <td>facility_capacity_ratio</td>\n\
\ <td>number | string | null</td>\n <td>decimal(28, 10)</td>\n <td>yes</td>\n <td>Capacity\
\ of this facility.</td>\n </tr>\n <tr>\n <td>data_source_name</td>\n <td>string</td>\n <td></td>\n\
\ <td>yes</td>\n <td>Name of the datasource which was used for this record.</td>\n </tr>\n <tr>\n\
\ <td>file_name</td>\n <td>string</td>\n <td></td>\n <td>no</td>\n <td>Name of the\
\ file which was used for this record.</td>\n </tr>\n <tr>\n <td>supplier_legal_name</td>\n <td>string\
\ | null</td>\n <td></td>\n <td>yes</td>\n <td>Supplier legal name (if applicable).</td>\n </tr>\n\
\ <tr>\n <td>supplier_country_code</td>\n <td>string | null</td>\n <td></td>\n <td>yes</td>\n\
\ <td>Supplier country code (if applicable).</td>\n </tr>\n <tr>\n <td>supplier_country_name</td>\n\
\ <td>string | null</td>\n <td></td>\n <td>yes</td>\n <td>Supplier country name (if applicable).</td>\n\
\ </tr>\n <tr>\n <td>supplier_vat_number</td>\n <td>string | null</td>\n <td></td>\n \
\ <td>yes</td>\n <td>Supplier VAT number (if applicable).</td>\n </tr>\n <tr>\n <td>tags</td>\n \
\ <td>object</td>\n <td></td>\n <td>no</td>\n <td>Mapping of tag category -> value (e.g.\
\ energy_type -> mixed).\n <p><b>PREVIEW WARNING: THESE ARE CURRENTLY BEING CHANGED, SO ARE NOT STABLE!</b></p>\n\
\ <p>Categories:</p>\n <ul>\n <li>energy_type</li>\n <li>fuel_type</li>\n <li>fuel_net_or_gross_cv</li>\n \
\ <li>gas_type</li>\n <li>isic_section</li>\n <li>isic_division</li>\n <li>isic_group</li>\n <li>isic_class</li>\n\
\ <li>goods_service_type</li>\n <li>material_life_phase</li>\n <li>heating_type</li>\n <li>industry_type</li>\n\
\ <li>purchased_energy_type</li>\n <li>refrigerant_type</li>\n <li>renewable</li>\n <li>vehicle_type</li>\n\
\ <li>journey_type</li>\n <li>energy_generation_type</li>\n <li>vehicle_emission_type</li>\n <li>traffic_scenario</li>\n\
\ <li>vehicle_load</li>\n <li>waste_category</li>\n <li>wastewater_spend_type</li>\n <li>waste_treatment_type</li>\n\
\ <li>waste_type</li>\n <li>water_spend_type</li>\n </ul></td>\n </tr>\n <tr>\n <td>financial_year</td>\n\
\ <td>integer</td>\n <td></td>\n <td>no</td>\n <td></td>\n </tr>\n <tr>\n <td>custom_analytics_fields</td>\n\
\ <td>object</td>\n <td></td>\n <td>no</td>\n <td>Custom Analytics Fields.</td>\n </tr>\n\
\ <tr>\n <td>custom_tags</td>\n <td>object</td>\n <td></td>\n <td>no</td>\n <td>Fields\
\ used to tag/classify the record.</td>\n </tr>\n <tr>\n <td>emission_factor_name</td>\n <td>string\
\ | null</td>\n <td></td>\n <td>no</td>\n <td>Name of the emission factor used for this record.</td>\n\
\ </tr>\n <tr>\n <td>emission_factor_specificity</td>\n <td>string | null</td>\n <td></td>\n\
\ <td>no</td>\n <td>Specificity of the emission factor used for this record.</td>\n </tr>\n <tr>\n\
\ <td>emission_factor_specificity_code</td>\n <td>string | null</td>\n <td></td>\n <td>no</td>\n\
\ <td>Specificity Code of the emission factor used for this record.</td>\n </tr>\n <tr>\n <td>emission_factor_source</td>\n\
\ <td>string | null</td>\n <td></td>\n <td>no</td>\n <td>Source of the emission factor used\
\ for this record.</td>\n </tr>\n <tr>\n <td>emission_factor_source_version</td>\n <td>string | null</td>\n\
\ <td></td>\n <td>no</td>\n <td>Source version of the emission factor used for this record.</td>\n\
\ </tr>\n <tr>\n <td>created_at</td>\n <td>string</td>\n <td>date-time</td>\n <td>no</td>\n\
\ <td>Timestamp when the record was created. NOTE: this might change if we do a full refresh in the backend.</td>\n\
\ </tr>\n <tr>\n <td>updated_at</td>\n <td>string</td>\n <td>date-time</td>\n <td>no</td>\n\
\ <td>Timestamp when the record was updated. NOTE: this might change if we do a full refresh in the backend.</td>\n\
\ </tr>\n </tbody></table>"
- name: Product
description: "### Altruistiq\u2019s Product API enables you to:\n\n- Create new products\n- Update existing products\n-\
\ Delete products\n- Get a list of products\n- All the above in bulk"
- name: Product structure
description: "### Altruistiq\u2019s Product Structure API enables you to:\n\n- Create new product structures\n- Update existing\
\ product structures\n- Delete product structures\n- Get a list of all product structures\n- All the above in bulk against\
\ a single product\n\nThe product structure bulk actions are useful for creating and updating product structures in bulk.\
\ These structures are managed under the context of a single product, so require the product UUID to be provided in the\
\ request."
- name: Product structure inputs
description: "### Altruistiq\u2019s Product Structure API enables you to:\n\n- Create new product structure inputs\n- Update\
\ existing product structure inputs\n- Delete product structure inputs\n- Get a list of all product structure inputs\n\
- All the above in bulk against a single product structure\n\nThe product structure input bulk actions are useful for\
\ creating and updating product structure inputs in bulk. These inputs are managed under the context of a single product,\
\ so require the product UUID to be provided in the request."
- name: Facility
description: '
Altruistiq''s Facility API enables you to:
- Create new facilities in bulk
- Update existing facility persistent properties
- Update facility version
- Create new facility version
- Delete facility versions
- Delete facility
- Get a list of facilities
- Get a single facility
The facility API provides comprehensive management of facility data including location, capacity, and organizational structure.
'
- name: Location
description: '
Altruistiq''s Location API enables you to:
- Get a list of countries with their alpha_2 codes and names
- Get country subdivisions for a specific country by its alpha-2 code
'
- name: Organization
description: '
Altruistiq''s Organization API enables you to:
- Get organization details and business units
The organization API provides access to organizational structure data including the root organization and its business
units.
'
paths:
/api/public/v1/oauth2/token:
post:
security:
- oauth2: []
tags:
- Security
summary: Retrieve An Access Token
operationId: getOauth2Token
description: Retrieve an access token which will enable access to private areas of the API
x-codeSamples:
- lang: python
label: Python
source: "token_req_data = {\n 'grant_type': 'client_credentials',\n 'client_id': client_id,\n 'client_secret':\
\ client_secret\n}\ntoken_response = requests.post(\n \"https://app.altruistiq.com/api/public/v1/oauth2/token\"\
,\n data=token_req_data\n)\ntoken = token_response.json()['access_token']\n"
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OauthToken'
responses:
'200':
description: Token Retrieved
content:
application/json:
schema:
properties:
access_token:
type: string
description: The access token
token_type:
type: string
example: Bearer
description: The type of token
expires_in:
type: integer
example: 4000
description: Token TTL
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/401'
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/500'
/api/public/v1/datasource/{dataSourceId}/upload:
get:
security:
- bearerAuth: []
tags:
- Datasource
summary: Start A Multipart Upload
operationId: startMultipartUpload
description: Use this endpoint to start your multipart upload and retrieve an uploadId and fileId.
x-codeSamples:
- lang: javascript
label: JS
source: "const headers = {\n 'Authorization': 'Bearer tokenId123',\n 'Content-Type': 'application/json'\n}\n\
\nconst response = await fetch(`https://app.altruistiq.com/api/public/v1/datasource/123/upload?fileName=testing.csv&[email protected]`,\
\ {\n method: 'GET',\n headers: headers,\n})\n\nconst multipartStartResponse = await response.json()\n\nconst\
\ results = {\n uploadId: multipartStartResponse.uploadId,\n fileId: multipartStartResponse.fileId\n}\n"
- lang: python
label: Python
source: "file_name = \"testing.csv\"\nuser_email = \"[email protected]\"\nauth_headers = {'Authorization': 'Bearer\
\ ' + token}\nstart_response = requests.get(\n f\"https://app.altruistiq.com/api/public/v1/datasource/{datasource_id}/upload?fileName={file_name}&userEmail={user_email}\"\
,\n headers=auth_headers\n)\nstart_response_json = start_response.json()\nupload_id = start_response_json[\"uploadId\"\
]\nfile_id = start_response_json[\"fileId\"]\n"
parameters:
- name: userEmail
in: query
description: Email of user initiating upload.
required: true
schema:
type: string
- name: fileName
in: query
description: Name of file that is being uploaded.
required: true
schema:
type: string
- name: dataSourceId
in: path
description: ID of datasource
required: true
schema:
type: string
responses:
'201':
description: Multipart upload started
content:
application/json:
schema:
properties:
status:
type: string
example: Multipart Upload started
uploadId:
type: string
example: '123'
fileId:
type: string
example: '123'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/401'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/404'
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/500'
post:
security:
- bearerAuth: []
tags:
- Datasource
summary: Upload A File To A Datasource
operationId: uploadFile
description: Use this endpoint to upload your binary.
x-codeSamples:
- lang: python
label: Python
source: "part = 1\nparts = []\nauth_headers = {'Authorization': 'Bearer ' + token}\nfor chunk in chunk_file(file_name):\n\
\ files = [\n ('file', (file_name, chunk, 'application/octet-stream')),\n ('uploadId', (None, upload_id)),\n\
\ ('partNo', (None, part))\n ]\n upload_response = requests.post(datasource_url, headers=auth_headers,\
\ files=files)\n upload_response_json = upload_response.json()\n parts.append(upload_response_json[\"parts\"\
])\n part += 1\n"
- lang: javascript
label: JS
source: "// First part\nlet formData = new FormData()\n\nformData.append(\n 'file',\n new Blob([fileChunk], {type:\
\ 'application/octet-stream'}),\n 'fileName.csv'\n)\nformData.append('partNo', 1)\nformData.append('uploadId',\
\ 123)\n\nconst headers = {\n 'Content-Type': 'multipart/form-data;',\n 'Content-Range': 'bytes 0-100/1000',\n\
\ 'Authorization': 'Bearer tokenId123',\n}\n\nconst res1 = axios({\n method: 'POST',\n data: formData,\n url:\
\ `https://app.altruistiq.com/api/public/v1/datasource/123/upload`,\n headers\n});\n\nparts.push(res.data)\n\n\
// Second part\nformData = new FormData()\n\nformData.append('partNo', 2)\nformData.append('uploadId', 123)\n\n\
const headers = {\n 'Content-Type': 'multipart/form-data;',\n 'Content-Range': 'bytes 101-200/1000',\n 'Authorization':\
\ 'Bearer tokenId123',\n}\n\nconst res2 = axios({\n method: 'POST',\n data: formData,\n url: `https://app.altruistiq.com/api/public/v1/datasource/123/upload`,\n\
\ headers\n});\n\nparts.push(res.data)\n\n//etc...\n"
parameters:
- name: Content-Type
in: header
type: string
example: multipart/form-data
- name: Content-Range
in: header
type: string
example: bytes 0-100/1000
- name: dataSourceId
in: path
description: ID of datasource
required: true
schema:
type: string
requestBody:
content:
multipart/form-data:
schema:
required:
- file
- uploadId
- partNo
type: object
properties:
file:
type: array
items:
type: string
format: binary
uploadId:
type: string
example: '123'
partNo:
type: number
example: 1
responses:
'201':
description: File Uploaded
content:
application/json:
schema:
properties:
dataSourceId:
type: string
example: '123'
parts:
type: array
example:
- PartNumber: 1
ETag: '123'
- PartNumber: 2
ETag: '123'
status:
type: string
example: Upload Complete
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/401'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/404'
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/500'
/api/public/v1/datasource/{dataSourceId}/upload/{uploadId}/file/{fileId}/complete:
post:
security:
- bearerAuth: []
tags:
- Datasource
summary: Complete A Multipart File Upload
operationId: completeFileUpload
description: Use this endpoint to complete a file upload.
x-codeSamples:
- lang: javascript
label: JS
source: "const headers = {\n 'Authorization': `Bearer tokenId123`,\n 'Content-Type': 'application/json'\n}\n\
\n await fetch('https://app.altruistiq.com/api/public/v1/datasource/123/upload/uploadId123/file/fileId123/complete',\
\ {\n method: 'POST',\n headers: headers,\n body: JSON.stringify({\n [\n {\n\
\ \"PartNumber\": 1,\n \"ETag\": \"123\"\n },\n {\n \
\ \"PartNumber\": 2,\n \"ETag\": \"123\"\n }\n ],\n 'test.csv'\n \
\ })\n })\n"
- lang: python
label: Python
source: "end_req_headers = {\n 'Authorization': 'Bearer ' + token,\n 'Content-Type': 'application/json'\n}\nend_req_data\
\ = {'fileName': file_name, 'parts': parts}\nend_response = requests.post(\n f\"https://app.altruistiq.com/api/public/v1/datasource/{datasource_id}/upload/{upload_id}/file/{file_id}/complete\"\
,\n data=json.dumps(end_req_data),\n headers=end_req_headers\n)\n"
parameters:
- name: dataSourceId
in: path
description: ID of datasource
required: true
schema:
type: string
- name: uploadId
in: path
description: ID of upload
required: true
schema:
type: string
- name: fileId
in: path
description: ID of file
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
fileName:
type: string
example: test.csv
parts:
format: array
example:
- PartNumber: 1
ETag: '123'
- PartNumber: 2
ETag: '123'
responses:
'200':
description: File Multipart Upload Complete
content:
application/json:
schema:
properties:
status:
type: string
example: Multipart Upload Complete
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/401'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/404'
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/500'
/api/public/v1/export:
post:
security:
- bearerAuth: []
tags:
- Export
summary: Create An Export
operationId: createExport
description: Use this endpoint to create and start an export.
requestBody:
content:
application/json:
schema:
type: object
required:
- filters
- format
properties:
format:
type: object
required:
- type
properties:
type:
type: string
enum:
- auto
- brotli
- bz2
- deflate
- lzo
- none
- raw_deflate
- snappy
- gzip
- zstd
example: snappy
description: "Not all compression types are supported for all file types.\nIn particular: \n * JSON\
\ supports: auto, brotli, bz2, deflate, raw_deflate, gzip and zstd\n * PARQUET supports: auto, lzo,\
\ none and snappy"
partitionedBy:
type: array
items:
type: string
example:
- facility_name
filters:
type: object
required:
- financial_years
- endDate
- startDate
properties:
financialYears:
type: array
items:
type: integer
example:
- 2022
description: The financial years you want to export data fo
# --- truncated at 32 KB (186 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/altruistiq/refs/heads/main/openapi/altruistiq-openapi.yml