All URIs are relative to https://connect.squareup.com
Method | HTTP request | Description |
---|---|---|
listLocations | GET /v2/locations | ListLocations |
ListLocationsResponse listLocations()
ListLocations
Provides the details for all of a business's locations. Most other Connect API endpoints have a required `location_id` path parameter. The `id` field of the `Location` objects returned by this endpoint correspond to that `location_id` parameter.
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.LocationsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
LocationsApi apiInstance = new LocationsApi();
try {
ListLocationsResponse result = apiInstance.listLocations();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LocationsApi#listLocations");
e.printStackTrace();
}
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json