All NHVR APIs use the REST API (Representational state transfer) an API that uses HTTP requests for communication with web services.

To more easily use JSON data in C#, you will need to install the JSON.Net library from

All API calls require the endpoint URL and a set of headers. Some API calls will also require parameters (GET or DELETE requests) or data (POST or PUT) requests.

Login API calls should include the following headers:






All calls are made using JSON data structures


Your subscription key for the NHVR Portal API

The subscription key uniquely identifies you to the NHVR Portal API

The login endpoint uses the POST method and because the subscription key automatically populates your email and password the data body should contain an empty object.

using System;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Net.Http;
using System.Web;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace CSHttpClientSample

public class LoginResponse
public string token { get; set; }
public string refreshToken { get; set; }

static class Program
static void Main()

static async void MainAsync()
var client = new HttpClient();
var subscriptionKey = "<subscription key>";
var jwt = await GetJWTFromLogin(client, subscriptionKey);

static async Task<string> GetJWTFromLogin(HttpClient client, string subscriptionKey)
var uri = "";

// Headers
client.DefaultRequestHeaders.Add("Cache-Control", "no-cache");
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", subscriptionKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

// Request body
// If you have multiple accounts
// use accountType to select the type of account and
// use accountId to select the account id
var body = new {};

// Post
HttpResponseMessage response = await client.PostAsJsonAsync(uri, body);

string jsonResponse = response.Content.ReadAsStringAsync().Result;
LoginResponse loginResponseObj = JsonConvert.DeserializeObject<LoginResponse>(jsonResponse);
return loginResponseObj.token;

Did this answer your question?