# SwaggerJsClient.ContactsApi

All URIs are relative to *http://localhost:8080/PRO2025EE/api/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**callDelete**](ContactsApi.md#callDelete) | **DELETE** /contacts/{Id} | Delete an existing contact with specified id
[**createContact**](ContactsApi.md#createContact) | **POST** /contacts | Create a new contact
[**getAddresses**](ContactsApi.md#getAddresses) | **GET** /contacts/{id}/addresses | Get addresses for a specified contact
[**getAllContacts**](ContactsApi.md#getAllContacts) | **GET** /contacts | Show all.
[**getOne**](ContactsApi.md#getOne) | **GET** /contacts/{id} | Show contact by id.
[**updateBranch**](ContactsApi.md#updateBranch) | **PUT** /contacts/{id} | Update an existing contact with specified id


<a name="callDelete"></a>
# **callDelete**
> callDelete(id)

Delete an existing contact with specified id



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.ContactsApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.callDelete(id, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="createContact"></a>
# **createContact**
> ContactDTO createContact(opts)

Create a new contact



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.ContactsApi();

var opts = { 
  'body': new SwaggerJsClient.ContactDTO() // ContactDTO | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createContact(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**ContactDTO**](ContactDTO.md)|  | [optional] 

### Return type

[**ContactDTO**](ContactDTO.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getAddresses"></a>
# **getAddresses**
> [AddressDTO] getAddresses(id)

Get addresses for a specified contact



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.ContactsApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getAddresses(id, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**|  | 

### Return type

[**[AddressDTO]**](AddressDTO.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getAllContacts"></a>
# **getAllContacts**
> [ContactDTO] getAllContacts(opts)

Show all.



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.ContactsApi();

var opts = { 
  'take': 56, // Number | 
  'skip': 56 // Number | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getAllContacts(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **take** | **Number**|  | [optional] 
 **skip** | **Number**|  | [optional] 

### Return type

[**[ContactDTO]**](ContactDTO.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getOne"></a>
# **getOne**
> getOne(id)

Show contact by id.



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.ContactsApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getOne(id, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="updateBranch"></a>
# **updateBranch**
> updateBranch(id, opts)

Update an existing contact with specified id



### Example
```javascript
var SwaggerJsClient = require('swagger-js-client');

var apiInstance = new SwaggerJsClient.ContactsApi();

var id = 56; // Number | 

var opts = { 
  'body': new SwaggerJsClient.ContactDTO() // ContactDTO | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateBranch(id, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **Number**|  | 
 **body** | [**ContactDTO**](ContactDTO.md)|  | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

