C# client for the ComboCurve REST API
View the Project on GitHub insidepetroleum/combocurve-client-csharp
All URIs are relative to https://api.combocurve.com
Method | HTTP request | Description |
---|---|---|
PostExports | POST /v1/exports | Generates export links for the given criteria |
ExportResponse PostExports (ExportRequest exportRequest = null)
Generates export links for the given criteria. Different types of exports can be retrieved by using the appropriate sub-class of ExportRequest.
The EconMonthlyExport request type will allow you to pull Econ Monthly results. If only ProjectId and ScenarioId are provided, then the latest successful econ run will be used. To pull data for a specific econ run the EconRunId can be used.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class PostExportsExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ExportsApi(serviceAccount, apiKey);
var exportRequest = new EconMonthlyExport(
econRunId: "6854809b5254f3f07a38d5ca"); // EconMonthlyExport | Export operation to request. See EconMonthlyExport. (optional)
try
{
// Generates export links for the given criteria
ExportResponse result = apiInstance.PostExports(exportRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ExportsApi.PostExports: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
ExportType | string | Export type | [optional] [default to ExportTypeEnum.EconMonthlyExport] |
ExpirationHours | int? | Expiration hours for the export links | [optional] |
FileType | string | File type | [optional] [default to FileTypeEnum.Parquet] |
ProjectId | string | Project Id | [optional] |
ScenarioId | string | Scenario Id | [optional] |
EconRunId | string | Econ Run Id | [optional] |
The DailyForecastVolumeExport request type will allow you to pull Daily Forecast Volume results.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class PostExportsExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ExportsApi(serviceAccount, apiKey);
var exportRequest = new DailyForecastVolumeExport(
projectId: "6854809b5254f3f07a38d5ca",
forecastId: "6849b7337a6dc5a802a9b3b2"); // DailyForecastVolumeExport | Export operation to request. See DailyForecastVolumeExport. (optional)
try
{
// Generates export links for the given criteria
ExportResponse result = apiInstance.PostExports(exportRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ExportsApi.PostExports: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
ExportType | string | Export type | [optional] [default to ExportTypeEnum.DailyForecastVolumeExport] |
ExpirationHours | int? | Expiration hours for the export links | [optional] |
FileType | string | File type | [optional] [default to FileTypeEnum.Parquet] |
ProjectId | string | Project Id | [optional] |
ForecastId | string | Forecast Id | [optional] |
The MonthlyForecastVolumeExport request type will allow you to pull Monthly Forecast Volume results.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class PostExportsExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ExportsApi(serviceAccount, apiKey);
var exportRequest = new MonthlyForecastVolumeExport(
projectId: "6854809b5254f3f07a38d5ca",
forecastId: "6849b7337a6dc5a802a9b3b2"); // MonthlyForecastVolumeExport | Export operation to request. See MonthlyForecastVolumeExport. (optional)
try
{
// Generates export links for the given criteria
ExportResponse result = apiInstance.PostExports(exportRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ExportsApi.PostExports: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
ExportType | string | Export type | [optional] [default to ExportTypeEnum.MonthlyForecastVolumeExport] |
ExpirationHours | int? | Expiration hours for the export links | [optional] |
FileType | string | File type | [optional] [default to FileTypeEnum.Parquet] |
ProjectId | string | Project Id | [optional] |
ForecastId | string | Forecast Id | [optional] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | - | | 400 | Bad Request. There is something wrong with the request data. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]