Skip to content

kern-services/kern.services.CumulocityClient

Repository files navigation

kern.services.CumulocityClient - C# library for the Cumulocity IoT

This library was generated using the OpenAPI generator project.

The command to generate this library can be found in the file openapi/generate.sh:

docker run --rm \
    -v $PARENT_DIR:/local openapitools/openapi-generator-cli generate \
    -i /local/openapi/c8y-oas-10.15.0.json \
    -g csharp \
    --additional-properties=netCoreProjectFile=true,packageName=kern.services.CumulocityClient,packageVersion=10.15.1,targetFramework=net8.0 \
    -o /local/

Cumulocity IoT REST API

The source of the generated API can be found here: https://cumulocity.com/api/core/10.15.0/

The version of the API is 10.15.0, which is not the latest version of the API, but it is the version currently deployed on the Instance that we are using. Feel free to create newer versions and provide a pull request.

NuGet package

The NuGet package can be found here: https://www.nuget.org/packages/kern.services.CumulocityClient/

The package is currently built manually and uploaded to NuGet.

Build using dotnet:

dotnet pack ./src/kern.services.CumulocityClient/kern.services.CumulocityClient.csproj -o ./output -c Release

REST implementation

This section describes the aspects common to all REST-based interfaces of Cumulocity IoT. The interfaces are based on the Hypertext Transfer Protocol 1.1 using HTTPS.

HTTP usage

Application management

Cumulocity IoT uses a so-called "application key" to distinguish requests coming from devices and traffic from applications. If you write an application, pass the following header as part of all requests:

X-Cumulocity-Application-Key: <APPLICATION_KEY>

For example, if you registered your application in the Cumulocity IoT Administration application with the key "myapp", your requests should contain the header:

X-Cumulocity-Application-Key: myapp

This makes your application subscribable and billable. If you implement a device, do not pass the key.

ⓘ Info: Make sure that you pass the key in all requests coming from an application. If you leave out the key, the request will be considered as a device request, and the corresponding device will be marked as "available".

Limited HTTP clients

If you use an HTTP client that can only perform GET and POST methods in HTTP, you can emulate the other methods through an additional "X-HTTP-METHOD" header. Simply issue a POST request and add the header, specifying the actual REST method to be executed. For example, to emulate the "PUT" (modify) method, you can use:

POST ...
X-HTTP-METHOD: PUT

Processing mode

Every update request (PUT, POST, DELETE) executes with a so-called processing mode. The processing modes are as follows:

|Processing mode|Description| |- --|- --| |PERSISTENT (default)|All updates will be send both to the Cumulocity IoT database and to real-time processing.| |TRANSIENT|Updates will be sent only to real-time processing. As part of real-time processing, the user can decide case by case through scripts whether updates should be stored to the database or not.| |QUIESCENT|The QUIESCENT processing mode behaves like the PERSISTENT processing mode with the exception that no real-time notifications will be sent. Currently, the QUIESCENT processing mode is applicable for measurements, events and managed objects.| |CEP| With the CEP processing mode, requests will only be processed by CEP or Apama. Currently, the CEP processing mode is applicable for measurements and events only.|

To explicitly control the processing mode of an update request, you can use the "X-Cumulocity-Processing-Mode" header with a value of either "PERSISTENT", "TRANSIENT", "QUIESCENT" or "CEP":

X-Cumulocity-Processing-Mode: PERSISTENT

ⓘ Info: Events are always delivered to CEP/Apama for all processing modes. This is independent from real-time notifications.

Authorization

All requests issued to Cumulocity IoT are subject to authorization. To determine the required permissions, see the "Required role" entries for the individual requests. To learn more about the different permissions and the concept of ownership in Cumulocity IoT, see Security aspects > Managing roles and assigning permissions".

Media types

Each type of data is associated with an own media type. The general format of media types is:

application/vnd.com.nsn.cumulocity.<TYPE>+json;ver=<VERSION>;charset=UTF-8

Each media type contains a parameter ver indicating the version of the type. At the time of writing, the latest version is "0.9". As an example, the media type for an error message in the current version is:

application/vnd.com.nsn.cumulocity.error+json;ver=0.9;charset=UTF-8

Media types are used in HTTP "Content-Type" and "Accept" headers. If you specify an "Accept" header in a POST or PUT request, the response will contain the newly created or updated object. If you do not specify the header, the response body will be empty.

If a media type without the ver parameter is given, the oldest available version will be returned by the server. If the "Accept" header contains the same media type in multiple versions, the server will return a representation in the latest supported version.

Note that media type values should be treated as case insensitive.

Date format

Data exchanged with Cumulocity IoT in HTTP requests and responses is encoded in JSON format and UTF-8 character encoding. Timestamps and dates are accepted and emitted by Cumulocity IoT in ISO 8601 format:

Date: YYYY-MM-DD
Time: hh:mm:ss±hh:mm
Timestamp: YYYY-MM-DDThh:mm:ss±hh:mm

To avoid ambiguity, all times and timestamps must include timezone information. Please take into account that the plus character "+" must be encoded as "%2B".

Response Codes

