Skip to content

C# SDK Configuration

Pawel Sawicz edited this page Jan 26, 2015 · 9 revisions

C# SDK Configuration

First of all you have to download JustGiving SDK package from NuGet.org either from website JustGiving SDK or by command

PM> Install-Package justgiving-sdk

Then if you have downloaded a JustGiving SDK you have to create an instance of JustGivingClient

var client = new JustGiving.Api.Sdk.JustGivingClient("APIKEY");

Code above is required to do any request against our API!

If you would like to change an environment simply you have to create an instance of ClientConfiguration

var clientConfig = new Api.Sdk.ClientConfiguration("https://api-sandbox.justgiving.com/", "api-key", 1);

or for live server

var clientConfig = new Api.Sdk.ClientConfiguration("https://api.justgiving.com/", "api-key", 1);

and then pass into JustGivingClient argument

var client = new JustGiving.Api.Sdk.JustGivingClient(clientConfig);

To add authentication for your request, simply you have to set up username and password for client

clientConfig.Username = "username";
clientConfig.Password = "password";
Clone this wiki locally