# CentresApi

All URIs are relative to *http://localhost:8889/api*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**getAll**](#getall) | **GET** /centres | Get centres|
|[**getById**](#getbyid) | **GET** /centres/{centreId} | Get centre|

# **getAll**
> Array<Centre> getAll()


### Example

```typescript
import {
    CentresApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new CentresApi(configuration);

let offset: number; //Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results (optional) (default to undefined)
let limit: number; //Pagination, the number of elements to retrieve, used in combination with offset to paginate results (optional) (default to undefined)
let paginationDetails: 'ON' | 'OFF'; //Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs (optional) (default to 'OFF')
let detailsLevel: 'BASIC' | 'FULL'; //The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. (optional) (default to undefined)
let branchId: string; //The branch ID the centre belongs to. (optional) (default to undefined)
let sortBy: string; //The criteria based on which the records will be sorted. Expected format is <field:order>, for example, sortBy = field1:ASC,field2:DESC.<br/>Only the following fields can be used: id,name, creationDate, lastModifiedDate<br/>Default sorting is done by  creationDate:DESC (optional) (default to undefined)

const { status, data } = await apiInstance.getAll(
    offset,
    limit,
    paginationDetails,
    detailsLevel,
    branchId,
    sortBy
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **offset** | [**number**] | Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results | (optional) defaults to undefined|
| **limit** | [**number**] | Pagination, the number of elements to retrieve, used in combination with offset to paginate results | (optional) defaults to undefined|
| **paginationDetails** | [**&#39;ON&#39; | &#39;OFF&#39;**]**Array<&#39;ON&#39; &#124; &#39;OFF&#39;>** | Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs | (optional) defaults to 'OFF'|
| **detailsLevel** | [**&#39;BASIC&#39; | &#39;FULL&#39;**]**Array<&#39;BASIC&#39; &#124; &#39;FULL&#39;>** | The level of details to return: &#x60;FULL&#x60; means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and &#x60;BASIC&#x60; will return only the first level elements of the object. | (optional) defaults to undefined|
| **branchId** | [**string**] | The branch ID the centre belongs to. | (optional) defaults to undefined|
| **sortBy** | [**string**] | The criteria based on which the records will be sorted. Expected format is &lt;field:order&gt;, for example, sortBy &#x3D; field1:ASC,field2:DESC.&lt;br/&gt;Only the following fields can be used: id,name, creationDate, lastModifiedDate&lt;br/&gt;Default sorting is done by  creationDate:DESC | (optional) defaults to undefined|


### Return type

**Array<Centre>**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Centres list returned. |  * Items-Limit - Pagination details, the requested page size <br>  * Items-Offset - Pagination details, the index of the first returned item <br>  * Items-Total - Pagination details, the total available items <br>  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getById**
> Centre getById()


### Example

```typescript
import {
    CentresApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new CentresApi(configuration);

let centreId: string; //The ID or encoded key of the centre to be returned. (default to undefined)
let detailsLevel: 'BASIC' | 'FULL'; //The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. (optional) (default to undefined)

const { status, data } = await apiInstance.getById(
    centreId,
    detailsLevel
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **centreId** | [**string**] | The ID or encoded key of the centre to be returned. | defaults to undefined|
| **detailsLevel** | [**&#39;BASIC&#39; | &#39;FULL&#39;**]**Array<&#39;BASIC&#39; &#124; &#39;FULL&#39;>** | The level of details to return: &#x60;FULL&#x60; means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and &#x60;BASIC&#x60; will return only the first level elements of the object. | (optional) defaults to undefined|


### Return type

**Centre**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Centre returned. |  -  |
|**400** | Bad request |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Centre not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

