Skip to content

[ILX-48044] Emission Calculation endpoint in API document #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 33 additions & 30 deletions source/includes/acts/post_api.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
## Add or Modify Database Table

This section outlines the available POST APIs designed for modifying ACTS data. These APIs offer options for updating existing records and inserting new ones.
This section outlines the available POST APIs designed for modifying ACTS data. These APIs let you update existing records and insert new records. POSTs should be formatted in JSON.

* To insert new records, set the primary key to 0
* To updates to existing records, use the primary key of the record.
* To update existing records, use the primary key of the record.

<aside class="notice">
For efficient handling of larger data inserts, it is recommended to perform batch POSTs containing up to 500 rows each.

Note that excessively large batch POSTs may encounter throttling or failure, depending on system resources.
</aside>

In the following release, the POST APIs End points are provided to add or update following table
In the following release, the POST APIs End points are provided to add or update following:

* Equipment
* Equipment Emissions Recalculate
* Equipment Attribute
* Facility
* Facility Attribute
* Operation
* Operation Emissions Recalculate
* Workflow
* Workflow Answer
* Workflow Equipment
Expand Down Expand Up @@ -139,9 +141,11 @@ IRestResponse response = client.Execute(request);
}

```
**Equipment/EmissionCalculation POST endpoint**
### 2. Equipment Emissions Recalculate

This section guides you through the process of an on-demand update to the emissions calculation for a specific equipment using the designated API endpoint. While this API endpoint is a child of the Equipment table, adding or updating an equipment will not cause an update on its own.

Emission Calculation using equipment ids can be triggered using below operation.
**Equipment/EmissionCalculation POST endpoint**

`POST` api/v1/equipment/emissioncalculation

Expand All @@ -154,7 +158,7 @@ var options = { method: 'POST',
url: 'https://[tenant].actsapi.intelex.com/v1/equipment/emissioncalculation',
headers: { 'content-type': 'application/json' },
body:
{ [EquipmentId: 'number']
{ [EquipmentId1, EquipmentId2, EquipmentId3....]
},
json: true };

Expand All @@ -169,18 +173,16 @@ request(options, function (error, response, body) {
var client = new RestClient("https://[tenant].actsapi.intelex.com/v1/equipment/emissioncalculation");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\r\n \"EquipmentId\": \"number\",\r\n}", ParameterType.RequestBody);
request.AddParameter("application/json", "{\r\n [EquipmentId1, EquipmentId2, EquipmentId3....]\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

> Input JSON Body

```json
[
{
"EquipmentId": "number"
}
]
{
[EquipmentId1, EquipmentId2, EquipmentId3....]
}
```
> Example Response

Expand Down Expand Up @@ -211,7 +213,8 @@ IRestResponse response = client.Execute(request);

```

### 2. Equipment Attribute Table

### 3. Equipment Attribute Table

This section outlines the process of adding new entries or modifying existing records within the Equipment Attribute table using the dedicated API endpoint.

Expand Down Expand Up @@ -298,7 +301,7 @@ IRestResponse response = client.Execute(request);

```

### 3. Facility Table
### 4. Facility Table

This section outlines the process of adding new entries or modifying existing records within the Facility table using the dedicated API endpoint.

Expand Down Expand Up @@ -402,7 +405,7 @@ IRestResponse response = client.Execute(request);

```

### 4. Facility Attribute Table
### 5. Facility Attribute Table

This section outlines the process of adding new entries or modifying existing records within the Facility Attribute table using the dedicated API endpoint.

Expand Down Expand Up @@ -489,7 +492,7 @@ IRestResponse response = client.Execute(request);

```

### 5. Operation Table
### 6. Operation Table

This section outlines the process of adding new entries or modifying existing records within the Operation table using the dedicated API endpoint.

Expand Down Expand Up @@ -600,9 +603,11 @@ IRestResponse response = client.Execute(request);

```

**Operation/EmissionCalculation POST endpoint**
### 7. Operation Emissions Recalculate

This section guides you through the process of an on-demand update to the emissions calculation for a specific operation using the designated API endpoint. While this API endpoint is a child of the Operation table, adding or updating an operation with the API will not cause an update on its own.

Emission Calculation using Operation ids can be triggered using below operation.
**Operation/EmissionCalculation POST endpoint**

`POST` api/v1/operation/emissioncalculation

Expand All @@ -615,7 +620,7 @@ var options = { method: 'POST',
url: 'https://[tenant].actsapi.intelex.com/v1/operation/emissioncalculation',
headers: { 'content-type': 'application/json' },
body:
{ [OperationId: 'number']
{ [OperationId1, OperationId2, OperationId3....]
},
json: true };

Expand All @@ -630,18 +635,16 @@ request(options, function (error, response, body) {
var client = new RestClient("https://[tenant].actsapi.intelex.com/v1/operation/emissioncalculation");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\r\n \"OperationId\": \"number\",\r\n}", ParameterType.RequestBody);
request.AddParameter("application/json", "{\r\n [OperationId1, OperationId2, OperationId3....]\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

> Input JSON Body

```json
[
{
"OperationId": "number"
}
]
{
[OperationId1, OperationId2, OperationId3....]
}
```
> Example Response

Expand Down Expand Up @@ -672,7 +675,7 @@ IRestResponse response = client.Execute(request);

```

### 6. Workflow Table
### 8. Workflow Table

This section outlines the process of adding new entries or modifying existing records within the Workflow table using the dedicated API endpoint.

Expand Down Expand Up @@ -756,7 +759,7 @@ IRestResponse response = client.Execute(request);
}

```
### 7. Workflow Answer Table
### 9. Workflow Answer Table

This section outlines the process of adding new entries or modifying existing records within the Workflow Answer table using the dedicated API endpoint.

Expand Down Expand Up @@ -852,7 +855,7 @@ IRestResponse response = client.Execute(request);
}

```
### 8. Workflow Equipment Table
### 10. Workflow Equipment Table

This section outlines the process of adding new entries or modifying existing records within the Workflow Equipment table using the dedicated API endpoint.

Expand Down Expand Up @@ -936,7 +939,7 @@ IRestResponse response = client.Execute(request);
}

```
### 9. Workflow Facility Table
### 11. Workflow Facility Table

This section outlines the process of adding new entries or modifying existing records within the Workflow Facility table using the dedicated API endpoint.

Expand Down Expand Up @@ -1021,7 +1024,7 @@ IRestResponse response = client.Execute(request);
}

```
### 10. Workflow Person Table
### 12. Workflow Person Table

This section outlines the process of adding new entries or modifying existing records within the Workflow Person table using the dedicated API endpoint.

Expand Down
Loading