Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 963 Bytes

low_level_examples_java.md

File metadata and controls

46 lines (38 loc) · 963 Bytes

Low-level examples (Java)

GET /customers?limit=10&offset=20

Response<MyCustomers> res = dwolla.get(
    MyCustomers.class,
    "customers",
    new Query()
        .add("limit", 10)
        .add("offset", 20)
);

POST /customers

Response<String> res1 = dwolla.post(
    "customers",
    new JsonBody()
        .add("firstName", "Foo")
        .add("lastName", "Bar")
        .add("email", "[email protected]")
);
String customerUrl = res1.headers.get("location");
Response<MyCustomer> res2 = dwolla.get(MyCustomer.class, customerUrl);

POST /customers/:id/documents

File file = new File("/path/to/license.jpg");
Response<String> res = dwolla.post(
    customerUrl + "/documents",
    new MultipartBody(
        new InlineDataPart("license", "documentType"),
        new FileDataPart(file, "file")
    )
);

DELETE /customers/:id

dwolla.delete("customers/32363a5d-4cf5-4423-99cc-de09ca3cfcd3");