# ContactApi

All URIs are relative to *http://../..*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**getContactById**](ContactApi.md#getcontactbyid) | **GET** /contacts/{uniqueIdentifier} | Get contact by unique identifier |
| [**searchContacts**](ContactApi.md#searchcontacts) | **GET** /contacts | Search contacts for a specific organization |



## getContactById

> ContactResultSchema getContactById(uniqueIdentifier, organizationId)

Get contact by unique identifier

### Example

```ts
import {
  Configuration,
  ContactApi,
} from '@equisoft/ucx-proxy-sdk-typescript';
import type { GetContactByIdRequest } from '@equisoft/ucx-proxy-sdk-typescript';

async function example() {
  console.log("🚀 Testing @equisoft/ucx-proxy-sdk-typescript SDK...");
  const config = new Configuration({ 
    // To configure OAuth2 access token for authorization: default accessCode
    accessToken: "YOUR ACCESS TOKEN",
  });
  const api = new ContactApi(config);

  const body = {
    // string | The unique identifier of a contact in the format SourceKey:ExternalId
    uniqueIdentifier: uniqueIdentifier_example,
    // string | The organization uuid to which the user belongs (optional)
    organizationId: organizationId_example,
  } satisfies GetContactByIdRequest;

  try {
    const data = await api.getContactById(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **uniqueIdentifier** | `string` | The unique identifier of a contact in the format SourceKey:ExternalId | [Defaults to `undefined`] |
| **organizationId** | `string` | The organization uuid to which the user belongs | [Optional] [Defaults to `undefined`] |

### Return type

[**ContactResultSchema**](ContactResultSchema.md)

### Authorization

[default accessCode](../README.md#default-accessCode)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Success |  -  |
| **400** | Invalid query parameters |  -  |
| **500** | An unexpected error happened. |  -  |

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


## searchContacts

> ContactResultSchema searchContacts(name, offset, limit, organizationId)

Search contacts for a specific organization

### Example

```ts
import {
  Configuration,
  ContactApi,
} from '@equisoft/ucx-proxy-sdk-typescript';
import type { SearchContactsRequest } from '@equisoft/ucx-proxy-sdk-typescript';

async function example() {
  console.log("🚀 Testing @equisoft/ucx-proxy-sdk-typescript SDK...");
  const config = new Configuration({ 
    // To configure OAuth2 access token for authorization: default accessCode
    accessToken: "YOUR ACCESS TOKEN",
  });
  const api = new ContactApi(config);

  const body = {
    // string | The name to search contacts by first name, last name, or middle name (optional)
    name: name_example,
    // number | The value to offset the results by. By default, the value is 0 (optional)
    offset: 56,
    // number | The maximum number of results to return. By default, the value is 100 (optional)
    limit: 56,
    // string | The organization uuid to which the user belongs (optional)
    organizationId: organizationId_example,
  } satisfies SearchContactsRequest;

  try {
    const data = await api.searchContacts(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **name** | `string` | The name to search contacts by first name, last name, or middle name | [Optional] [Defaults to `undefined`] |
| **offset** | `number` | The value to offset the results by. By default, the value is 0 | [Optional] [Defaults to `undefined`] |
| **limit** | `number` | The maximum number of results to return. By default, the value is 100 | [Optional] [Defaults to `undefined`] |
| **organizationId** | `string` | The organization uuid to which the user belongs | [Optional] [Defaults to `undefined`] |

### Return type

[**ContactResultSchema**](ContactResultSchema.md)

### Authorization

[default accessCode](../README.md#default-accessCode)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Success |  -  |
| **400** | Invalid query parameters |  -  |
| **500** | An unexpected error happened. |  -  |

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

