Skip to content

Get started using the SDK (C#)


Our SDK is available as a NuGet package. Install the SDK using the NuGet package manager: Install-Package Elfskot.Connect.SDK


See the Authentication section of the REST API on how to acquire your ApplicationId and Secret.

Initializing the ElfskotApiClient

All interactions with the Elfskot API are done using the ElfskotApiClient:

var elfskotApiClient = new ElfskotApiClient(new Guid("YOUR APPLICATION ID"),"YOUR SECRET");

Data management

Data management interactions are done through ManagementResources that can be directly accessed through elfskotApiClient.Management.

Retrieving entities

To retrieve a entity by its ID you can use the GetById method:

var contact = elfskotApiClient
    .GetById(new Guid("56448abb-f00e-45a8-b1ac-08c62c8ed8f5"));

To retrieve multiple entities you can use the Get method:

var contacts = elfskotApiClient
    .OrderBy(c => c.CreatedDate)

Including referenced entities

By default the API will not include referenced entities. So for example if you want to retrieve the lines of quotation you can use the Include method:

var quotation = elfskotApiClient
    .Include(q => q.Lines) // <-- Reference the entity you want to include.
    .GetById(new Guid("56448abb-f00e-45a8-b1ac-08c62c8ed8f5"));

foreach(var line in quotation.Lines)

Inserting entities

To insert entities you can use the Create and BulkCreate methods:

var newCrmAccount = new CrmAccount()
        CompanyName = "Brightwater Industries"

newCrmAccount = elfskotApiClient

var newIdentifier = newCrmAccount.Id;

Updating entities

To update a entity you can use the Update or BulkUpdate methods:

quotation.Deliverydate = DateTimeOffset.Now;

Deleting entities

To delete a entity you can use the Delete method:

    .Delete(new Guid("56448abb-f00e-45a8-b1ac-08c62c8ed8f5"));