Skip to content

C# JSON client-side library that defines the C#classes that can be (de)serialized to/from JSON. This is useful for accessing the REST endpoints that are published by the madana-api, but only those that produce a JSON representation of their resources (content type "application/json").

Notifications You must be signed in to change notification settings

MADANA-IO/madana-apiclient-csharp

Repository files navigation

Com.Madana.APIClient - the C# library for the madana-api

Using the madana-api

This documentation contains a Quickstart Guide, relating client functionality and information about the available endpoints and used datamodels.

The madana-api and its implementations are still in heavy development. This means that there may be problems in our protocols, or there may be mistakes in our implementations. We take security vulnerabilities very seriously. If you discover a security issue, please bring it to our attention right away! If you find a vulnerability that may affect live deployments - - for example, by exposing a remote execution exploit - - please send your report privately to info@madana.io. Please DO NOT file a public issue. If the issue is a protocol weakness that cannot be immediately exploited or something not yet deployed, just discuss it openly


Note: Not all functionality might be acessible without having accquired and api-license token. For more information visit www.madana.io


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

  • API version: 0.5.0-master.56
  • SDK version: 1.0.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

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

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

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 Com.Madana.APIClient.Api;
using Com.Madana.APIClient.Client;
using Com.Madana.APIClient.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 Com.Madana.APIClient.csproj

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

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Com.Madana.APIClient.Api;
using Com.Madana.APIClient.Client;
using Com.Madana.APIClient.Model;

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

            Configuration.Default.BasePath = "http://api.madana.io/rest";
            var apiInstance = new AccountServiceApi(Configuration.Default);
            var token = token_example;  // string | 

            try
            {
                System.IO.Stream result = apiInstance.ActivateUser(token);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AccountServiceApi.ActivateUser: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://api.madana.io/rest

Class Method HTTP request Description
AccountServiceApi ActivateUser GET /account/activation/{token}
AccountServiceApi CreatePasswordReset POST /account/password Sends an Password reset mail to the given MailAddress.
AccountServiceApi RequestVerificationMail GET /account/verifymail Used to request a new activation-mail for the user.
AccountServiceApi UpdatePassword PUT /account/password Receives the Password reset and tries to set the provided password for the user.
AuthenticationServiceApi AuthenticateApplication POST /authentication/application Authenticates a new application and returns the token.
AuthenticationServiceApi AuthenticateEthereumWallet POST /authentication/ethereum/{wallet}
AuthenticationServiceApi AuthenticateUser POST /authentication Authenticates a new user and returns the token ( forbidden if the credentials cannot be validated ).
AuthenticationServiceApi AuthenticateWithEthereumChallenge POST /authentication/ethereum/{wallet}/challenge
AuthenticationServiceApi GetFractalAuthenticationURL GET /authentication/fractal Returns the AUthorization URL to verify a Twitter Accounts.
AuthenticationServiceApi GetNonceForEthereumWallet GET /authentication/ethereum/{wallet} Returns a nonce for the client which is used as content for the to be created signature.
AuthenticationServiceApi GetObject GET /authentication Used to validate the active connection with the API.
AuthenticationServiceApi GetTwitterAuthenticationURL GET /authentication/twitter Returns the AUthorization URL to verify a Twitter Accounts.
AuthenticationServiceApi SetFacebookUID POST /authentication/facebook Used as Callback URL when users have successfully authorized their facbeook account.
AuthenticationServiceApi SetFractalUID POST /authentication/fractal
AuthenticationServiceApi SetTwitterUID POST /authentication/twitter
CertificateServiceApi AuthenticateCertificate POST /certificates Issues certificates for logged-in users.
CertificateServiceApi GetCertificateByFingerprint GET /certificates/{fingerprint}
CertificateServiceApi GetRootCertificate GET /certificates/root
DataCollectionServiceApi GetMethodsForType GET /datacollection/types/{name}/methods
DataCollectionServiceApi GetNodes GET /datacollection/methods
DataCollectionServiceApi GetTypes GET /datacollection/types
EnclaveServiceApi AddHistory POST /enclaves/{uuid}/history
EnclaveServiceApi ApproveEnclave POST /enclaves/{uuid}/approval
EnclaveServiceApi AssignEnclaveAgent POST /enclaves/{uuid}/assign
EnclaveServiceApi AttestateEnclave POST /enclaves/{uuid}/attestation
EnclaveServiceApi CreateEnclaveRunRequest POST /enclaves
EnclaveServiceApi GetEnclave GET /enclaves/{uuid}
EnclaveServiceApi GetEnclaveTypes GET /enclaves/types
EnclaveServiceApi GetEnclaves GET /enclaves Returns UUIDs of existing analyses.
EnclaveServiceApi GetStats GET /enclaves/stats
EnclaveServiceApi KillEnclave POST /enclaves/{uuid}/kill
EnvironmentServiceApi DeleteEnvironment DELETE /environments/{uuid}
EnvironmentServiceApi DeleteEnvironmentSubscription DELETE /environments/{uuid}/subscribe
EnvironmentServiceApi GetEnvironment GET /environments/{uuid}
EnvironmentServiceApi GetEnvironments GET /environments Returns UUIDs of existing analyses.
EnvironmentServiceApi GetPublishedEnvironments GET /environments/published
EnvironmentServiceApi GetSubscribedEnvironments GET /environments/subscriptions
EnvironmentServiceApi PublishEnvironment POST /environments
EnvironmentServiceApi SubscribeEnvironment POST /environments/{uuid}/subscribe
EnvironmentServiceApi UpdateEnvironment PUT /environments/{uuid}
InvoiceServiceApi GetBillingPortalURL GET /invoices/portal
InvoiceServiceApi GetInvoices GET /invoices
NodeServiceApi CreateNode POST /nodes/v2
NodeServiceApi GetBootstrap GET /nodes/bootstrap
NodeServiceApi GetNodeLicenses GET /nodes/licenses
NodeServiceApi GetNodeV2 GET /nodes/v2/{ident}
NodeServiceApi GetNodes2 GET /nodes
NodeServiceApi GetNodesV2 GET /nodes/v2 Returns UUIDs of existing analyses.
NodeServiceApi KillNode POST /nodes/v2/{ident}/kill
NodeServiceApi PostNodeInfo POST /nodes
NodeServiceApi PostNodeInfo_0 POST /nodes/create
OrganizationServiceApi GetNodes3 GET /organizations
RequestServiceApi AddData POST /requests/{uuid}/data Is used to upload and park the data till the AnalysisRequest gets processed.
RequestServiceApi CancelProcessing POST /requests/{uuid}/cancel Endpoint is called from the Analysis Processing entity to submit the result.
RequestServiceApi CreateNewRequest POST /requests Endpoint used to create a new Analysis Request.
RequestServiceApi GetActions GET /requests/actions
RequestServiceApi GetAgent GET /requests/{uuid}/agent Is called from the APE to request all parked datasets.
RequestServiceApi GetAllRequests GET /requests Returns UUIDs of existing analyses.
RequestServiceApi GetData GET /requests/{uuid}/data Is called from the APE to request all parked datasets.
RequestServiceApi GetRequest GET /requests/{uuid} Returns the details for certain Request.
RequestServiceApi GetResult GET /requests/{uuid}/result Can be called from creator to request the AnalysisResult.
RequestServiceApi GetStatus GET /requests/stats
RequestServiceApi GiveConsent POST /requests/{uuid}/consent Used to give consent for request.
RequestServiceApi InitRequestParameters POST /requests/{uuid} Endpoint used initialized addition datacollection parameters for requester.
RequestServiceApi SetAgent POST /requests/{uuid}/agent Is called from the APE to request all parked datasets.
RequestServiceApi SetResult POST /requests/{uuid}/result Endpoint is called from the Analysis Processing entity to submit the result.
SocialPlatformServiceApi GetPlatforms GET /platforms Used to Handle Incoming Webhooks from Facebook.
SocialPlatformServiceApi ListenTwitterWebhook POST /platforms/twitter Used to Handle Incoming Webhooks from Facebook.
SocialPlatformServiceApi RegisterTwitterWebhook GET /platforms/twitter Used to Handle Incoming Webhooks from Twitter.
SocialServiceApi GetMyProfile GET /social/profiles/me
SocialServiceApi GetPlatforms2 GET /social Returns all Platforms / Systems that can be Connected to the MADANA Service.
SocialServiceApi GetRanking GET /social/ranking Returns the Ranking by PTS within the System.
SocialServiceApi GetSocialPlatformFeed GET /social/feed/{platform}
SocialServiceApi GetUserProfile GET /social/profiles/{username}
SocialServiceApi GetUserProfile_0 GET /social/profiles/{username}/simple
SubscriptionServiceApi AddFreeSubscription POST /subscriptions/saas/free
SubscriptionServiceApi AddPassTrialSubscription POST /subscriptions/paas/trial
SubscriptionServiceApi GetApplication GET /subscriptions/active
SubscriptionServiceApi GetCheckoutSession GET /subscriptions/{productname}/checkout
SubscriptionServiceApi GetCheckoutSession2 POST /subscriptions/{productname}/{newplan}
SystemServiceApi GetAllObjects GET /system/health
SystemServiceApi GetApplication2 GET /system/usage Return the current application usage.
UserServiceApi CancelSubscription POST /users/{username}/subscriptions/{planname}/cancel
UserServiceApi CreateObject POST /users Creates a new user object.
UserServiceApi DeleteObject DELETE /users/{username} Deletes an User based on the provided id and securitycontext.
UserServiceApi DeleteObject_0 DELETE /users/{username}/social/{platform}/{ident} Deletes linked account from the user and securitycontext.
UserServiceApi GetAvatars GET /users/{username}/avatars
UserServiceApi GetCertificates GET /users/{username}/certificates
UserServiceApi GetEnclaveHistory GET /users/{username}/enclavehistory
UserServiceApi GetObject2 GET /users/{username}
UserServiceApi SetAvatar POST /users/{username}/avatars
UserServiceApi SetSettings POST /users/{username}/settings
UserServiceApi UpdateObject PUT /users/{username} Updates Userproperties based on the provided user object.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

About

C# JSON client-side library that defines the C#classes that can be (de)serialized to/from JSON. This is useful for accessing the REST endpoints that are published by the madana-api, but only those that produce a JSON representation of their resources (content type "application/json").

Topics

Resources

Stars

Watchers

Forks

Languages