Cumulocity IoT uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate a user error. The response provides information on why the request failed (for example, a required parameter was omitted). Codes in the 5xx range indicate an error with Cumulocity IoT's servers (these are very rare).

HTTP status code summary

|Code|Message|Description| |:- --:|:- --|:- --| |200|OK|Everything worked as expected.| |201|Created|A managed object was created.| |204|No content|An object was removed.| |400|Bad Request|The request was unacceptable, often due to missing a required parameter.| |401|Unauthorized|Authentication has failed, or credentials were required but not provided.| |403|Forbidden|The authenticated user doesn't have permissions to perform the request.| |404|Not Found|The requested resource doesn't exist.| |405|Method not allowed|The employed HTTP method cannot be used on this resource (for example, using PUT on a read-only resource).| |409|Conflict| The data is correct but it breaks some constraints (for example, application version limit is exceeded). | |422|Invalid data| Invalid data was sent on the request and/or a query could not be understood. | |422|Unprocessable Entity| The requested resource cannot be updated or mandatory fields are missing on the executed operation. | |500
503|Server Errors| Something went wrong on Cumulocity IoT's end. |

REST usage

Interpretation of HTTP verbs

The semantics described in the HTTP specification are used:

  • POST creates a new resource. In the response "Location" header, the URI of the newly created resource is returned.
  • GET retrieves a resource.
  • PUT updates an existing resource with the contents of the request.
  • DELETE removes a resource. The response will be "204 No Content".

If a PUT request only contains parts of a resource (also known as fragments), only those parts are updated. To remove such a part, use a PUT request with a null value for it:

{
  \"resourcePartName\": null
}

ⓘ Info: A PUT request cannot update sub-resources that are identified by a separate URI.

URI space and URI templates

Clients should not make assumptions on the layout of URIs used in requests, but construct URIs from previously returned URIs or URI templates. The root interface provides the entry point for clients.

URI templates contain placeholders in curly braces (for example, {type}), which must be filled by the client to produce a URI. As an example, see the following excerpt from the event API response:

{
  \"events\": {
      \"self\": \"https://<TENANT_DOMAIN>/event\"
  },
  \"eventsForSourceAndType\": \"https://<TENANT_DOMAIN>/event/events?type={type}&source={source}\"
}

The client must fill the {type} and {source} placeholders with the desired type and source devices of the events to be returned. The meaning of these placeholders is documented in the respective interface descriptions.

Interface structure

In general, Cumulocity IoT REST resources are modeled according to the following pattern:

  • The starting point are API resources, which will provide access to the actual data through URIs and URI templates to collection resources. For example, the above event API resource provides the events URI and the eventsForSourceAndType URI to access collections of events.
  • Collection resources aggregate member resources and allow creating new member resources in the collection. For example, through the events collection resource, new events can be created.
  • Finally, individual resources can be edited.

Query result paging

Collection resources support paging of data to avoid passing huge data volumes in one block from client to server. GET requests to collections accept two query parameters:

  • currentPage defines the slice of data to be returned, starting with 1. By default, the first page is returned.
  • pageSize indicates how many entries of the collection should be returned. By default, 5 entries are returned. The upper limit for one page is currently 2,000 documents. Any larger requested page size is trimmed to the upper limit.
  • withTotalElements will yield the total number of elements in the statistics object. This is only applicable on range queries.
  • withTotalPages will yield the total number of pages in the statistics object. This is only applicable on range queries.

For convenience, collection resources provide next and prev links to retrieve the next and previous pages of the results. The following is an example response for managed object collections (the contents of the array managedObjects have been omitted):

{
  \"self\" : \"https://<TENANT_DOMAIN>/inventory/managedObjects?pageSize=5&currentPage=2\",
  \"managedObjects\" : [...],
  \"statistics\" : {
    \"totalPages\" : 7,
    \"pageSize\" : 5,
    \"currentPage\" : 2,
    \"totalElements\" : 34
  },
  \"prev\" : \"https://<TENANT_DOMAIN>/inventory/managedObjects?pageSize=5&currentPage=1\",
  \"next\" : \"https://<TENANT_DOMAIN>/inventory/managedObjects?pageSize=5&currentPage=3\"
}

The totalPages and totalElements properties can be expensive to compute, hence they are not returned by default for range queries. To include any of them in the result, add the query parameters withTotalPages=true and/or withTotalElements=true.

ⓘ Info: If inventory roles are applied to a user, a query by the user may return less than pageSize results even if there are more results in total.

Query result paging for users with restricted access

If a user does not have a global role for reading data from the API resource but rather has inventory roles for reading only particular documents, there are some differences in query result paging:

  • In some circumstances the response may contain less than pageSize and totalElements elements though there is more data in the database accessible for the user.
  • In some circumstances next and prev links may appear in the response though there is no more data in the database accessible for the user.
  • The property currentPage of the response does not contain the page number but the offset of the next element not yet processed by the querying mechanism.
  • The query parameters withTotalPages=true and withTotalElements=true have no effect, and the value of the totalPages and totalElements properties is always null.

The above behavior results from the fact that the querying mechanism is iterating maximally over 10 * max(pageSize, 100) documents per request, and it stops even though the full page of data accessible for the user could not be collected. When the next page is requested the querying mechanism starts the iteration where it completed the previous time.

