https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk
C#/Dotnet SDK for Fingerprint Pro Server API
https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk
audio-fingerprinting browser browser-fingerprinting csharp detection dotnet fingerprint fingerprinting fingerprintjs fraud fraud-detection identification visitor-identifier
Last synced: 5 months ago
JSON representation
C#/Dotnet SDK for Fingerprint Pro Server API
- Host: GitHub
- URL: https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk
- Owner: fingerprintjs
- License: mit
- Created: 2023-01-09T09:07:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-06T10:04:22.000Z (5 months ago)
- Last Synced: 2025-05-06T10:45:20.076Z (5 months ago)
- Topics: audio-fingerprinting, browser, browser-fingerprinting, csharp, detection, dotnet, fingerprint, fingerprinting, fingerprintjs, fraud, fraud-detection, identification, visitor-identifier
- Language: C#
- Homepage: https://fingerprint.com
- Size: 20.8 MB
- Stars: 11
- Watchers: 7
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: contributing.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Fingerprint Server API Dotnet SDK
[Fingerprint](https://fingerprint.com) is a device intelligence platform offering 99.5% accurate visitor identification.
Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 3
- SDK version: 7.4.0
- Build package: io.swagger.codegen.v3.generators.dotnet.CSharpClientCodegen
## Requirements
- .NET 8.0 or later (we keep the [Microsoft support policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core))We recommend installing the package from [NuGet](https://docs.nuget.org/consume/installing-nuget):
```shell
dotnet add package FingerprintPro.ServerSdk
``````csharp
// See https://aka.ms/new-console-template for more information
// Example usage of our SDK// Import namespaces
using FingerprintPro.ServerSdk.Api;
using FingerprintPro.ServerSdk.Client;// Initialize configuration and add your api key
var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!);var api = new FingerprintApi(
configuration
);var requestId = Environment.GetEnvironmentVariable("REQUEST_ID")!;
var visitorId = Environment.GetEnvironmentVariable("VISITOR_ID")!;var visits = api.GetVisits(visitorId);
var events = api.GetEvent(requestId);
var eventsFound = api.SearchEvents(20, paginationKey: "1740815825085", bot: "bad");Console.WriteLine(visits);
Console.WriteLine(events);
Console.WriteLine(eventsFound);var tag = new Tag
{
["key"] = "value"
};
var body = new EventsUpdateRequest()
{
Suspect = false,
Tag = tag,
LinkedId = ""
};
api.UpdateEvent(body, requestId);
```You can also access the raw HTTP response by using the `WithHttpInfo` methods:
```csharp
// See https://aka.ms/new-console-template for more information
// Example usage of our SDK// Import namespaces
using FingerprintPro.ServerSdk.Api;
using FingerprintPro.ServerSdk.Client;// Initialize configuration and add your api key
var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!);var api = new FingerprintApi(
configuration
);var requestId = Environment.GetEnvironmentVariable("REQUEST_ID")!;
var visitorId = Environment.GetEnvironmentVariable("VISITOR_ID")!;var visits = api.GetVisitsWithHttpInfo(visitorId);
// HttpResponseMessage
Console.WriteLine(visits.Response);// Response data
Console.WriteLine(visits.Data);
```You can view more examples in [src/FingerprintPro.ServerSdk.Examples/Program.cs](src/FingerprintPro.ServerSdk.Examples/Program.cs).
### Region
If your subscription is in region other than US, you need to change the region in the configuration:
```csharp
using FingerprintPro.ServerSdk.Client;var configuration = new Configuration(Environment.GetEnvironmentVariable("SECRET_API_KEY")!)
{
Region = Region.Eu // or Region.Asia
};
```## Sealed results
This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results).
```csharp
using FingerprintPro.ServerSdk;var sealedResult = Environment.GetEnvironmentVariable("BASE64_SEALED_RESULT")!;
var sealedKey = Environment.GetEnvironmentVariable("BASE64_KEY")!;var events = Sealed.UnsealEventResponse(Convert.FromBase64String(sealedResult), new[]
{
new Sealed.DecryptionKey(Convert.FromBase64String(sealedKey), Sealed.DecryptionAlgorithm.Aes256Gcm)
});Console.WriteLine(events.ToJson());
```
To learn more, refer to example located in [src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs](src/FingerprintPro.ServerSdk.SealedResultExample/Program.cs).## Webhook signature validation
This SDK provides utility method for verifying the HMAC signature of the incoming webhook request.
```csharp
namespace FingerprintAspNetCore.Areas.Identity.Pages;using FingerprintPro.ServerSdk;
using Microsoft.AspNetCore.Mvc;
using System;
using System.IO;
using System.Threading.Tasks;[Route("api/[controller]")]
[ApiController]
public class WebhookController : ControllerBase
{
[HttpPost]
public async Task Post()
{
try
{
var secret = Environment.GetEnvironmentVariable("WEBHOOK_SIGNATURE_SECRET");
if (string.IsNullOrEmpty(secret))
{
return BadRequest(new { message = "Secret key is not configured." });
}var header = Request.Headers["fpjs-event-signature"].ToString();
if (string.IsNullOrEmpty(header))
{
return BadRequest(new { message = "Missing fpjs-event-signature header." });
}using var memoryStream = new MemoryStream();
await Request.Body.CopyToAsync(memoryStream);
var data = memoryStream.ToArray();// Validate webhook signature
var isValid = WebhookValidation.IsValidSignature(
header,
data,
secret);if (!isValid)
{
return Forbid(new { message = "Webhook signature is invalid." });
}// Process the webhook data here
return Ok(new { message = "Webhook received." });
}
catch (Exception e)
{
return StatusCode(500, new { error = e.Message });
}
}
}```
To learn more, refer to example located in [src/FingerprintPro.ServerSdk.WebhookExample/Program.cs](src/FingerprintPro.ServerSdk.WebhookExample/Program.cs).
## Documentation for API EndpointsAll URIs are relative to *https://api.fpjs.io*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FingerprintApi* | [**DeleteVisitorData**](docs/FingerprintApi.md#deletevisitordata) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID
*FingerprintApi* | [**GetEvent**](docs/FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by request ID
*FingerprintApi* | [**GetRelatedVisitors**](docs/FingerprintApi.md#getrelatedvisitors) | **GET** /related-visitors | Get Related Visitors
*FingerprintApi* | [**GetVisits**](docs/FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
*FingerprintApi* | [**SearchEvents**](docs/FingerprintApi.md#searchevents) | **GET** /events/search | Get events via search
*FingerprintApi* | [**UpdateEvent**](docs/FingerprintApi.md#updateevent) | **PUT** /events/{request_id} | Update an event with a given request ID- [Model.Botd](docs/Botd.md)
- [Model.BotdBot](docs/BotdBot.md)
- [Model.BotdBotResult](docs/BotdBotResult.md)
- [Model.BrowserDetails](docs/BrowserDetails.md)
- [Model.ClonedApp](docs/ClonedApp.md)
- [Model.DeprecatedGeolocation](docs/DeprecatedGeolocation.md)
- [Model.DeveloperTools](docs/DeveloperTools.md)
- [Model.Emulator](docs/Emulator.md)
- [Model.Error](docs/Error.md)
- [Model.ErrorCode](docs/ErrorCode.md)
- [Model.ErrorPlainResponse](docs/ErrorPlainResponse.md)
- [Model.ErrorResponse](docs/ErrorResponse.md)
- [Model.EventsGetResponse](docs/EventsGetResponse.md)
- [Model.EventsUpdateRequest](docs/EventsUpdateRequest.md)
- [Model.FactoryReset](docs/FactoryReset.md)
- [Model.Frida](docs/Frida.md)
- [Model.Geolocation](docs/Geolocation.md)
- [Model.GeolocationCity](docs/GeolocationCity.md)
- [Model.GeolocationContinent](docs/GeolocationContinent.md)
- [Model.GeolocationCountry](docs/GeolocationCountry.md)
- [Model.GeolocationSubdivision](docs/GeolocationSubdivision.md)
- [Model.GeolocationSubdivisions](docs/GeolocationSubdivisions.md)
- [Model.HighActivity](docs/HighActivity.md)
- [Model.IPBlocklist](docs/IPBlocklist.md)
- [Model.IPBlocklistDetails](docs/IPBlocklistDetails.md)
- [Model.IPInfo](docs/IPInfo.md)
- [Model.IPInfoASN](docs/IPInfoASN.md)
- [Model.IPInfoDataCenter](docs/IPInfoDataCenter.md)
- [Model.IPInfoV4](docs/IPInfoV4.md)
- [Model.IPInfoV6](docs/IPInfoV6.md)
- [Model.Identification](docs/Identification.md)
- [Model.IdentificationConfidence](docs/IdentificationConfidence.md)
- [Model.IdentificationSeenAt](docs/IdentificationSeenAt.md)
- [Model.Incognito](docs/Incognito.md)
- [Model.Jailbroken](docs/Jailbroken.md)
- [Model.LocationSpoofing](docs/LocationSpoofing.md)
- [Model.MitMAttack](docs/MitMAttack.md)
- [Model.PrivacySettings](docs/PrivacySettings.md)
- [Model.ProductBotd](docs/ProductBotd.md)
- [Model.ProductClonedApp](docs/ProductClonedApp.md)
- [Model.ProductDeveloperTools](docs/ProductDeveloperTools.md)
- [Model.ProductEmulator](docs/ProductEmulator.md)
- [Model.ProductFactoryReset](docs/ProductFactoryReset.md)
- [Model.ProductFrida](docs/ProductFrida.md)
- [Model.ProductHighActivity](docs/ProductHighActivity.md)
- [Model.ProductIPBlocklist](docs/ProductIPBlocklist.md)
- [Model.ProductIPInfo](docs/ProductIPInfo.md)
- [Model.ProductIdentification](docs/ProductIdentification.md)
- [Model.ProductIncognito](docs/ProductIncognito.md)
- [Model.ProductJailbroken](docs/ProductJailbroken.md)
- [Model.ProductLocationSpoofing](docs/ProductLocationSpoofing.md)
- [Model.ProductMitMAttack](docs/ProductMitMAttack.md)
- [Model.ProductPrivacySettings](docs/ProductPrivacySettings.md)
- [Model.ProductProxy](docs/ProductProxy.md)
- [Model.ProductRawDeviceAttributes](docs/ProductRawDeviceAttributes.md)
- [Model.ProductRemoteControl](docs/ProductRemoteControl.md)
- [Model.ProductRootApps](docs/ProductRootApps.md)
- [Model.ProductSuspectScore](docs/ProductSuspectScore.md)
- [Model.ProductTampering](docs/ProductTampering.md)
- [Model.ProductTor](docs/ProductTor.md)
- [Model.ProductVPN](docs/ProductVPN.md)
- [Model.ProductVelocity](docs/ProductVelocity.md)
- [Model.ProductVirtualMachine](docs/ProductVirtualMachine.md)
- [Model.Products](docs/Products.md)
- [Model.Proxy](docs/Proxy.md)
- [Model.RawDeviceAttribute](docs/RawDeviceAttribute.md)
- [Model.RawDeviceAttributeError](docs/RawDeviceAttributeError.md)
- [Model.RawDeviceAttributes](docs/RawDeviceAttributes.md)
- [Model.RelatedVisitor](docs/RelatedVisitor.md)
- [Model.RelatedVisitorsResponse](docs/RelatedVisitorsResponse.md)
- [Model.RemoteControl](docs/RemoteControl.md)
- [Model.RootApps](docs/RootApps.md)
- [Model.SearchEventsResponse](docs/SearchEventsResponse.md)
- [Model.SearchEventsResponseEvents](docs/SearchEventsResponseEvents.md)
- [Model.SuspectScore](docs/SuspectScore.md)
- [Model.Tag](docs/Tag.md)
- [Model.Tampering](docs/Tampering.md)
- [Model.Tor](docs/Tor.md)
- [Model.VPN](docs/VPN.md)
- [Model.VPNConfidence](docs/VPNConfidence.md)
- [Model.VPNMethods](docs/VPNMethods.md)
- [Model.Velocity](docs/Velocity.md)
- [Model.VelocityData](docs/VelocityData.md)
- [Model.VelocityIntervals](docs/VelocityIntervals.md)
- [Model.VirtualMachine](docs/VirtualMachine.md)
- [Model.Visit](docs/Visit.md)
- [Model.VisitorsGetResponse](docs/VisitorsGetResponse.md)
- [Model.Webhook](docs/Webhook.md)
- [Model.WebhookClonedApp](docs/WebhookClonedApp.md)
- [Model.WebhookDeveloperTools](docs/WebhookDeveloperTools.md)
- [Model.WebhookEmulator](docs/WebhookEmulator.md)
- [Model.WebhookFactoryReset](docs/WebhookFactoryReset.md)
- [Model.WebhookFrida](docs/WebhookFrida.md)
- [Model.WebhookHighActivity](docs/WebhookHighActivity.md)
- [Model.WebhookIPBlocklist](docs/WebhookIPBlocklist.md)
- [Model.WebhookIPInfo](docs/WebhookIPInfo.md)
- [Model.WebhookJailbroken](docs/WebhookJailbroken.md)
- [Model.WebhookLocationSpoofing](docs/WebhookLocationSpoofing.md)
- [Model.WebhookMitMAttack](docs/WebhookMitMAttack.md)
- [Model.WebhookPrivacySettings](docs/WebhookPrivacySettings.md)
- [Model.WebhookProxy](docs/WebhookProxy.md)
- [Model.WebhookRawDeviceAttributes](docs/WebhookRawDeviceAttributes.md)
- [Model.WebhookRemoteControl](docs/WebhookRemoteControl.md)
- [Model.WebhookRootApps](docs/WebhookRootApps.md)
- [Model.WebhookSuspectScore](docs/WebhookSuspectScore.md)
- [Model.WebhookTampering](docs/WebhookTampering.md)
- [Model.WebhookTor](docs/WebhookTor.md)
- [Model.WebhookVPN](docs/WebhookVPN.md)
- [Model.WebhookVelocity](docs/WebhookVelocity.md)
- [Model.WebhookVirtualMachine](docs/WebhookVirtualMachine.md)
## Documentation for Authorization- **Type**: API key
- **API key parameter name**: Auth-API-Key
- **Location**: HTTP header
### ApiKeyQuery- **Type**: API key
- **API key parameter name**: api_key
- **Location**: URL query string
## Documentation for sealed results
- [Sealed](docs/Sealed.md)
- [DecryptionKey](docs/DecryptionKey.md)## Documentation for webhooks
- [WebhookValidation](docs/WebhookValidation.md)
## Support and feedback
To report problems, ask questions or provide feedback, please use [Issues](https://github.com/fingerprintjs/fingerprintjs-pro-server-api-node-sdk/issues). If you need private support, you can email us at [oss-support@fingerprint.com](mailto:oss-support@fingerprint.com).
## License
This project is licensed under the [MIT license](https://github.com/fingerprintjs/fingerprint-pro-server-api-dotnet-sdk/blob/main/LICENSE).