C# Dwolla: Get Root Links

Back to Index

Fetches the root links for the Dwolla REST API.

Documentation: https://docsv2.dwolla.com/#root

CURL Command

curl https://api-sandbox.dwolla.com/ \
-H "Accept: application/vnd.dwolla.v1.hal+json" \
-H "Authorization: Bearer DWOLLA_ACCESS_TOKEN"

C# Example

Chilkat.Rest rest = new Chilkat.Rest();
bool success;

//  URL: https://api-sandbox.dwolla.com/
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = rest.Connect("api-sandbox.dwolla.com",port,bTls,bAutoReconnect);
if (success != true) {
    Debug.WriteLine("ConnectFailReason: " + Convert.ToString(rest.ConnectFailReason));
    Debug.WriteLine(rest.LastErrorText);
    return;
}

rest.AddHeader("Authorization","Bearer DWOLLA_ACCESS_TOKEN");
rest.AddHeader("Accept","application/vnd.dwolla.v1.hal+json");

Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
success = rest.FullRequestNoBodySb("GET","/",sbResponseBody);
if (success != true) {
    Debug.WriteLine(rest.LastErrorText);
    return;
}

Chilkat.JsonObject jsonResponse = new Chilkat.JsonObject();
jsonResponse.LoadSb(sbResponseBody);

string v_linksAccountHref;
string v_linksAccountType;
string v_linksAccountResource_type;
string v_linksEventsHref;
string v_linksEventsType;
string v_linksEventsResource_type;
string v_linksWebhook_subscriptionsHref;
string v_linksWebhook_subscriptionsType;
string v_linksWebhook_subscriptionsResource_type;
string v_linksCustomersHref;
string v_linksCustomersType;
string v_linksCustomersResource_type;

v_linksAccountHref = jsonResponse.StringOf("_links.account.href");
v_linksAccountType = jsonResponse.StringOf("_links.account.type");
v_linksAccountResource_type = jsonResponse.StringOf("_links.account.resource-type");
v_linksEventsHref = jsonResponse.StringOf("_links.events.href");
v_linksEventsType = jsonResponse.StringOf("_links.events.type");
v_linksEventsResource_type = jsonResponse.StringOf("_links.events.resource-type");
v_linksWebhook_subscriptionsHref = jsonResponse.StringOf("_links.webhook-subscriptions.href");
v_linksWebhook_subscriptionsType = jsonResponse.StringOf("_links.webhook-subscriptions.type");
v_linksWebhook_subscriptionsResource_type = jsonResponse.StringOf("_links.webhook-subscriptions.resource-type");
v_linksCustomersHref = jsonResponse.StringOf("_links.customers.href");
v_linksCustomersType = jsonResponse.StringOf("_links.customers.type");
v_linksCustomersResource_type = jsonResponse.StringOf("_links.customers.resource-type");

Sample JSON Response Body

{
  "_links": {
    "account": {
      "href": "https://api-sandbox.dwolla.com/accounts/721c463c-c328-4467-882a-f1e5120700b0",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "account"
    },
    "events": {
      "href": "https://api-sandbox.dwolla.com/events",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "event"
    },
    "webhook-subscriptions": {
      "href": "https://api-sandbox.dwolla.com/webhook-subscriptions",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "webhook-subscription"
    },
    "customers": {
      "href": "https://api-sandbox.dwolla.com/customers",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "customer"
    }
  }
}