Skip to content

Latest commit

 

History

History
285 lines (255 loc) · 22.4 KB

README.md

File metadata and controls

285 lines (255 loc) · 22.4 KB

Agravity.Public - the C# library for the Agravity OpenAPI Documentation - Public Functions

Agravity API Reference

This is the public API description of Agravity GmbH.

Resources

  • Collection type management
  • Collections management
  • Assets management
  • Assets operations
  • Assets publishing
  • Collection Sharing (consume share)
  • Secure Upload (validate + upload file)
  • Download ZIP
  • Search
  • General management

Operations

Agravity API performs the following operations:
  • List / get single collection types
  • List / get single collections
  • List / get single assets
  • Operations on assets like: blobs, rotate, resize, similar, collections, customfields, download
  • List / get single published asset
  • Search for assets or collections
  • Get version of deployment

API key is needed to access these endpoints.

Copyright © Agravity GmbH 2025. All Rights Reserved

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

  • API version: 8.4.2
  • SDK version: 8.4.2
  • Generator version: 7.8.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://agravity.io

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

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

Generate the DLL using your preferred tool (e.g. dotnet build)

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

using Agravity.Public.Api;
using Agravity.Public.Client;
using Agravity.Public.Model;

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 Agravity.Public.Api;
using Agravity.Public.Client;
using Agravity.Public.Model;

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

            Configuration config = new Configuration();
            config.BasePath = "http://localhost:7072/api";
            // Configure API key authorization: function_key
            config.ApiKey.Add("x-functions-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.ApiKeyPrefix.Add("x-functions-key", "Bearer");

            var apiInstance = new PublicAssetManagementApi(config);
            var acceptLanguage = "acceptLanguage_example";  // string | The requested language of the response. If not matching it falls back to default language. (optional) 
            var name = "name_example";  // string |  (optional) 
            var collectionid = "collectionid_example";  // string |  (optional) 
            var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt"));  // System.IO.Stream |  (optional) 
            var filename = "filename_example";  // string |  (optional) 
            var previewof = "previewof_example";  // string |  (optional) 

            try
            {
                Asset result = apiInstance.HttpAssetUploadFile(acceptLanguage, name, collectionid, file, filename, previewof);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling PublicAssetManagementApi.HttpAssetUploadFile: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://localhost:7072/api

Class Method HTTP request Description
PublicAssetManagementApi HttpAssetUploadFile POST /assetsupload
PublicAssetManagementApi HttpAssetsCreate POST /assets
PublicAssetManagementApi HttpAssetsGet GET /assets
PublicAssetManagementApi HttpAssetsGetById GET /assets/{id}
PublicAssetManagementApi HttpPublicAssetsUpdateById POST /assets/{id}
PublicAssetOperationsApi HttpAssetImageEdit GET /assets/{id}/imageedit
PublicAssetOperationsApi HttpAssetResize GET /assets/{id}/resize
PublicAssetOperationsApi HttpAssetToCollection POST /assets/{id}/tocollection
PublicAssetOperationsApi HttpGetAssetBlob GET /assets/{id}/blobs
PublicAssetOperationsApi HttpGetAssetCollectionsById GET /assets/{id}/collections
PublicAssetOperationsApi HttpGetAssetDownload GET /assets/{id}/download
PublicAssetOperationsApi HttpGetSharedAssetBlob GET /assets/{id}/blob
PublicAssetOperationsApi HttpImageDynamicEdit POST /assets/{id}/imageedit
PublicAssetOperationsApi HttpImageDynamicGetFromDownloadId GET /assets/{id}/imageedit/{download_format_id}
PublicAssetOperationsApi HttpPutAssetAvailability PUT /assets/{id}/availability
PublicAssetPublishingApi HttpPublishedAssetsCreate POST /assets/{id}/publish
PublicAssetPublishingApi HttpPublishedAssetsGet GET /assets/{id}/publish
PublicAssetPublishingApi HttpPublishedAssetsGetById GET /assets/{id}/publish/{pid}
PublicAssetVersioningApi HttpAssetCreateUploadVersion POST /assets/{id}/versionsupload
PublicAssetVersioningApi HttpAssetCreateVersion POST /assets/{id}/versions
PublicAssetVersioningApi HttpDeleteVersionedAssetsById DELETE /assets/{id}/versions/{vNr}
PublicAssetVersioningApi HttpGetVersionedAssetBlobById GET /assets/{id}/versions/{vNr}/blobs
PublicAssetVersioningApi HttpRestoreVersionedAssetsById POST /assets/{id}/versions/{vNr}/restore
PublicAssetVersioningApi HttpUpdateVersionedAssetsById POST /assets/{id}/versions/{vNr}
PublicAssetVersioningApi HttpVersionedAssetsGet GET /assets/{id}/versions
PublicAuthenticationManagementApi HttpAuthGetContainerWriteSasToken GET /auth/containerwrite/{containerName}
PublicAuthenticationManagementApi HttpAuthGetInboxContainerWriteSasToken GET /auth/inbox
PublicCollectionManagementApi HttpCollectionsCreate POST /collections
PublicCollectionManagementApi HttpCollectionsGet GET /collections
PublicCollectionManagementApi HttpCollectionsGetById GET /collections/{id}
PublicCollectionManagementApi HttpCollectionsGetDescendantsTreeOfId GET /collections/{id}/descendants
PublicCollectionManagementApi HttpCollectionsGetTreeAncestorsOfId GET /collections/{id}/ancestors
PublicCollectionManagementApi HttpGetCollectionPreviewsById GET /collections/{id}/previews
PublicCollectionManagementApi HttpPublicCollectionsDeleteById DELETE /collections/{id}
PublicCollectionManagementApi HttpPublicCollectionsUpdateById POST /collections/{id}
PublicCollectionSecureUploadApi HttpSecureUploadEntityCheckById GET /secureupload/{id}
PublicCollectionSecureUploadApi HttpSecureUploadFileById POST /secureupload/{id}/upload
PublicCollectionTypeManagementApi HttpCollectionTypesGet GET /collectiontypes
PublicCollectionTypeManagementApi HttpCollectionTypesGetById GET /collectiontypes/{id}
PublicCollectionTypeManagementApi HttpGetCollectionTypeItems GET /collectiontypesitems
PublicConfigurationManagementApi HttpConfigGetFrontendAll GET /config/frontend
PublicDownloadFormatManagementApi HttpDownloadFormatsGetAll GET /downloadformats
PublicDownloadFormatManagementApi HttpDownloadFormatsGetAllFromShared GET /downloadformats-shared
PublicEndpointsApi HttpAssetGetViewForPortal GET /public/view
PublicGeneralManagementApi HttpAgravityVersionInfo GET /version
PublicGeneralManagementApi HttpGetDeletedEntities GET /deleted
PublicGeneralManagementApi HttpTriggerDurableContinue GET /durable/{instanceId}
PublicGeneralManagementApi HttpTriggerDurableScchTrainingDone GET /durable/scch/{instanceId}
PublicHelperToolsApi HttpGetAllUserDefinedLists GET /helper/userdefinedlists
PublicHelperToolsApi HttpGetAllowedFilterableItems GET /helper/filterableitems
PublicHelperToolsApi HttpGetAllowedSearchableItemNames GET /helper/searchableitemnames
PublicHelperToolsApi HttpGetAllowedSearchableItems GET /helper/searchableitems
PublicHelperToolsApi HttpPatchUpdateCachedUserDefinedLists PATCH /helper/userdefinedlists
PublicPortalManagementApi HttpPortalGetAllAssetIdsById GET /portals/{id}/assetids
PublicPortalManagementApi HttpPortalGetStatusZipById GET /portals/{id}/zip/{zipId}
PublicPortalManagementApi HttpPortalRequestZipById POST /portals/{id}/zip
PublicPortalManagementApi HttpPortalsConfigurationGetById GET /portals/{id}/config
PublicPortalManagementApi HttpPortalsEnhanceToken POST /portalsenhancetoken
PublicPortalManagementApi HttpPortalsGetById GET /portals/{id}
PublicPortalManagementApi HttpPortalsSavePortalUserAttributes POST /portalssaveuserattributes
PublicPublishingApi HttpPublishedAssetsGetAll GET /publish
PublicSavedSearchApi HttpSavedSearchesGetAll GET /savedsearches
PublicSearchManagementApi HttpGetSearchFacetteByName GET /search/facette
PublicSearchManagementApi HttpGlobalSearch GET /search
PublicSearchManagementApi HttpSearchAdminGetStatus GET /searchadmin/status
PublicSharingManagementApi HttpQuickShareGetById GET /quickshares/{id}
PublicSharingManagementApi HttpSharedCollectionsGetById GET /shared/{id}
PublicSharingManagementApi HttpSharedCollectionsGetStatusZipById GET /shared/{id}/zip/{zipId}
PublicSharingManagementApi HttpSharedCollectionsRequestZipById POST /shared/{id}/zip
PublicSignalRConnectionManagementApi HttpSignalRNegotiate POST /signalr/negotiate
PublicStaticDefinedListManagementApi HttpStaticDefinedListsGetAll GET /staticdefinedlists
PublicStaticDefinedListManagementApi HttpStaticDefinedListsGetById GET /staticdefinedlists/{id}
PublicStaticDefinedListManagementApi HttpStaticDefinedListsUpdateById POST /staticdefinedlists/{id}
PublicTranslationManagementApi HttpTranslationsById GET /translations/{id}
PublicTranslationManagementApi HttpTranslationsByIdFilterByCustomField GET /translations/{id}/custom/{customField}
PublicTranslationManagementApi HttpTranslationsByIdFilterByProperty GET /translations/{id}/{property}
PublicWebAppDataApi HttpGetDataCollectionType GET /data/collectiontype/{id}
PublicWebAppDataApi HttpGetWebAppData GET /webappdata/{id}
PublicWorkspaceManagementApi HttpWorkspacesGet GET /workspaces
PublicWorkspaceManagementApi HttpWorkspacesGetById GET /workspaces/{id}

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

function_key

  • Type: API key
  • API key parameter name: x-functions-key
  • Location: HTTP header