Ramco Ramco

Ramco Ramco

  • 445
  • 3.4k
  • 530.5k

How to generate Token

Dec 19 2022 5:53 PM

Hi

  I want to generate token. I am consuming Nimbuspost Api. Below is the code i am tying

            var client = new RestClient("api.nimbuspost.com/v1/users/login");
            client.Timeout = -1;
            var request = new RestRequest(Method.POST);
            request.AddHeader("content-type", "application/json");
            var body = @"{" + "\n" +
            @"    ""email"" : ""[email protected]""," + "\n" +
            @"    ""password"" : ""Temp234""" + "\n" +
            @"}";
            request.AddParameter("application/json", body, ParameterType.RequestBody);
            IRestResponse response = client.Execute(request);
            Console.WriteLine(response.Content);

In response it is returning - 

{"status":true,"data":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NzE0NzIzNTksImp0aSI6Ilgwc3lCclRNYW43Z3BJN3NSYzNXNVBDbVNUTkF5M29FNDJEcENKVDFhR2s9IiwibmJmIjoxNjcxNDcyMzU5LCJleHAiOjE2NzE0ODMxNTksImRhdGEiOnsidXNlcl9pZCI6IjQ3MDYyIiwicGFyZW50X2lkIjoiMCJ9fQ.s4mOl1Oa24iiA1e-wTTsYGeLSBjARcDZWl1BkW10_Ej5aQzTGWXAlrBGjznEghQJa2rmZts6zy1igLPeGcAWUQ"}

Thanks


Answers (2)