How Can We Help?

KYC Check Api via Postman or C#

< All Topics

This tutorial describes the process of calling the KYC Check endpoint using Postman and C#

KYC Check in Postman

Postman is a free app that allows you to perform HTTP requests. You can download it from the Postman website here.

Option 1 – Download and import our example collection

We have set up an example Postman collection that contains example requests that you can import: https://github.com/W2-Global-Data/Api-Samples/blob/main/REST/w2-apipostman_collection.json. (you may need to right click the link and click ‘save link as’)

All you will need to do is insert your W2 provided API key into the Authorization header of the request in the collection, add your document to the body and it should work.

Option 2 – Follow these steps to create your own request

1) Set the request Method to ‘Post’

2 ) Set the URL to the KYC Check endpoint. i.e. https://api.w2globaldata.com/kyccheck?api-version=1.0

3) Add an Authorization header to the request with a value of ‘Basic’ and your API key.

4) Set the body of the request to ‘Raw’ and the data type to ‘JSON’.

5) Enter the data of your request into the body section of the request.

6) Send the request and view the results.

KYC Check in C#

An example of how to call the KYC Check endpoint using C#. The following code can be run as a console app to perform Watchlist checks.

namespace KYCCaller
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net.Http;
    using System.Text;
    using System.Threading.Tasks;
    using Newtonsoft.Json;

    public class Match
    {
        public int BirthDay { get; set; }

        public int BirthMonth { get; set; }

        public int BirthYear { get; set; }

        public string Name { get; set; }
    }

    public class WatchlistCheckResult
    {
        public IEnumerable MatchResults { get; set; }
    }

    public class Results
    {
        public WatchlistCheckResult WatchlistCheckResult { get; set; }
    }

    public class KycCheckResponse
    {
        public Results Results { get; set; }
    }

    public class Data
    {
        public string NameQuery { get; set; }
    }

    public class KycCheckRequest
    {
        public string Bundle { get; set; }

        public Data Data { get; set; }
    }

    public class Program
    {
        static async Task Main(string[] args)
        {
            var client = new HttpClient();

            var kycRequest = new KycCheckRequest
            {
                Bundle = "WatchlistCheck",
                Data = new Data
                {
                    NameQuery = "Robert Mugabe"
                }
            };

            var requestJson = JsonConvert.SerializeObject(kycRequest);

            var response = await client.SendAsync(new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                Headers = { { "Authorization", "Basic -YOUR API KEY-" } },
                RequestUri = new Uri("https://api.w2globaldata.com/kyccheck?api-version=1.0"),
                Content = new StringContent(requestJson, Encoding.UTF8, "application/json")

            });

            if (!response.IsSuccessStatusCode)
            {
                // Handle failed requests
            }

            var kycResponse = JsonConvert.DeserializeObject(
                await response.Content.ReadAsStringAsync());

            Console.WriteLine($"Found {kycResponse.Results.WatchlistCheckResult.MatchResults.Count()} matches");
        }
    }
}
Table of Contents
Scroll to Top