XRay.ClientV2 0.1.4

dotnet add package XRay.ClientV2 --version 0.1.4                
NuGet\Install-Package XRay.ClientV2 -Version 0.1.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XRay.ClientV2" Version="0.1.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XRay.ClientV2 --version 0.1.4                
#r "nuget: XRay.ClientV2, 0.1.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install XRay.ClientV2 as a Cake Addin
#addin nuget:?package=XRay.ClientV2&version=0.1.4

// Install XRay.ClientV2 as a Cake Tool
#tool nuget:?package=XRay.ClientV2&version=0.1.4                

XRay

Package for testing and using XRay KYC/B services.

Before you start using this package, you will need to register your organisation at XRay Portal, and obtain your unique Token.

Usage info

To use XRayApiClient you will need to provide it with url endpoint and Token. Token is secret key generated on portal and is unique to your organisation.

To use APIs you first need to authenticate client using AuthenticateWithAsync method. It will use provided token to get XRay's access token - which lasts for a short period of time - usually 30min. After token expires, authenticate again with the same Token.

After authentication, you can use XRayApiClient to create and retrieve sessions.
Set isTesting = true on session to use test data that is not billed.

Example

Creating session

Returned session will be populated only with small subset of data - to get details, use GetSessionDetails()

static async Task<Session> CreateTestSession_PersonPasses()
        {
            using var client = new XRayApiClient(Endpoint);
            await client.AuthenticateWithAsync(Token);
            Session session;

            try
            {
                session = await client
                    .SetPerson(new PersonInput()
                    {
                        FirstName = "John",
                        MiddleName = "Henry",
                        LastName = "Smith",
                        Gender = "male",
                        IsoLatin1Name = "Johnny",
                        Nationality = "AU",
                        Dob = DateTime.Parse("2000-03-03"),
                        Documents = new List<DocumentInput>() {
                            new DocumentInput { Number = "B23SDS2233", Expiry = DateTime.Parse("2022-03-03"), Type = DocumentType.MediCard }
                        },
                        Communications = new List<CommunicationInput>() {
                            new CommunicationInput { IpAddress = "22.22.22.22", Website = "www.johnsmith.com" }
                        },
                    })
                    .SetIsTesting(true)
                    .SetResponseTransport(ResponseTransport.LongPolling)
                    //.SetWebhook("https://en4f7tfoezabp.x.pipedream.net/")
                    .SetDescription("Test from code: " + DateTime.Now.ToString())
                    .SetConfigurationId(ConfigurationId)
                    .PublishAsync();
            }
            catch (ResponseException resExc)
            {
                Console.WriteLine(resExc.Message);
                Console.WriteLine(String.Join("\n", resExc.AllErrorMessages));
                return null;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return null;
            }

            // Now get all details about session
            return await GetSessionDetails(session.Id ?? Guid.Empty, client);
        }

Get Session details

        static async Task<Session> GetSessionDetails(Guid id, XRayApiClient client)
        {
            try
            {
                var session = await client.GetSessionAsync(id);
                Console.WriteLine(JsonSerializer.Serialize(session, new JsonSerializerOptions { WriteIndented = true }));

                return session;
            }
            catch (ResponseException resExc)
            {
                Console.WriteLine(resExc.Message);
                Console.WriteLine(String.Join("\n", resExc.AllErrorMessages));
                return null;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return null;
            }
        }
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.4 1,593 10/25/2023
0.1.3 724 6/25/2023
0.1.2 128 6/23/2023
0.1.1 168 6/16/2023
0.1.0 222 5/22/2023
0.0.29 285 4/25/2023
0.0.28 338 3/7/2023