# MyDataMyConsent - the C# library for the My Data My Consent - Developer API

Unleashing the power of data consent by establishing trust. The Platform Core Developer API defines a set of capabilities that can be used to request, issue, manage and update data, documents and credentials by organizations. The API can be used to request, manage and update Decentralised Identifiers, Financial Data, Health Data issue Documents, Credentials directly or using OpenID Connect flows, and verify Messages signed with DIDs and much more.

This C# SDK is automatically generated by the OpenAPI Generator (opens new window) project:

# 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 (opens new window) to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
1
2
3

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

# 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 MyDataMyConsent.Api;
using MyDataMyConsent.Client;
using MyDataMyConsent.Models;
1
2
3

# 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;
1
2
3
4

# Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using MyDataMyConsent.Api;
using MyDataMyConsent.Client;
using MyDataMyConsent.Models;

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

            Configuration config = new Configuration();
            config.BasePath = "https://api.mydatamyconsent.com";
            var apiInstance = new DataConsentRequestsApi(config);
            var requestId = "requestId_example";  // Guid | Individual consent request id.

            try
            {
                // Cancel the individual data consent request by Id.
                apiInstance.CancelIndividualDataConsentRequest(requestId);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling DataConsentRequestsApi.CancelIndividualDataConsentRequest: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

# Documentation for API Endpoints

All URIs are relative to https://api.mydatamyconsent.com

Class Method HTTP request Description
DataConsentRequestsApi CancelIndividualDataConsentRequest PUT /v1/consent-requests/individual/{requestId}/cancel Cancel the individual data consent request by Id.
DataConsentRequestsApi CancelOrganizationDataConsentRequest PUT /v1/consent-requests/organization/{requestId}/cancel Cancel the organization data consent request by Id.
DataConsentRequestsApi CreateIndividualDataConsentRequest POST /v1/consent-requests/individual Create data consent request for an individual.
DataConsentRequestsApi CreateOrganizationDataConsentRequest POST /v1/consent-requests/organization Create data consent request for an organization.
DataConsentRequestsApi GetAllConsentRequestsToIndividuals GET /v1/consent-requests/individuals Get all Consent Requests sent to individuals.
DataConsentRequestsApi GetAllConsentRequestsToOrganizations GET /v1/consent-requests/organizations Get all Consent Requests sent to organizations.
DataConsentRequestsApi GetIndividualConsentRequestById GET /v1/consent-requests/individuals/{requestId} Get individual data consent request by id.
DataConsentRequestsApi GetOrganizationConsentRequestById GET /v1/consent-requests/organizations/{requestId} Get a OrganizationConsent Request by Id.
DataConsentsApi DownloadConsentedDocumentAnalysis GET /v1/consents/{consentId}/documents/{documentId}/analysis Get analysis of a consented document.
DataConsentsApi DownloadIndividualConsentedDocumentById GET /v1/consents/individuals/{consentId}/documents/{documentId}/download Download individual consented document by document id.
DataConsentsApi DownloadOrganizationConsentedDocumentById GET /v1/consents/organizations/{consentId}/documents/{documentId}/download Download organization consent document based on document id.
DataConsentsApi GetAllConsentedFinancialAccounts GET /v1/consents/individuals/{consentId}/financial-accounts Get all individual consented financial accounts.
DataConsentsApi GetConsentFinancialAccounts GET /v1/consents/organizations/{consentId}/financial-accounts Get all organizational consented financial accounts.
DataConsentsApi GetConsentedAccountById GET /v1/consents/individuals/{consentId}/financial-accounts/{accountId} Get individual consented financial account details based on account id.
DataConsentsApi GetConsentedDocumentById GET /v1/consents/individuals/{consentId}/documents/{documentId} Get individual consented document by document id.
DataConsentsApi GetConsentedFinancialAccount GET /v1/consents/organizations/{consentId}/financial-accounts/{accountId} Get organization consented financial account details based on account id.
DataConsentsApi GetConsentedFinancialAccountInsights GET /v1/consents/{consentId}/financial-accounts/{accountId}/insights Get consented financial account insights.
DataConsentsApi GetConsentedFinancialAccountTransactions GET /v1/consents/individuals/{consentId}/financial-accounts/{accountId}/transactions Get individual consented financial account transactions of an individual based on accountId.
DataConsentsApi GetConsents GET /v1/consents/individuals Get the paginated list of individual data consents.
DataConsentsApi GetIndividualConsentedDocuments GET /v1/consents/individuals/{consentId}/documents Get individual consented documents by consent id.
DataConsentsApi GetIndividualDataConsentById GET /v1/consents/individuals/{consentId} Get individuals data consent details by consent id.
DataConsentsApi GetOrgConsentedAccountTransactions GET /v1/consents/organizations/{consentId}/financial-accounts/{accountId}/transactions Get organization consented financial account transactions of an individual based on accountId.
DataConsentsApi GetOrganizationConsentedDocumentById GET /v1/consents/organizations/{consentId}/documents/{documentId} Get organization consent document based on document id.
DataConsentsApi GetOrganizationConsentedDocuments GET /v1/consents/organizations/{consentId}/documents Get organization consented documents by consent id.
DataConsentsApi GetOrganizationDataConsentById GET /v1/consents/organizations/{consentId} Get organizations data consent details by consent id.
DataConsentsApi GetOrganizationDataConsents GET /v1/consents/organizations Get the paginated list of organization data consents.
DataProcessingAgreementsApi CreateDataProcessingAgreement POST /v1/data-agreements Create a data processing agreement.
DataProcessingAgreementsApi DeleteDataProcessingAgreementById DELETE /v1/data-agreements/{id} Delete a data processing agreement. This will not delete a published or a agreement in use with consents.
DataProcessingAgreementsApi GetDataProcessingAgreementById GET /v1/data-agreements/{id} Get data processing agreement by id.
DataProcessingAgreementsApi GetDataProcessingAgreements GET /v1/data-agreements Get paginated data processing agreements.
DataProcessingAgreementsApi TerminateDataProcessingAgreementById PUT /v1/data-agreements/{id}/terminate Terminate a data processing agreement.
DataProcessingAgreementsApi UpdateDataProcessingAgreement PUT /v1/data-agreements/{id} Update a data processing agreement.
DataProviderDiscoveryApi GetDataProviderById GET /v1/data-providers/{providerId} Get a Data Provider details by provider id.
DataProviderDiscoveryApi GetDataProviders GET /v1/data-providers Discover all data providers in My Data My Consent by country and filters.
DigiLockerCompatIssuerApi DigilockerCompatIssueDocument POST /issuer/issuedoc/1/xml Digilocker Compatible endpoint to issue document.
DocumentsApi GetIssuedDocumentById GET /v1/documents/issued/{documentId} Get issued document.
DocumentsApi GetIssuedDocuments GET /v1/documents/issued Get paginated list of issued documents of given document type.
DocumentsApi GetRegisteredDocumentTypes GET /v1/documents/types Get paginated list of registered document types.
DocumentsApi IssueDocumentToIndividual POST /v1/documents/issue/individual Issue a new document to an individual user.
DocumentsApi IssueDocumentToOrganization POST /v1/documents/issue/organization Issue a new document to an organization.
DocumentsApi UploadDocumentForIndividual POST /v1/documents/issue/individual/upload/{issueRequestId} Upload a document for issuance request of individual.
DocumentsApi UploadDocumentForOrganization POST /v1/documents/issue/organization/upload/{issueRequestId} Upload a document for issuance request of organization.
SupportedIdentifiersApi GetAllSupportedIdentifiers GET /v1/supported-identifiers/{countryIso2Code} Get all supported identifiers by country.

# Documentation for Models

# Documentation for Authorization

# oauth2

  • Type: OAuth
  • Flow: application
  • Authorization URL: https://accounts.mydatamyconsent.com/connect/authorize
  • Scopes:
    • developer: Developer API
Last Updated: 6/19/2022, 7:27:56 PM