How to create a C# (CSharp) client to integrate with the snapWONDERS API
The purpose of this tutorial is to show you how you can create a C# client example to the snapWONDERS API. This includes a step-by-step guide how to set up your development environment, the example source code and instructions on how to test and run.
What is C#?
C# (pronounced "See Sharp") is a modern, object-oriented, and type-safe programming language. C# enables developers to build many types of secure and robust applications that run in .NET. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers.
C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.
Objectives
Through the example source, you will be able to:
- Upload digital media (using resumable uploading following the Tus.io protocol)
- Perform deep digital media analysis, reveal hidden metadata, hidden metadata, copyrights, steganography and private information leakage
- Display the results from the analysis (in which you can extract and make use as needed)
Installation and setup
Development environment
For the development environment you will need:
- Install Visual Studio Code. You can download and install from visual code studio
- Install the DotNet SDK for Visual Code if you have not done so. Simply follow the instructions from dotnet.microsoft.com/en-us/download/dotnet/sdk-for-vs-code
- Install the plugins needed for C# into Visual Studio Code as needed. See images below for plugins I had installed:
snapWONDERS API Key
You will need the snapWONDERS API Key before you can get started:
- Signup and create an account at snapWONDERS at signup. If you wish to create account via Tor or I2P then you can do so by accessing snapWONDERS via the Tor or I2P portals. For the dark web links visit browsing safely
- Under your account settings, scroll to the bottom under the section "API Settings" and click the button to generate your Auth API key
- Copy this key directly into the constants_helper.cs file under the constant SNAPWONDERS_API_KEY
Source Code
The source code for these examples are located on GitHub - https://github.com/snapWONDERS/example-CSharp-client-to-snapWonders-API
Running the C# example
Once everything above is setup, and you've downloaded the source, you should be able to simply open the workspace folder with Visual Studio Code and run or debug it. Simply hit the default hot keys F5 to start debugging or to run directly use Ctrl+F5.
If you wish, you can change and provide your own digital media to upload (images and/or videos) and change the MEDIA_PATH_FILENAME constant contained in the constants_helper.cs file. Otherwise the sample image provided is just a photo of me that I use on my social media accounts.
If all is well, then you should see the standard output to be something like below:
Which provides similar information as per the analyse results via the snapWONDERS website:
Documentation
Useful documentation can be found at:
- For endpoint, swagger UI and other source code examples can be found at snapWONDERS developers documentation
- The actual snapWONDERS OpenAPI Specification can be found at snapWONDERS OpenAPI Specification
- If you're wanting the actual JSON Schema details for the purpose of auto generating source from the schema you can use snapWONDERS OpenAPI Specification JSON Schema
Contact
For security concerns
If you have spotted any security concerns then please reach out via contacting snapWONDERS and set the subject to "SECURITY CONCERNS" and provide the information about your concerns. If you wish to contact via Tor or I2P then you can do so by accessing snapWONDERS via the Tor or I2P portals. For the dark web links visit browsing safely
For FAQ and questions
It may be possible that your questions are already answered in the FAQ. Be sure to check out the FAQ content first. Otherwise you may reach out via contacting snapWONDERS. If you wish to contact via Tor or I2P then you can do so by accessing snapWONDERS via the Tor or I2P portals. For the dark web links visit browsing safely