Query result by time interval

Use the following query parameters to obtain data for a specified time interval:

  • dateFrom - Start date or date and time.
  • dateTo - End date or date and time.

Example formats:

dateTo=2019-04-20
dateTo=2019-04-20T08:30:00.000Z

Parameters are optional. Values provided with those parameters are inclusive.

⚠️ Important: If your servers are not running in UTC (Coordinated Universal Time), any date passed without timezone will be handled as UTC, regardless of the server local timezone. This might lead to a difference regarding the date/time range included in the results.

Root interface

To discover the URIs to the various interfaces of Cumulocity IoT, it provides a "root" interface. This root interface aggregates all the underlying API resources. See the Platform API endpoint. For more information on the different API resources, consult the respective API sections.

Generic media types

Error

The error type provides further information on the reason of a failed request.

Content-Type: application/vnd.com.nsn.cumulocity.error+json

|Name|Type|Description| |- --|- --|- --| |error|string|Error type formatted as <RESOURCE_TYPE>/<ERROR_NAME>. For example, an object not found in the inventory is reported as inventory/notFound.| |info|string|URL to an error description on the Internet.| |message|string|Short text description of the error|

Paging statistics

Paging statistics for collection of resources.

Content-Type: application/vnd.com.nsn.cumulocity.pagingstatistics+json

|Name|Type|Description| |- --|- --|- --| |currentPage|integer|The current returned page within the full result set, starting at "1".| |pageSize|integer|Maximum number of records contained in this query.| |totalElements|integer|The total number of results (elements).| |totalPages|integer|The total number of paginated results (pages).|

ⓘ Info: The totalPages and totalElements properties are not returned by default in the response. To include any of them, add the query parameters withTotalPages=true and/or withTotalElements=true. Be aware of differences in query result paging for users with restricted access.

ⓘ Info: To improve performance, the totalPages and totalElements statistics are cached for 10 seconds.

Device management library

The device management library has moved. Visit the device management library in the Reference guide.

Sensor library

The sensor library has moved. Visit the sensor library in the Reference guide.

Login options

When you sign up for an account on the Cumulocity IoT platform, for example, by using a free trial, you will be provided with a dedicated URL address for your tenant. All requests to the platform must be authenticated employing your tenant ID, Cumulocity IoT user (c8yuser for short) and password. Cumulocity IoT offers the following forms of authentication:

  • Basic authentication (Basic)
  • OAI-Secure authentication (OAI-Secure)
  • SSO with authentication code grant (SSO)
  • JSON Web Token authentication (JWT, deprecated)

You can check your login options with a GET call to the endpoint <a href="#tag/Login-options">/tenant/loginOptions.

This C# SDK is automatically generated by the OpenAPI Generator project:

