Skip to content

Instantly share code, notes, and snippets.

@sugimomoto
Created May 3, 2020 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sugimomoto/4ed086d79980a8ce0ac819cc7028fe1d to your computer and use it in GitHub Desktop.
Save sugimomoto/4ed086d79980a8ce0ac819cc7028fe1d to your computer and use it in GitHub Desktop.
board API SampleConsoleApp
using Newtonsoft.Json;
using RestSharp;
using System;
namespace boardSampleConsoleApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
var client = new RestClient("https://api.the-board.jp/v1/clients");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer XXX");
request.AddHeader("x-api-key", "XXXXX");
IRestResponse response = client.Execute(request);
var clients = JsonConvert.DeserializeObject<Client[]>(response.Content);
foreach (var item in clients)
{
Console.WriteLine(item.name);
}
Console.ReadKey();
}
}
public class Client
{
public int id { get; set; }
public string name { get; set; }
public string name_disp { get; set; }
public string title { get; set; }
public string zip { get; set; }
public string pref { get; set; }
public string address1 { get; set; }
public string address2 { get; set; }
public string tel { get; set; }
public string fax { get; set; }
public int payment_term_id { get; set; }
public string payment_term_name { get; set; }
public int bank_charge_to_client_flg { get; set; }
public int nda_flg { get; set; }
public int basic_agreement_flg { get; set; }
public int document_send_type { get; set; }
public string document_send_type_name { get; set; }
public object note { get; set; }
public string[] tags { get; set; }
public int wareki_flg { get; set; }
public string company_number { get; set; }
public string accounting_code { get; set; }
public string to { get; set; }
public string cc { get; set; }
public string name_en { get; set; }
public string address_en { get; set; }
public string phone_country_code { get; set; }
public string currency { get; set; }
public int lang_kbn { get; set; }
public string lang_kbn_name { get; set; }
public int archive_flg { get; set; }
public string custom_no { get; set; }
public DateTime created_at { get; set; }
public DateTime updated_at { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment