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 |
|---|---|---|
| DeleteShapefileById | DELETE /v1/shapefiles/{id} | Deletes a map layer everywhere, whatever its scope or projects, asynchronously. Users' map settings drop the layer, and inventory plans that use it as a DSU keep a reference to it. Returns 202 with a job id. |
| GetHeadShapefiles | GET /v1/shapefiles/head | Same as `HEAD /v1/shapefiles`. |
| GetShapefileById | GET /v1/shapefiles/{id} | Returns a map layer's metadata. |
| GetShapefileFeatures | GET /v1/shapefiles/{id}/features | Returns one page of a layer's features as GeoJSON Features (WGS84), in their original order. `X-Query-Count` is the number of features. A zip upload reads back as reprojected GeoJSON, not the original files. |
| GetShapefiles | GET /v1/shapefiles | Returns the company's map layers: company layers and every project's. Heatmap layers are not included. Each record lists every project the layer belongs to. |
| GetShapefilesJob | GET /v1/shapefiles/jobs/{jobId} | Returns the status of an upload or delete job. A successful upload's result has the new layer's id. |
| HeadShapefiles | HEAD /v1/shapefiles | Returns the number of map layers in the company (company layers and every project's) in `X-Query-Count`. Heatmap layers are not included. Supports the same filters as GET. |
| PatchShapefiles | PATCH /v1/shapefiles | Updates layer metadata: `name`, `description`, `color`, `scope` and `projectIds`. This is how a layer is shared with more projects or removed from some. Only available here, not on project routes. The body is an array of records with ids, and the response has a result for each one. Send one record per layer: a later record for a layer already in the request is rejected with 400. |
| PostShapefiles | POST /v1/shapefiles | Creates a map layer from a GeoJSON FeatureCollection, asynchronously. The features are converted to a shapefile and imported like an uploaded zip. A name already in use where the layer will appear returns 409 with the existing layer's id as `conflictingId`; delete that layer first to replace it. Heatmap layers also hold their names but are not available through this API, so a clash with one returns 409 without `conflictingId`; rename or delete the heatmap in ComboCurve, or choose another name. Returns 202 with a job id to poll at `GET /v1/shapefiles/jobs/{jobId}`. |
| PostShapefilesUpload | POST /v1/shapefiles/uploads | Step 1 of uploading a shapefile zip: returns a signed URL to PUT the zip to (step 2), valid for 30 minutes. Then import it with `POST /v1/shapefiles/uploads/{uploadId}` (step 3) within 24 hours; uploads that are never imported are deleted. The zip must hold one shapefile (`.shp`, `.shx`, `.dbf`, optionally `.prj`) and be at most 260 MB. |
| PostShapefilesUploadImport | POST /v1/shapefiles/uploads/{uploadId} | Step 3: imports an uploaded zip as a map layer, asynchronously. The zip's contents are checked first (400 if it is not a shapefile zip). An upload can be imported once; repeating the request returns 409 with the original `jobId` in the error details. Poll the `jobId` returned here; do not assume it equals the upload id. |
ShapefileJobAccepted DeleteShapefileById (string id)
Deletes a map layer everywhere, whatever its scope or projects, asynchronously. Users’ map settings drop the layer, and inventory plans that use it as a DSU keep a reference to it. Returns 202 with a job id.
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 DeleteShapefileByIdExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var id = "id_example"; // string |
try
{
// Deletes a map layer everywhere, whatever its scope or projects, asynchronously. Users' map settings drop the layer, and inventory plans that use it as a DSU keep a reference to it. Returns 202 with a job id.
ShapefileJobAccepted result = apiInstance.DeleteShapefileById(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.DeleteShapefileById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 202 | Accepted | - | | 404 | Not Found. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void GetHeadShapefiles (int? skip = null, int? take = null, string scope = null, string projectId = null, string name = null)
Same as HEAD /v1/shapefiles.
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 GetHeadShapefilesExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var skip = 56; // int? | number of items to skip (optional) (default to 0)
var take = 56; // int? | max records to return (optional) (default to 25) (between 1 and 200)
var scope = "scope_example"; // string | (optional)
var projectId = "projectId_example"; // string | (optional)
var name = "name_example"; // string | (optional)
try
{
// Same as `HEAD /v1/shapefiles`.
apiInstance.GetHeadShapefiles(skip, take, scope, projectId, name);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.GetHeadShapefiles: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| skip | int? | number of items to skip | [optional] [default to 0] |
| take | int? | max records to return | [optional] [default to 25] [between 1 and 200] |
| scope | string | [optional] | |
| projectId | string | [optional] | |
| name | string | [optional] |
void (empty response body)
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | * X-Query-Count - The number of records in this resource. When filters are provided only matching records are counted. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Shapefile GetShapefileById (string id)
Returns a map layer’s metadata.
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 GetShapefileByIdExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var id = "id_example"; // string |
try
{
// Returns a map layer's metadata.
Shapefile result = apiInstance.GetShapefileById(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.GetShapefileById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | - | | 404 | Not Found. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ICollection<ShapefileFeature> GetShapefileFeatures (string id, int? skip = null, int? take = null)
Returns one page of a layer’s features as GeoJSON Features (WGS84), in their original order. X-Query-Count is the number of features. A zip upload reads back as reprojected GeoJSON, not the original files.
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 GetShapefileFeaturesExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var id = "id_example"; // string |
var skip = 56; // int? | number of items to skip (optional) (default to 0)
var take = 56; // int? | (optional) (default to 200) (between 1 and 200)
try
{
// Returns one page of a layer's features as GeoJSON Features (WGS84), in their original order. `X-Query-Count` is the number of features. A zip upload reads back as reprojected GeoJSON, not the original files.
ICollection<ShapefileFeature> result = apiInstance.GetShapefileFeatures(id, skip, take);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.GetShapefileFeatures: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | ||
| skip | int? | number of items to skip | [optional] [default to 0] |
| take | int? | [optional] [default to 200] [between 1 and 200] |
API Key, Service Account
| Status code | Description | Response headers |
|————-|————-|——————|
| 200 | OK | * X-Query-Count - The number of records in this resource. When filters are provided only matching records are counted.
* Link - Indicates a typed relationship with another resource, where the relation type is defined by RFC 5988. We include the relationships next, prev, first and last, which can be used to move between pages of the list of results. |
| 404 | Not Found. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ICollection<Shapefile> GetShapefiles (int? skip = null, int? take = null, string scope = null, string projectId = null, string name = null)
Returns the company’s map layers: company layers and every project’s. Heatmap layers are not included. Each record lists every project the layer belongs to.
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 GetShapefilesExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var skip = 56; // int? | number of items to skip (optional) (default to 0)
var take = 56; // int? | (optional) (default to 25) (between 1 and 200)
var scope = "scope_example"; // string | `company` or `project`. `project` without `projectId` matches every project layer. (optional)
var projectId = "projectId_example"; // string | Only layers in this project. Cannot be combined with `scope=company`. (optional)
var name = "name_example"; // string | (optional)
try
{
// Returns the company's map layers: company layers and every project's. Heatmap layers are not included. Each record lists every project the layer belongs to.
ICollection<Shapefile> result = apiInstance.GetShapefiles(skip, take, scope, projectId, name);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.GetShapefiles: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| skip | int? | number of items to skip | [optional] [default to 0] |
| take | int? | [optional] [default to 25] [between 1 and 200] | |
| scope | string | `company` or `project`. `project` without `projectId` matches every project layer. | [optional] |
| projectId | string | Only layers in this project. Cannot be combined with `scope=company`. | [optional] |
| name | string | [optional] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | * Link - Indicates a typed relationship with another resource, where the relation type is defined by RFC 5988. We include the relationships next, prev, first and last, which can be used to move between pages of the list of results. | | 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]
ShapefileJob GetShapefilesJob (string jobId)
Returns the status of an upload or delete job. A successful upload’s result has the new layer’s id.
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 GetShapefilesJobExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var jobId = "jobId_example"; // string |
try
{
// Returns the status of an upload or delete job. A successful upload's result has the new layer's id.
ShapefileJob result = apiInstance.GetShapefilesJob(jobId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.GetShapefilesJob: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| jobId | string |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | - | | 404 | Not Found. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void HeadShapefiles (int? skip = null, int? take = null, string scope = null, string projectId = null, string name = null)
Returns the number of map layers in the company (company layers and every project’s) in X-Query-Count. Heatmap layers are not included. Supports the same filters as GET.
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 HeadShapefilesExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var skip = 56; // int? | number of items to skip (optional) (default to 0)
var take = 56; // int? | max records to return (optional) (default to 25) (between 1 and 200)
var scope = "scope_example"; // string | `company` or `project`. `project` without `projectId` matches every project layer. (optional)
var projectId = "projectId_example"; // string | Only layers in this project. Cannot be combined with `scope=company`. (optional)
var name = "name_example"; // string | (optional)
try
{
// Returns the number of map layers in the company (company layers and every project's) in `X-Query-Count`. Heatmap layers are not included. Supports the same filters as GET.
apiInstance.HeadShapefiles(skip, take, scope, projectId, name);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.HeadShapefiles: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| skip | int? | number of items to skip | [optional] [default to 0] |
| take | int? | max records to return | [optional] [default to 25] [between 1 and 200] |
| scope | string | `company` or `project`. `project` without `projectId` matches every project layer. | [optional] |
| projectId | string | Only layers in this project. Cannot be combined with `scope=company`. | [optional] |
| name | string | [optional] |
void (empty response body)
API Key, Service Account
| Status code | Description | Response headers |
|————-|————-|——————|
| 200 | OK | * X-Query-Count - The number of records in this resource. When filters are provided only matching records are counted.
* Link - Indicates a typed relationship with another resource, where the relation type is defined by RFC 5988. We include the relationships next, prev, first and last, which can be used to move between pages of the list of results. |
| 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]
ShapefileMultiStatusResponse PatchShapefiles (List
layers)
Updates layer metadata: name, description, color, scope and projectIds. This is how a layer is shared with more projects or removed from some. Only available here, not on project routes. The body is an array of records with ids, and the response has a result for each one. Send one record per layer: a later record for a layer already in the request is rejected with 400.
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 PatchShapefilesExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var layers = new List<ShapefilePatchInput>(); // List<ShapefilePatchInput> |
try
{
// Updates layer metadata: `name`, `description`, `color`, `scope` and `projectIds`. This is how a layer is shared with more projects or removed from some. Only available here, not on project routes. The body is an array of records with ids, and the response has a result for each one. Send one record per layer: a later record for a layer already in the request is rejected with 400.
ShapefileMultiStatusResponse result = apiInstance.PatchShapefiles(layers);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.PatchShapefiles: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| layers | List<ShapefilePatchInput> | [Max number of items is 200] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 207 | Multi-Status | - | | 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]
ShapefileJobAccepted PostShapefiles (ShapefileGeoJsonInput layer)
Creates a map layer from a GeoJSON FeatureCollection, asynchronously. The features are converted to a shapefile and imported like an uploaded zip. A name already in use where the layer will appear returns 409 with the existing layer’s id as conflictingId; delete that layer first to replace it. Heatmap layers also hold their names but are not available through this API, so a clash with one returns 409 without conflictingId; rename or delete the heatmap in ComboCurve, or choose another name. Returns 202 with a job id to poll at GET /v1/shapefiles/jobs/{jobId}.
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 PostShapefilesExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var layer = new ShapefileGeoJsonInput(); // ShapefileGeoJsonInput |
try
{
// Creates a map layer from a GeoJSON FeatureCollection, asynchronously. The features are converted to a shapefile and imported like an uploaded zip. A name already in use where the layer will appear returns 409 with the existing layer's id as `conflictingId`; delete that layer first to replace it. Heatmap layers also hold their names but are not available through this API, so a clash with one returns 409 without `conflictingId`; rename or delete the heatmap in ComboCurve, or choose another name. Returns 202 with a job id to poll at `GET /v1/shapefiles/jobs/{jobId}`.
ShapefileJobAccepted result = apiInstance.PostShapefiles(layer);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.PostShapefiles: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| layer | ShapefileGeoJsonInput |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 202 | Accepted | - | | 400 | Bad Request. There is something wrong with the request data. | - | | 409 | The name is already used where the layer would appear. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ShapefileUploadReservation PostShapefilesUpload (ShapefileUploadRequest upload = null)
Step 1 of uploading a shapefile zip: returns a signed URL to PUT the zip to (step 2), valid for 30 minutes. Then import it with POST /v1/shapefiles/uploads/{uploadId} (step 3) within 24 hours; uploads that are never imported are deleted. The zip must hold one shapefile (.shp, .shx, .dbf, optionally .prj) and be at most 260 MB.
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 PostShapefilesUploadExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var upload = new ShapefileUploadRequest(); // ShapefileUploadRequest | (optional)
try
{
// Step 1 of uploading a shapefile zip: returns a signed URL to PUT the zip to (step 2), valid for 30 minutes. Then import it with `POST /v1/shapefiles/uploads/{uploadId}` (step 3) within 24 hours; uploads that are never imported are deleted. The zip must hold one shapefile (`.shp`, `.shx`, `.dbf`, optionally `.prj`) and be at most 260 MB.
ShapefileUploadReservation result = apiInstance.PostShapefilesUpload(upload);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.PostShapefilesUpload: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| upload | ShapefileUploadRequest | [optional] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 201 | Created | - | | 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]
ShapefileJobAccepted PostShapefilesUploadImport (string uploadId, ShapefileImportInput layer)
Step 3: imports an uploaded zip as a map layer, asynchronously. The zip’s contents are checked first (400 if it is not a shapefile zip). An upload can be imported once; repeating the request returns 409 with the original jobId in the error details. Poll the jobId returned here; do not assume it equals the upload id.
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 PostShapefilesUploadImportExample
{
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 ShapefilesApi(serviceAccount, apiKey);
var uploadId = "uploadId_example"; // string |
var layer = new ShapefileImportInput(); // ShapefileImportInput |
try
{
// Step 3: imports an uploaded zip as a map layer, asynchronously. The zip's contents are checked first (400 if it is not a shapefile zip). An upload can be imported once; repeating the request returns 409 with the original `jobId` in the error details. Poll the `jobId` returned here; do not assume it equals the upload id.
ShapefileJobAccepted result = apiInstance.PostShapefilesUploadImport(uploadId, layer);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ShapefilesApi.PostShapefilesUploadImport: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| uploadId | string | ||
| layer | ShapefileImportInput |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 202 | Accepted | - | | 400 | Bad Request. There is something wrong with the request data or the zip. | - | | 404 | No upload with this id (not uploaded yet, expired, or reserved through another route). | - | | 409 | The name is already in use, or the upload was already imported. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]