Frameworks supported

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using kern.services.CumulocityClient.Api;
using kern.services.CumulocityClient.Client;
using kern.services.CumulocityClient.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out kern.services.CumulocityClient.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using kern.services.CumulocityClient.Api;
using kern.services.CumulocityClient.Client;
using kern.services.CumulocityClient.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://<TENANT_DOMAIN>";
            // Configure HTTP basic authorization: Basic
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";
            // Configure Bearer token for authorization: OAI-Secure
            config.AccessToken = "YOUR_BEARER_TOKEN";
            // Configure OAuth2 access token for authorization: SSO
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AlarmAPIApi(config);

            try
            {
                // Retrieve URIs to collections of alarms
                AlarmsApiResource result = apiInstance.GetAlarmsApiResource();
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AlarmAPIApi.GetAlarmsApiResource: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://<TENANT_DOMAIN>

Class Method HTTP request Description
AlarmAPIApi GetAlarmsApiResource GET /alarm Retrieve URIs to collections of alarms
AlarmsApi DeleteAlarmCollectionResource DELETE /alarm/alarms Remove alarm collections
AlarmsApi GetAlarmCollectionCountResource GET /alarm/alarms/count Retrieve the total number of alarms
AlarmsApi GetAlarmCollectionResource GET /alarm/alarms Retrieve all alarms
AlarmsApi GetAlarmResource GET /alarm/alarms/{id} Retrieve a specific alarm
AlarmsApi PostAlarmCollectionResource POST /alarm/alarms Create an alarm
AlarmsApi PutAlarmCollectionResource PUT /alarm/alarms Update alarm collections
AlarmsApi PutAlarmResource PUT /alarm/alarms/{id} Update a specific alarm
ApplicationAPIApi GetApplicationManagementApiResource GET /application Retrieve URIs to collections of applications
ApplicationBinariesApi DeleteBinaryApplicationContentResourceById DELETE /application/applications/{id}/binaries/{binaryId} Delete a specific application attachment
ApplicationBinariesApi GetBinaryApplicationContentResource GET /application/applications/{id}/binaries Retrieve all application attachments
ApplicationBinariesApi GetBinaryApplicationContentResourceById GET /application/applications/{id}/binaries/{binaryId} Retrieve a specific application attachment
ApplicationBinariesApi PostBinaryApplicationContentResource POST /application/applications/{id}/binaries Upload an application attachment
ApplicationVersionsApi DeleteApplicationVersionResource DELETE /application/applications/{id}/versions Delete a specific version of an application
ApplicationVersionsApi GetApplicationVersionCollectionResource GET /application/applications/{id}/versions Retrieve all versions of an application
ApplicationVersionsApi GetApplicationVersionResource GET /application/applications/{id}/versions?version=1.0 Retrieve a specific version of an application
ApplicationVersionsApi PostApplicationVersionResource POST /application/applications/{id}/versions Create an application version
ApplicationVersionsApi PutApplicationVersionResource PUT /application/applications/{id}/versions/{version} Replace an application version's tags
ApplicationsApi DeleteApplicationResource DELETE /application/applications/{id} Delete an application
ApplicationsApi GetAbstractApplicationCollectionResource GET /application/applications Retrieve all applications
ApplicationsApi GetApplicationResource GET /application/applications/{id} Retrieve a specific application
ApplicationsApi GetApplicationsByNameCollectionResource GET /application/applicationsByName/{name} Retrieve applications by name
ApplicationsApi GetApplicationsByOwnerCollectionResource GET /application/applicationsByOwner/{tenantId} Retrieve applications by owner
ApplicationsApi GetApplicationsByTenantCollectionResource GET /application/applicationsByTenant/{tenantId} Retrieve applications by tenant
ApplicationsApi GetApplicationsByUserCollectionResource GET /application/applicationsByUser/{username} Retrieve applications by user
ApplicationsApi PostApplicationCollectionResource POST /application/applications Create an application
ApplicationsApi PostApplicationResource POST /application/applications/{id}/clone Copy an application
ApplicationsApi PutApplicationResource PUT /application/applications/{id} Update a specific application
AttachmentsApi DeleteEventBinaryResource DELETE /event/events/{id}/binaries Remove the attached file from a specific event
AttachmentsApi GetEventBinaryResource GET /event/events/{id}/binaries Retrieve the attached file of a specific event
AttachmentsApi PostEventBinaryResource POST /event/events/{id}/binaries Attach a file to a specific event
AttachmentsApi PutEventBinaryResource PUT /event/events/{id}/binaries Replace the attached file of a specific event
AuditAPIApi GetAuditApiResource GET /audit Retrieve URIs to collections of audits
AuditsApi GetAuditRecordCollectionResource GET /audit/auditRecords Retrieve all audit records
AuditsApi GetAuditRecordResource GET /audit/auditRecords/{id} Retrieve a specific audit record
AuditsApi PostAuditRecordCollectionResource POST /audit/auditRecords Create an audit record
BinariesApi DeleteBinariesResource DELETE /inventory/binaries/{id} Remove a stored file
BinariesApi GetBinariesCollectionResource GET /inventory/binaries Retrieve the stored files
BinariesApi GetBinariesResource GET /inventory/binaries/{id} Retrieve a stored file
BinariesApi PostBinariesCollectionResource POST /inventory/binaries Upload a file
BinariesApi PutBinariesResource PUT /inventory/binaries/{id} Replace a file
BootstrapUserApi GetApplicationUserRepresentation GET /application/applications/{id}/bootstrapUser Retrieve the bootstrap user for a specific application
BulkOperationsApi DeleteBulkOperationResource DELETE /devicecontrol/bulkoperations/{id} Delete a specific bulk operation
BulkOperationsApi GetBulkOperationCollectionResource GET /devicecontrol/bulkoperations Retrieve a list of bulk operations
BulkOperationsApi GetBulkOperationResource GET /devicecontrol/bulkoperations/{id} Retrieve a specific bulk operation
BulkOperationsApi PostBulkOperationCollectionResource POST /devicecontrol/bulkoperations Create a bulk operation
BulkOperationsApi PutBulkOperationResource PUT /devicecontrol/bulkoperations/{id} Update a specific bulk operation
ChildOperationsApi DeleteManagedObjectChildAdditionResource DELETE /inventory/managedObjects/{id}/childAdditions/{childId} Remove a specific child addition from its parent
ChildOperationsApi DeleteManagedObjectChildAdditionResourceMultiple DELETE /inventory/managedObjects/{id}/childAdditions Remove specific child additions from its parent
ChildOperationsApi DeleteManagedObjectChildAssetResource DELETE /inventory/managedObjects/{id}/childAssets/{childId} Remove a specific child asset from its parent
ChildOperationsApi DeleteManagedObjectChildAssetResourceMultiple DELETE /inventory/managedObjects/{id}/childAssets Remove specific child assets from its parent
ChildOperationsApi DeleteManagedObjectChildDeviceResource DELETE /inventory/managedObjects/{id}/childDevices/{childId} Remove a specific child device from its parent
ChildOperationsApi DeleteManagedObjectChildDeviceResourceMultiple DELETE /inventory/managedObjects/{id}/childDevices Remove specific child devices from its parent
ChildOperationsApi GetManagedObjectChildAdditionResource GET /inventory/managedObjects/{id}/childAdditions/{childId} Retrieve a specific child addition of a specific managed object
ChildOperationsApi GetManagedObjectChildAdditionsResource GET /inventory/managedObjects/{id}/childAdditions Retrieve all child additions of a specific managed object
ChildOperationsApi GetManagedObjectChildAssetResource GET /inventory/managedObjects/{id}/childAssets/{childId} Retrieve a specific child asset of a specific managed object
ChildOperationsApi GetManagedObjectChildAssetsResource GET /inventory/managedObjects/{id}/childAssets Retrieve all child assets of a specific managed object
ChildOperationsApi GetManagedObjectChildDeviceResource GET /inventory/managedObjects/{id}/childDevices/{childId} Retrieve a specific child device of a specific managed object
ChildOperationsApi GetManagedObjectChildDevicesResource GET /inventory/managedObjects/{id}/childDevices Retrieve all child devices of a specific managed object
ChildOperationsApi PostManagedObjectChildAdditionsResource POST /inventory/managedObjects/{id}/childAdditions Assign a managed object as child addition
ChildOperationsApi PostManagedObjectChildAssetsResource POST /inventory/managedObjects/{id}/childAssets Assign a managed object as child asset
ChildOperationsApi PostManagedObjectChildDevicesResource POST /inventory/managedObjects/{id}/childDevices Assign a managed object as child device
CurrentApplicationApi GetApplicationUserCollectionRepresentation GET /application/currentApplication/subscriptions Retrieve the subscribed users of the current application
CurrentApplicationApi GetCurrentApplicationResource GET /application/currentApplication Retrieve the current application
CurrentApplicationApi GetCurrentApplicationResourceSettings GET /application/currentApplication/settings Retrieve the current application settings
CurrentApplicationApi PutCurrentApplicationResource PUT /application/currentApplication Update the current application
CurrentUserApi GetCurrentUserResource GET /user/currentUser Retrieve the current user
CurrentUserApi GetCurrentUserTfaTotpResourceActivity GET /user/currentUser/totpSecret/activity Returns the activation state of the two-factor authentication feature.
CurrentUserApi PostCurrentUserTfaTotpResource POST /user/currentUser/totpSecret Generate secret to set up TFA
CurrentUserApi PostCurrentUserTfaTotpResourceActivity POST /user/currentUser/totpSecret/activity Activates or deactivates the two-factor authentication feature
CurrentUserApi PostCurrentUserTfaTotpResourceVerify POST /user/currentUser/totpSecret/verify Verify TFA code
CurrentUserApi PutCurrentUserPasswordResource PUT /user/currentUser/password Update the current user's password
CurrentUserApi PutCurrentUserResource PUT /user/currentUser Update the current user
DeviceControlAPIApi GetDeviceControlApiResource GET /devicecontrol Retrieve URIs to collections of operations
DeviceCredentialsApi PostBulkNewDeviceRequestCollectionResource POST /devicecontrol/bulkNewDeviceRequests Create a bulk device credentials request
DeviceCredentialsApi PostDeviceCredentialsCollectionResource POST /devicecontrol/deviceCredentials Create device credentials
DevicePermissionsApi GetDevicePermissionsResource GET /user/devicePermissions/{id} Returns all device permissions assignments
DevicePermissionsApi PutDevicePermissionsResource PUT /user/devicePermissions/{id} Updates the device permissions assignments
DeviceStatisticsApi GetTenantDeviceStatisticsDailyCollection GET /tenant/statistics/device/{tenantId}/daily/{date} Retrieve daily device statistics
DeviceStatisticsApi GetTenantDeviceStatisticsMonthlyCollection GET /tenant/statistics/device/{tenantId}/monthly/{date} Retrieve monthly device statistics
EventAPIApi GetEventsApiResource GET /event Retrieve URIs to collections of events
EventsApi DeleteEventCollectionResource DELETE /event/events Remove event collections
EventsApi DeleteEventResource DELETE /event/events/{id} Remove a specific event
EventsApi GetEventCollectionResource GET /event/events Retrieve all events
EventsApi GetEventResource GET /event/events/{id} Retrieve a specific event
EventsApi PostEventCollectionResource POST /event/events Create an event
EventsApi PutEventResource PUT /event/events/{id} Update a specific event
ExternalIDsApi DeleteExternalIDResource DELETE /identity/externalIds/{type}/{externalId} Remove a specific external ID
ExternalIDsApi GetExternalIDCollectionResource GET /identity/globalIds/{id}/externalIds Retrieve all external IDs of a specific managed object
ExternalIDsApi GetExternalIDResource GET /identity/externalIds/{type}/{externalId} Retrieve a specific external ID
ExternalIDsApi PostExternalIDCollectionResource POST /identity/globalIds/{id}/externalIds Create an external ID
GroupsApi DeleteGroupByIdResource DELETE /user/{tenantId}/groups/{groupId} Delete a specific user group for a specific tenant
GroupsApi GetGroupByIdResource GET /user/{tenantId}/groups/{groupId} Retrieve a specific user group for a specific tenant
GroupsApi GetGroupByNameResource GET /user/{tenantId}/groupByName/{groupName} Retrieve a user group by group name for a specific tenant
GroupsApi GetGroupCollectionResource GET /user/{tenantId}/groups Retrieve all user groups of a specific tenant
GroupsApi GetGroupReferenceCollectionResource GET /user/{tenantId}/users/{userId}/groups Get all user groups for specific user in a specific tenant
GroupsApi PostGroupCollectionResource POST /user/{tenantId}/groups Create a user group for a specific tenant
GroupsApi PutGroupByIdResource PUT /user/{tenantId}/groups/{groupId} Update a specific user group for a specific tenant
IdentityAPIApi GetIdentityApiResource GET /identity Retrieve URIs to collections of external IDs
InventoryAPIApi GetInventoryApiResource GET /inventory Retrieve URIs to collections of managed objects
InventoryRolesApi DeleteInventoryAssignmentResourceById DELETE /user/{tenantId}/users/{userId}/roles/inventory/{id} Remove a specific inventory role assigned to a user
InventoryRolesApi DeleteInventoryRoleResourceId DELETE /user/inventoryroles/{id} Remove a specific inventory role
InventoryRolesApi GetInventoryAssignmentResource GET /user/{tenantId}/users/{userId}/roles/inventory Retrieve all inventory roles assigned to a user
InventoryRolesApi GetInventoryAssignmentResourceById GET /user/{tenantId}/users/{userId}/roles/inventory/{id} Retrieve a specific inventory role assigned to a user
InventoryRolesApi GetInventoryRoleResource GET /user/inventoryroles Retrieve all inventory roles
InventoryRolesApi GetInventoryRoleResourceId GET /user/inventoryroles/{id} Retrieve a specific inventory role
InventoryRolesApi PostInventoryAssignmentResource POST /user/{tenantId}/users/{userId}/roles/inventory Assign an inventory role to a user
InventoryRolesApi PostInventoryRoleResource POST /user/inventoryroles Create an inventory role
InventoryRolesApi PutInventoryAssignmentResourceById PUT /user/{tenantId}/users/{userId}/roles/inventory/{id} Update a specific inventory role assigned to a user
InventoryRolesApi PutInventoryRoleResourceId PUT /user/inventoryroles/{id} Update a specific inventory role
LoginOptionsApi GetLoginOptionCollectionResource GET /tenant/loginOptions Retrieve the login options
LoginOptionsApi PostLoginOptionCollectionResource POST /tenant/loginOptions Create a login option
LoginOptionsApi PutAccessLoginOptionResource PUT /tenant/loginOptions/{type_or_id}/restrict Update a tenant's access to the login option
LoginTokensApi PostLoginFormBody POST /tenant/oauth/token Obtain an access token
LoginTokensApi PostLoginFormCookie POST /tenant/oauth Obtain access tokens in cookies
ManagedObjectsApi DeleteManagedObjectResource DELETE /inventory/managedObjects/{id} Remove a specific managed object
ManagedObjectsApi GetLastAvailabilityManagedObjectResource GET /inventory/managedObjects/{id}/availability Retrieve the latest availability date of a specific managed object
ManagedObjectsApi GetManagedObjectCollectionResource GET /inventory/managedObjects Retrieve all managed objects
ManagedObjectsApi GetManagedObjectResource GET /inventory/managedObjects/{id} Retrieve a specific managed object
ManagedObjectsApi GetManagedObjectUserResource GET /inventory/managedObjects/{id}/user Retrieve the username and state of a specific managed object
ManagedObjectsApi GetSupportedMeasurementsManagedObjectResource GET /inventory/managedObjects/{id}/supportedMeasurements Retrieve all supported measurement fragments of a specific managed object
ManagedObjectsApi GetSupportedSeriesManagedObjectResource GET /inventory/managedObjects/{id}/supportedSeries Retrieve all supported measurement fragments and series of a specific managed object
ManagedObjectsApi PostManagedObjectCollectionResource POST /inventory/managedObjects Create a managed object
ManagedObjectsApi PutManagedObjectResource PUT /inventory/managedObjects/{id} Update a specific managed object
ManagedObjectsApi PutManagedObjectUserResource PUT /inventory/managedObjects/{id}/user Update the user's details of a specific managed object
MeasurementAPIApi GetMeasurementApiResource GET /measurement Retrieve URIs to collections of measurements
MeasurementsApi DeleteMeasurementCollectionResource DELETE /measurement/measurements Remove measurement collections
MeasurementsApi DeleteMeasurementResource DELETE /measurement/measurements/{id} Remove a specific measurement
MeasurementsApi GetMeasurementCollectionResource GET /measurement/measurements Retrieve all measurements
MeasurementsApi GetMeasurementResource GET /measurement/measurements/{id} Retrieve a specific measurement
MeasurementsApi GetMeasurementSeriesResource GET /measurement/measurements/series Retrieve a list of series and their values
MeasurementsApi PostMeasurementCollectionResource POST /measurement/measurements Create a measurement
NewDeviceRequestsApi DeleteNewDeviceRequestResource DELETE /devicecontrol/newDeviceRequests/{requestId} Delete a specific new device request
NewDeviceRequestsApi GetNewDeviceRequestCollectionResource GET /devicecontrol/newDeviceRequests Retrieve a list of new device requests
NewDeviceRequestsApi GetNewDeviceRequestResource GET /devicecontrol/newDeviceRequests/{requestId} Retrieve a specific new device request
NewDeviceRequestsApi PostNewDeviceRequestCollectionResource POST /devicecontrol/newDeviceRequests Create a new device request
NewDeviceRequestsApi PutNewDeviceRequestResource PUT /devicecontrol/newDeviceRequests/{requestId} Update a specific new device request status
Notification20APIApi GetNotificationApiResource GET /notification2 Retrieve URIs to collections of notification subscriptions
OperationsApi DeleteOperationCollectionResource DELETE /devicecontrol/operations Delete a list of operations
OperationsApi GetOperationCollectionResource GET /devicecontrol/operations Retrieve a list of operations
OperationsApi GetOperationResource GET /devicecontrol/operations/{id} Retrieve a specific operation
OperationsApi PostOperationCollectionResource POST /devicecontrol/operations Create an operation
OperationsApi PutOperationResource PUT /devicecontrol/operations/{id} Update a specific operation status
OptionsApi DeleteOptionResource DELETE /tenant/options/{category}/{key} Remove a specific option
OptionsApi GetCategoryOptionResource GET /tenant/options/{category} Retrieve all options by category
OptionsApi GetOptionCollectionResource GET /tenant/options Retrieve all options
OptionsApi GetOptionResource GET /tenant/options/{category}/{key} Retrieve a specific option
OptionsApi PostOptionCollectionResource POST /tenant/options Create an option
OptionsApi PutCategoryOptionResource PUT /tenant/options/{category} Update options by category
OptionsApi PutOptionResource PUT /tenant/options/{category}/{key} Update a specific option
PlatformAPIApi GetPlatformApiResource GET /platform Retrieve URIs to collection platform objects
RealTimeNotificationAPIApi PostNotificationRealtimeResource POST /notification/realtime Responsive communication
RetentionRulesApi DeleteRetentionRuleResource DELETE /retention/retentions/{id} Remove a retention rule
RetentionRulesApi GetRetentionRuleCollectionResource GET /retention/retentions Retrieve all retention rules
RetentionRulesApi GetRetentionRuleResource GET /retention/retentions/{id} Retrieve a retention rule
RetentionRulesApi PostRetentionRuleCollectionResource POST /retention/retentions Create a retention rule
RetentionRulesApi PutRetentionRuleResource PUT /retention/retentions/{id} Update a retention rule
RolesApi DeleteGroupRoleReferenceResource DELETE /user/{tenantId}/groups/{groupId}/roles/{roleId} Unassign a specific role for a specific user group in a specific tenant
RolesApi DeleteUserRoleReferenceResource DELETE /user/{tenantId}/users/{userId}/roles/{roleId} Unassign a specific role from a specific user in a specific tenant
RolesApi GetGroupsRoleReferenceCollectionResource GET /user/{tenantId}/groups/{groupId}/roles Retrieve all roles assigned to a specific user group in a specific tenant
RolesApi GetRoleCollectionResource GET /user/roles Retrieve all user roles
RolesApi GetRoleCollectionResourceByName GET /user/roles/{name} Retrieve a user role by name
RolesApi PostGroupsRoleReferenceCollectionResource POST /user/{tenantId}/groups/{groupId}/roles Assign a role to a specific user group in a specific tenant
RolesApi PostUsersRoleReferenceCollectionResource POST /user/{tenantId}/users/{userId}/roles Assign a role to specific user in a specific tenant
SubscriptionsApi DeleteNotificationSubscriptionBySourceResource DELETE /notification2/subscriptions Remove subscriptions by source
SubscriptionsApi DeleteNotificationSubscriptionResource DELETE /notification2/subscriptions/{id} Remove a specific subscription
SubscriptionsApi GetNotificationSubscriptionCollectionResource GET /notification2/subscriptions Retrieve all subscriptions
SubscriptionsApi GetNotificationSubscriptionResource GET /notification2/subscriptions/{id} Retrieve a specific subscription
SubscriptionsApi PostNotificationSubscriptionResource POST /notification2/subscriptions Create a subscription
SystemOptionsApi GetSystemOptionCollectionResource GET /tenant/system/options Retrieve all system options
SystemOptionsApi GetSystemOptionResource GET /tenant/system/options/{category}/{key} Retrieve a specific system option
TenantAPIApi GetTenantsApiResource GET /tenant Retrieve URIs to collections of tenants
TenantApplicationsApi DeleteTenantApplicationReferenceResource DELETE /tenant/tenants/{tenantId}/applications/{applicationId} Unsubscribe from an application
TenantApplicationsApi GetTenantApplicationReferenceCollectionResource GET /tenant/tenants/{tenantId}/applications Retrieve subscribed applications
TenantApplicationsApi PostTenantApplicationReferenceCollectionResource POST /tenant/tenants/{tenantId}/applications Subscribe to an application
TenantsApi DeleteTenantResource DELETE /tenant/tenants/{tenantId} Remove a specific tenant
TenantsApi GetCurrentTenantResource GET /tenant/currentTenant Retrieve the current tenant
TenantsApi GetTenantCollectionResource GET /tenant/tenants Retrieve all subtenants
TenantsApi GetTenantResource GET /tenant/tenants/{tenantId} Retrieve a specific tenant
TenantsApi GetTenantsTfaResourceTfa GET /tenant/tenants/{tenantId}/tfa Retrieve TFA settings of a specific tenant
TenantsApi PostTenantCollectionResource POST /tenant/tenants Create a tenant
TenantsApi PutTenantResource PUT /tenant/tenants/{tenantId} Update a specific tenant
TokensApi PostNotificationTokenResource POST /notification2/token Create a notification token
TokensApi PostNotificationTokenUnsubscribeResource POST /notification2/unsubscribe Unsubscribe a subscriber
TrustedCertificatesApi DeleteTrustedCertificateResource DELETE /tenant/tenants/{tenantId}/trusted-certificates/{fingerprint} Remove a stored certificate
TrustedCertificatesApi GetTrustedCertificateCollectionResource GET /tenant/tenants/{tenantId}/trusted-certificates Retrieve all stored certificates
TrustedCertificatesApi GetTrustedCertificateResource GET /tenant/tenants/{tenantId}/trusted-certificates/{fingerprint} Retrieve a stored certificate
TrustedCertificatesApi PostConfirmedTrustedCertificatePopResource POST /tenant/tenants/{tenantId}/trusted-certificates-pop/{fingerprint}/confirmed Confirm an already uploaded certificate
TrustedCertificatesApi PostTrustedCertificateCollectionResource POST /tenant/tenants/{tenantId}/trusted-certificates Add a new certificate
TrustedCertificatesApi PostTrustedCertificateCollectionResourceBulk POST /tenant/tenants/{tenantId}/trusted-certificates/bulk Add multiple certificates
TrustedCertificatesApi PostTrustedCertificatePopResource POST /tenant/tenants/{tenantId}/trusted-certificates-pop/{fingerprint}/pop Provide the proof of possession for an already uploaded certificate
TrustedCertificatesApi PostVerificationCodeTrustedCertificatesPopResource POST /tenant/tenants/{tenantId}/trusted-certificates-pop/{fingerprint}/verification-code Generate a verification code for the proof of possession operation for the given certificate
TrustedCertificatesApi PutTrustedCertificateResource PUT /tenant/tenants/{tenantId}/trusted-certificates/{fingerprint} Update a stored certificate
UsageStatisticsApi GetSummaryAllTenantsUsageStatistics GET /tenant/statistics/allTenantsSummary Retrieve a summary of all usage statistics
UsageStatisticsApi GetSummaryUsageStatistics GET /tenant/statistics/summary Retrieve a usage statistics summary
UsageStatisticsApi GetTenantUsageStatisticsCollectionResource GET /tenant/statistics Retrieve statistics of the current tenant
UsageStatisticsApi GetTenantUsageStatisticsFileById GET /tenant/statistics/files/{id} Retrieve a usage statistics file
UsageStatisticsApi GetTenantUsageStatisticsFileCollectionResource GET /tenant/statistics/files Retrieve usage statistics files metadata
UsageStatisticsApi GetTenantUsageStatisticsLatestFile GET /tenant/statistics/files/latest/{month} Retrieve the latest usage statistics file
UsageStatisticsApi PostGenerateStatisticsFileRequest POST /tenant/statistics/files Generate a statistics file report
UserAPIApi GetUserApiResource GET /user Retrieve URIs to collections of users, groups and roles
UsersApi DeleteUserReferenceResource DELETE /user/{tenantId}/groups/{groupId}/users/{userId} Remove a specific user from a specific user group of a specific tenant
UsersApi DeleteUserResource DELETE /user/{tenantId}/users/{userId} Delete a specific user for a specific tenant
UsersApi GetUserCollectionResource GET /user/{tenantId}/users Retrieve all users for a specific tenant
UsersApi GetUserReferenceCollectionResource GET /user/{tenantId}/groups/{groupId}/users Retrieve the users of a specific user group of a specific tenant
UsersApi GetUserResource GET /user/{tenantId}/users/{userId} Retrieve a specific user for a specific tenant
UsersApi GetUsersByNameResource GET /user/{tenantId}/userByName/{username} Retrieve a user by username in a specific tenant
UsersApi GetUsersTfaResource GET /user/{tenantId}/users/{userId}/tfa Retrieve the TFA settings of a specific user
UsersApi PostLogoutUser POST /user/logout Terminate a user's session
UsersApi PostUserCollectionResource POST /user/{tenantId}/users Create a user for a specific tenant
UsersApi PostUserReferenceCollectionResource POST /user/{tenantId}/groups/{groupId}/users Add a user to a specific user group of a specific tenant
UsersApi PutUserChangePasswordResource PUT /user/{tenantId}/users/{userId}/password Update a specific user's password of a specific tenant
UsersApi PutUserResource PUT /user/{tenantId}/users/{userId} Update a specific user for a specific tenant

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Basic

  • Type: HTTP basic authentication

OAI-Secure

  • Type: Bearer Authentication

SSO

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

JWT

  • Type: Bearer Authentication

About

Generated .net C# client for Cumulocity Cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages