When writing clients in C# to consume the API, there are several techniques possible.
Use the ServiceStack Client
- Install the ServiceStackVS extension
- Add References to System.Runtime.Serialization and System.Net
- Right-click on the project and choose "Add ServiceStack Reference..."
- Enter the address of the host and name the service
Add the following Code:
Using ServiceStack.Clientvar client = new ServiceStack.JsonServiceClient("http://api.jiwa.com.au"); var authResponse = client.Send<ServiceStack.AuthenticateResponse>(new ServiceStack.Authenticate() { provider = "credentials", UserName = "api", Password = "password", RememberMe = true }); // Read a debtor var serviceStackDebtorResponse = client.Get(new DebtorGetRequest { AccountNo = "1001" });
Related articles
Filter by label
There are no items with the selected labels at this time.