# Getting Started

Welcome to Acquire's developer documentation. This document provides powerful resources for interacting with Acquire and explains how to use API and Webhooks. Please contact us at: <developer@acquire.io>\
\
The Acquire Developer Portal enables you to utilize Acquire's real-time and historic conversation data, and communicate within your application. You'll find guides and community support to help you start working as quickly as possible!

## What do you want to do?

The [Acquire](https://acquire.io/) Developer Portal is divided into four different resources. These resources may be used to perform a wide range of tasks.

| **Resources**                         | **Description**                                                            |
| ------------------------------------- | -------------------------------------------------------------------------- |
| [WIDGET](/widget/overview)            | <p>Embed the widget into </p><p>your web page, customize it and more.</p>  |
| [SDK](/sdk/overview)                  | Build a unified experience for your mobile customers                       |
| [WEBHOOKS](/webhook-api/introduction) | Perform dynamic actions with webhooks.                                     |
| [REST APIs](/rest-apis/introduction)  | Retrieve, update, delete, and create resources based on various endpoints. |


# Overview

Acquire widget allows you to connect with website visitors, qualify leads, and support customers in real-time using all-in-one live chat software. Embed the widget software to get started. Learn more in our [installation](https://developer.acquire.io/widget/installation) guide.&#x20;


# Installation

Choose one of the following methods to install the widget.

### Copy code from Acquire

1. Log in to your Acquire account.
2. Go to **Settings.**&#x20;
3. Select **Installation and Setup** and click on **Web widget.**
4. You will be redirected to the **Widget Code** page.
5. To embed the **Acquire widget** on your website, copy the Javascript code snippet and paste it in the **Head** tag of your website.

### Copy code here

Alternatively, copy the code to the Head tag of your website. Replace {accountId} with your Acquire account ID.&#x20;

```
<!--  Widget Code -->
<script type="text/javascript">
((function(){
    window.acquire = window.acquire || [{s:Date.now()}];
    var load=function(){
        var script="https://{accountId}.acquire.io/widget.js";
        var x=document.createElement('script');
        x.src=script;x.async=true;
        var sx=document.getElementsByTagName('script')[0];
        sx.parentNode.insertBefore(x, sx);
    };
    if(document.readyState === "complete")
        load();
    else if (window.addEventListener)
        window.addEventListener('load',load,false);
    else if (window.attachEvent) {
        window.attachEvent("onload", load);
    }
})())
</script>
<noscript>
<a href="https://www.acquire.io?welcome" title="live chat software">Acquire</a></noscript>
<!-- / Widget Code -->
```


# Customization

The Acquire Widget functioning/customization allows you to line up your Acquire web widget with modifications like custom strings, color and provide some configuration options to the widget.

#### Settings

The Acquire widget has the following settings:

1. Greeting
2. Introduction
3. Conversation button
4. Conversation list title
5. Message Placeholder
6. Widget Appearance
   1. Launcher Text
   2. Widget Color
   3. Position

#### Methods

The Acquire chat component has the following methods:

1. Widget visibility
2. widget window state
3. Set Customer info
4. Get Customer info

#### Events

The Acquire chat component has the following events or callbacks:

1. onChatMaximize
2. onChatMinimize
3. onChatInitiated/Started
4. onChatClosed
5. onPrivateFormCapture
6. onWidgetHidden
7. onAgentAssign
8. onWidgetShown
9. onAgentStateChange (Online/Offline/Away)

![](https://files.readme.io/07e3de5-WidgetCustom.png)

#### &#x20;    &#x20;

**Agent avatars**

To set the agent avatar hide and show in the widget

Avatar show:

```
acquireIO.updateSettings({'crm.show_agent_avatars_widget':'yes'})        
```

Avatar hide:

```
acquireIO.updateSettings({'crm.show_agent_avatars_widget':'no'})
```


# Settings


# Greeting

To update the greeting text from the widget side

## Greeting Text Update

> Parameters Required to update the greeting text
>
> 1. Source ("Original Greeting Text Message")
> 2. Message("Provide the Message you want to update to")
> 3. Language("Provide the language code")

```
acquireIO.updateTranslated({source:”Support team”,message:”YOUR_MESSAGE”,language:”en”);
```


# Greeting Introduction

To update the greeting Introduction from the widget side

## Greeting Introduction

> Parameters Required to update the greeting Introduction text
>
> 1. Source ("Original Greeting Text Message")
> 2. Message("Provide the Message you want to update to")
> 3. Language("Provide the language code")

```
acquireIO.updateTranslated({source:”Ask us anything. We'd love to hear what brought you to here!”,message:”YOUR_MESSAGE”,language:”en”})
```


# Conversation button

To update the conversation button text from the widget side

## Conversation button

> Parameters Required to update the greeting Introduction text
>
> 1. Source("Original Greeting Text Message")
> 2. Message("Provide the Message you want to update to")
> 3. Language("Provide the language code")

```
acquireIO.updateTranslated({source:”New Conversation”,message:”YOUR_CONVERSATION_BUTTON”,language:”en”});
```


# Conversation list title

To update the conversation list title from the widget side

## Conversation list title

> Parameters Required to update the greeting Introduction text
>
> 1. Source("Original Greeting Text Message")
> 2. Message("Provide the Message you want to update to")
> 3. Language("Provide the language code")

```
acquireIO.updateTranslated({source:”Your Conversations”,message:”YOUR_CONVERSATION_TITLE”,language:”en”});
```


# Launcher Text

To update the launcher button text from the widget side

## Launcher Text

> Parameters Required to update the greeting Introduction text
>
> 1. Source("Original Greeting Text Message")
> 2. Message("Provide the Message you want to update to")
> 3. Language("Provide the language code")

```
acquireIO.updateTranslated({source:”Chat with us”,message:”LAUNCHER_TEXT”,language:”en”});
```


# Widget Appearance

You can customize the widget appearance according to your requirements.

**Widget Color**

Set the widget color

```
acquireIO.updateSettings({'crm.primary_color':'#fff000'})        
```

**Widget Position**

Set the widget position

To set widget position **Left side** :

```
acquireIO.updateSettings({'crm.widget_position':'bl'})
```

To set widget position **Right side**:

```
acquireIO.updateSettings({'crm.widget_position':'br'})  
```


# Methods


# Widget visibility

Change the visibility of the widget

> Pass the value to hide widget property as "yes" in case if you want to hide and "no" to make the widget appear

```
window.acquire = window.acquire || [];
acquire.push(function(app){
    app.applyAction("update-settings",{"crm.hide_widget_in_web":"no"});
})
```


# Widget window state

Change the window state save setting

> Pass the value to widget\_state property as "yes" in case if you want to hide and "no" to make the widget appear

```
window.acquire = window.acquire || [];
acquire.push(function(app){
    app.applyAction("update-settings",{"crm.widget_state_unsave":"no"});
})
```


# Set Customer Info

Visitor attributes are information about a visitor, such as their name, phone number, and email address. In Acquire, we use this information in a variety of places, including in their profiles.

[Learn more about visitor attributes->](https://help.acquire.io/for-administrators/capture-visitor-attributes)

### PHP&#x20;

```
<script type="text/javascript">
        /* Put visitor details programmatically. */
            window.acquire=window.acquire||[];
            acquire.push({
                fields: {
                    contact: {
                      name:<?php echo $value ?>,
                      email:<?php echo $value ?>,
                      phone:<?php echo $value ?>,
                      calling_code:<?php echo $value ?>,
                      source:<?php echo $value ?>,
                      city:<?php echo $value ?>,
                      state:<?php echo $value ?>,
                      countryid:<?php echo $value ?>,
                      address:<?php echo $value ?>,
                      location:<?php echo $value ?>,
                      contact_country_flag:<?php echo $value ?>
                   }, 
                   case: {
                      remark:<?php echo $value ?>
                   },
                   },
              lang:'<?php echo $language_code ?>' //LANGUAGE CODE
            })
</script>
```

### Rails (Ruby)

```
<script type="text/javascript">
        /* Put visitor details programmatically. */
            window.acquire=window.acquire||[];
            acquire.push({
                fields: {
                    contact: {
                      name:<%= value %>,
                      email:<%= value %>,
                      phone:<%= value %>,
                      calling_code:<%= value %>,
                      source:<%= value %>,
                      city:<%= value %>,
                      state:<%= value %>,
                      countryid:<%= value %>,
                      address:<%= value %>,
                      location:<%= value %>,
                      contact_country_flag:<%= value %>
                    },
                    case: {
                        remark:<%= value %>
                    },
                    },
                    lang:'<%= language_code %>' //LANGUAGE CODE
            })
</script>
```

### Django (Python)

```
<script type="text/javascript">
        /* Put visitor details programmatically. */
            window.acquire=window.acquire||[];
            acquire.push({
                fields :{
                    contact: {
                      name:{{ value }},
                      email:{{ value }},
                      phone:{{ value }},
                      calling_code:{{ value }},
                      source:{{ value }},
                      city:{{ value }},
                      state:{{ value }},
                      countryid:{{ value }},
                      address:{{ value }},
                      location:{{ value }},
                      contact_country_flag:{{ value }}
                    },
                    case: {
                      remark:{{ value }}
                    },
                    },
              lang:'{{ language_code }}' //LANGUAGE CODE
            })
</script>
```

###


# Get Customer info

To get the customer information

```
window.acquire = window.acquire || [];
acquire.push(function(app){
    app.myself();
});
```


# Events/Callbacks


# reloadUI

Reloading the UI from the acquire object

```
window.acquire = window.acquire || [];
acquire.push(function(app){
    app.reloadUI();
});
```


# onChatMaximize

Method to set the widget to max

Maximise the widget state

```
window.acquire = window.acquire || [];
 acquire.push(function(app){
     app.ui.status('max');
 });
```


# onChatMinimize

Method to set the widget to max

Minimise the widget state.

```
window.acquire = window.acquire || [];
 acquire.push(function(app){
     app.ui.status('min');
 });
```


# onChatInitiated/Started

Initiate the chat from the acquire object by maximize the widget state with parameter as Chat.

```
window.acquire = window.acquire || [];
acquire.push(function(app){
    app.max('chat');
});
```


# onChatClosed

Fire the event with the parameters getting from the close event with the acquire object

> The on function with event and callback helps to off the default close event and trigger helps to fire the event with the necessary parameters

```
window.acquire = window.acquire || [];
acquire.push(function(app){
    app.on('close',function(){console.log(arguments)});
    app.trigger('close',1,2,3);
})
```


# onAgentAssign

Update event on acquire object will be triggered after the agent accept the chat.

> The on function with event as update is to off the default behaviour when event occurs and trigger helps to manually fire the event update with the necessary parameters.

```
window.acquire = window.acquire || [];
acquire.push(function(app){
    app.on('update',function(){console.log(arguments)});
    app.trigger('update',1,2,3);
});
```


# onAgentStateChange (Available/Unavailable)

The state event triggers when the agent changes it's state to either available/unavailable

> The on function with event as state is to off the default behaviour when event occurs and trigger helps to manually fire the event update with the necessary parameters.

```
window.acquire = window.acquire || [];
acquire.push(function(app){
    app.on('state',function(){console.log(arguments)});
    app.trigger('state',1,2,3);
});
```


# Link resources


# Share channel link

Coming soon.


# \[Under Development] Overview

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

Learn how to get started with Acquire’s SDKs. We provide documentation for implementation with iOS and Android, as well as helpful methods for building chat, audio, and video functionality on the client-side.&#x20;

Click on the appropriate Setup Guide to get started. <br>

### Difference Between Lite and Core

| Lite      | Core                        |
| --------- | --------------------------- |
| Chat Only | <p>Chat/Audio/Video<br></p> |


# \[Under Development] iOS

SDK guide for iOS.


# \[Under Development] iOS Setup Guide

{% content-ref url="/pages/-LihNUIJNST-JuEdqFPO" %}
[\[Under Development\] Getting Started](/sdk/ios/sdk-setup-guide/getting-started)
{% endcontent-ref %}

{% content-ref url="/pages/-LihK6ezRCHFESrMrXaj" %}
[\[Under Development\] Integration Guide (Core)](/sdk/ios/sdk-setup-guide/integration-guide-core)
{% endcontent-ref %}

{% content-ref url="/pages/-LihKtYa4hkbdCRD-r7l" %}
[\[Under Development\] Integration Guide (Lite)](/sdk/ios/sdk-setup-guide/integration-guide-lite)
{% endcontent-ref %}


# \[Under Development] Getting Started

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

AcquirIO SDK provides you with many helpful methods to build the chat and audio/video chat from the client-side.

This page presents a quick overview of the SDK’s functionalities and logic, then lets you go through the easy steps of implementing AcquirIO SDK in your own app.

### Requirements

* iOS 13.0+
* XCode 12.5+

### Build variants

We are providing two types of build variants :

1. **Core** - Fully featured including Audio/Video calling. [See Integration](/sdk/ios/sdk-setup-guide/integration-guide-core)
2. **Lite** - All features excluding Audio/Video Calling. [See Integration](/sdk/ios/sdk-setup-guide/integration-guide-lite)

{% hint style="info" %}
So if you don't require calling feature, you can use **lite** version to reduce the app size.
{% endhint %}

You can use our native SDK in your project using [Cocoapods](/sdk/ios/sdk-setup-guide/integration-guide-core).


# \[Under Development] Integration Guide (Core)

This guide describes the process of implementing AcquireIOSupport Core SDK into your iOS app We recommend using CocoaPods as the most advanced way of managing iOS project dependencies.

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

## INSTALLATION

{% embed url="<https://youtu.be/Ern8XxMySgc>" %}

To connect AcquireIOSupport Core SDK to your iOS app just add it into your Podfile:

1\) Create a Podfile in your project's root directory, if it doesn't exist yet

2\) Add the **AcquireIOSupport-Core** in Podfile under your desired target:

```markup
target :YourTargetName do
      pod 'AcquireIOSupport-Core'
end
```

3\) The AcquireIOSupport SDK supports module stability and therefore all its dependencies must be built-in with the "Build Libraries for Distribution" setting enabled, however this is not currently supported in Cocoapods. Running the below command will ensure Xcode builds the dependencies with the correct settings. Once Cocoapods supports module stability, this workaround can be removed.

Add the following to the bottom of your Podfile:

```markup
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if ['TwilioVideo', 'Socket.IO-Client-Swift', 'Starscream'].include? target.name
      target.build_configurations.each do |config|
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
          config.build_settings['ENABLE_BITCODE'] = 'NO'
      end
    end
  end
end
```

4\) Run the below command to install the SDK to your project

```markup
bash

$ pod install --repo-update
```

5\) Open your project using the generated \*.xcworkspace file.

{% hint style="info" %}

#### **NOTE:** IF YOU ARE NEW TO COCOAPODS, GO TO [COCOAPODS](https://cocoapods.org/) TO LEARN HOW TO INSTALL IT. <a href="#note-if-you-are-new-to-cocoapods-go-to-cocoapods-to-learn-how-to-install-it" id="note-if-you-are-new-to-cocoapods-go-to-cocoapods-to-learn-how-to-install-it"></a>

{% endhint %}

Make sure to always open the Xcode workspace instead of the project file when building your project:

```markup
Open MyApp.xcworkspace
```

6\) Make sure to disable **bitcode** for your project: Go to your project's settings and find the **Build settings** tab, check **All** and search for **bitcode**, then set it to **No**.

![](/files/-MVG3NkYbMIqZvwcqp_9)

## SETUP INFO.PLIST

{% hint style="info" %}
&#x20;*Since iOS 10, it's mandatory to add before you access privacy-sensitive data like Camera, Microphone, and so on, you must ask for the authorization, or your app will crash when you access them.*
{% endhint %}

Open the file in your project named info.plist, right-click it, opening as Source Code, paste this code below to it. Or you can open info.plist as Property List by default, click the add button, Xcode will give you the suggested completions while typing Privacy - with the help of keyboard and&#x20;

Remember to write your description of  why you ask for this authorization, between and, or your app will be rejected by Apple:

```markup
<!-- Camera -->
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) use camera for video chat</string>

<!-- Microphone -->
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) use microphone for voice chat</string>

<!-- Photo Library -->
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) send photo/video to agent</string>
```

Also, The AcquireIOSupport SDK uses background mode Audio for when you are video/voice call to agent/visitor. If you have not enabled then background voice will not work. When the UIBackgroundModes key contains the audio value, the system’s media frameworks automatically prevent the corresponding app from being suspended when it moves to the background

To allow your AcquireIOSupport SDK to play audio in the background, Enable it using the below steps

1\) Select your project file in the Navigator of Xcode. 2) From the Capabilities section, switch on the **Background Modes** subsection 3) Switch **ON** the Background Modes subsection. After background modes are listed, tick on the *Audio, Airplay & picture in the picture*

![](/files/-McU2BkRrWxz9dQ-tWEf)


# \[Under Development] Integration Guide (Lite)

This guide describes the process of implementing AcquireIOSupport Lite SDK into your iOS app. We recommend using CocoaPods as the most advanced way of managing iOS project dependencies.

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

#### INSTALLATION <a href="#installation" id="installation"></a>

To connect AcquireIOSupport Lite SDK to your iOS app just add it into your Podfile:

1\) Create a Podfile in your project's root directory, if it doesn't exist yet.

2\) Add the **AcquireIOSupport-Lite** in Podfile under your desired target:

```

   target :YourTargetName do
      pod 'AcquireIOSupport-Lite’
   end

```

3\) The AcquireIOSupport SDK supports module stability and therefore all its dependencies must be built in with the "Build Libraries for Distribution" setting enabled, however this is not currently supported in Cocoapods. Running the below command will ensure Xcode builds the dependencies with the correct settings. Once Cocoapods supports module stability, this workaround can be removed.

Add the following to the bottom of your Podfile:

```
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if [ 'Socket.IO-Client-Swift', 'Starscream'].include? target.name
      target.build_configurations.each do |config|
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
          config.build_settings['ENABLE_BITCODE'] = 'NO'
      end
    end
  end
end
```

4\) Run the below command to install the SDK to your project.

```
bash

$ pod install --repo-update
```

5\) Open your project using the generated \*.xcworkspace file.

> #### **NOTE:** IF YOU ARE NEW TO COCOAPODS, GO TO [COCOAPODS](https://cocoapods.org/) TO LEARN HOW TO INSTALL IT. <a href="#note-if-you-are-new-to-cocoapods-go-to-cocoapods-to-learn-how-to-install-it" id="note-if-you-are-new-to-cocoapods-go-to-cocoapods-to-learn-how-to-install-it"></a>

Make sure to always open the Xcode workspace instead of the project file when building your project:

```
open YourTargetName.xcworkspace
```

6\) Make sure to disable **bitcode** for your project: Go to your project's settings and find the **Build settings** tab, check **All** and search for **bitcode**, then set it to **No**.

![](/files/-MVG3NkYbMIqZvwcqp_9)

#### SETUP INFO.PLIST <a href="#setup-infoplist" id="setup-infoplist"></a>

> *Since iOS 10, it's mandatory to add before you access privacy-sensitive data like Camera, Microphone, and so on, you must ask for the authorization, or your app will crash when you access them.*

Open the file in your project named info.plist, right-click it, opening as Source Code, paste this code below to it. Or you can open info.plist as Property List by default, click the add button, Xcode will give you the suggested completions while typing Privacy - with the help of keyboard and

Remember to write your description of why you ask for this authorization, between `<string>` and `</string>`, or your app will be rejected by Apple:

```
<!-- Camera -->
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) use camera for video chat</string>

<!-- Photo Library -->
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) send photo/video to agent</string>
```


# \[Under Development] Initialization

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

## Initialize AcquireSupport SDK

**Step 1: Get your Acquire Account ID**

You can find your `accountID` as shown in image below :

![Get Acquire Account ID](https://gblobscdn.gitbook.com/assets%2F-LMa9C05MmCnAr03_v9O%2F-MSgJ2mo03pc0Tx2-JgU%2F-MSgMvdRYwCkFXSrlxUd%2FNew_AccountID.png?alt=media\&token=336cc5fb-a565-4696-afde-ca6649f2142d)

**Step 2: Verify your users**

Make sure your users are who they claim to be with identity verification. Enforce identity verification to prevent other from pretend to be (third party) for entertainment or fraud logged-in users. Generate an `HMAC with SHA256` whenever a user logs into your app. Most web frameworks will have a method or library to help you do this.

You'll need your app’s secret key and the email of the currently logged-in user.

#### Secret Key

![User Authentication](https://gblobscdn.gitbook.com/assets%2F-LMa9C05MmCnAr03_v9O%2F-MSgJ2mo03pc0Tx2-JgU%2F-MSgN4xzhLsRp7Kd-JpY%2FNew_SecretKey.png?alt=media\&token=4a1f50ab-b260-4ec3-8406-9b67aea77cdb)

For example, in Ruby on Rails we can generate our HMAC using a method called `OpenSSL::HMAC.hexdigest`, where the first parameter is the name of a hash function (we use `SHA256`), the second is `YOUR_SECRET_KEY`, and the third is your `USER_EMAIL`.

> Keep your secret key safe! Never commit it directly to your repository, client-side code, or anywhere a third party can find it.

To set up identity verification, you'll need to generate an HMAC on your server for each logged-in user and set in acquireIOSupport SDK.

#### setVisitorIdentityFields

To set visitor identity for SDK, use `setVisitorIdentityFields` which takes identity parameters such as “email” and its value as an argument.

```
AcquireIO.support.setVisitorIdentityFields(["email":"xyz@abc.com"])
```

| Parameter | Type           | Description                               |
| --------- | -------------- | ----------------------------------------- |
| fields    | \[String: Any] | identified parameter as key and its value |

> `setVisitorIdentityFields()` must be called before **setAccount:** takes place and must pass same email as passed in `setVisitorDetails()`.

### startSession

You must call this method to start a session with Acquire server. After calling `startSession()`, the `AcquireIODelegate` the delegate will receive either `didChangeConnectionStatus:` or `onError:`

```
AcquireIO.support.startSession()
```

> **setAccount:** should be called first before calling above method

**Step 3: Setup Account**

To setup an account, call below method.

```
AcquireIO.support.setAccount("your_acquire_account_id", domain: "optional_testing_domain_url", withOptions: config)
```

| Parameter     | Type              | Description                                                                                                         |
| ------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------- |
| ACCOUNT\_ID   | String            | your account id from acquire dashboard from **Step 1**                                                              |
| domain        | String (Optional) | your testing domain url. (If not provided, default domain is Acquire Live Domain)                                   |
| configOptions | \[String : Any]   | config options. For more details on config options [Click here](https://developer.acquire.io/sdk/ios/theme-setting) |

#### showSupport

Calling this method will start a connection session with acquire server. After calling `showSupport()`, the `AcquireIODelegate` delegate will receive either `didChangeConnectionStatus:` or `onError:`

```
AcquireIO.support.showSupport(<viewcontroller_instance>)
```

| Parameter      | Type             | Description                                                            |
| -------------- | ---------------- | ---------------------------------------------------------------------- |
| viewController | UIViewController | instance of viewcontroller on which support button should be displayed |

> **setAccount:** should be called first before calling above method

#### loadAcquireIOSupportFonts

To load SDK's **default** Fonts, following method must be called before *setAccount:*

```
UIFont.loadAcquireIOSupportFonts
```

### User APIs

To customize visitor’s identification, you can call following sdk method to set the name, phone, email and fields of the app visitor. This is part of additional visitor configuration.

#### Set Visitor Details

Use this method before initialization of sdk otherwise it wont work.

```
func setVisitorDetails(_ data: [String: Any])
```

| Parameter | Type           | Description                                                                                |
| --------- | -------------- | ------------------------------------------------------------------------------------------ |
| data      | \[String: Any] | details of contact fields e.g.\["name":"abc","phone":"xxxxxxxx","email":"<abc@gmail.com>"] |

> Pass nil values for both name and email to clear out old existing values.

If this is provided through the api, user will not be prompted to re-enter this information again.

#### Update Visitor Details

Use this method after initialization of sdk otherwise it wont work.

```
func updateVisitorDetails(_ data: [String: Any])
```

| Parameter | Type           | Description                                                                                            |
| --------- | -------------- | ------------------------------------------------------------------------------------------------------ |
| data      | \[String: Any] | details of contact fields parameters. e.g.\["name":"abc","phone":"xxxxxxxx","email":"<abc@gmail.com>"] |

> Pass nil values for both name and email to clear out old existing values.

If this is provided through the api, user will not be prompted to re-enter this information again.

#### Logout visitor

If you have set visitor hash (HMAC digest) and visitor just logged out from account and need to manage user integrity with agent, call method `logoutVisitor()` to remove all acquire data from your app related to `visitorHash`. To `logout` from AcquireIOSupport, calling below method is mandatary:

```
AcquireIO.support.logoutVisitor()
```

### Methods

#### getVisitorId

To fetch visitorID after acquire session Connected. Returns `string`

```
let visitorID = AcquireIO.support.getVisitorID()
```

#### getAvailableAgentCount

To fetch total number of available agents. Returns `Int`.

```
let agentsAvailableCount = AcquireIO.support.getAvailableAgentCount()
```

#### getOnlineAgentIDs

To fetch agentIDs of online agents. Returns `[NSNumber]`.

```
let agentsIDs = AcquireIO.support.getOnlineAgentIDs()
```

#### dismissChatSupport

This optional method will dismiss the support view from the screen.

```
AcquireIO.support.dismissChatSupport()
```


# \[Under Development] Theme Setting

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

## Theme Settings

> Using `UIAppearance`
>
> UIAppearance customizations are applied to AcquireIOSupport SDK by default. However if there is a conflicting property, then the value in `ThemeOptions` key in `AcquireIOConfig` will take precedence.
>
> For example: If the app uses `UIAppearance` to change the color of Navigation Bar title and also specifies a color for the same property in the *AcquireIOConfig ThemeOptions* - NSDictionary, then the value in dictionary will be used.
>
> In order to use the UIAppearance value, the app must leave the corresponding entry in the `ThemeOptions` blank.

### Introduction

Head over to Theming if you want to customize your SDK integration's typeface, colors or fonts. It can be achieved via simple key-value pairs in option dictionary.

#### Configuration

Theme customization can be configured via `AcquireIOConfig` class:

```
let options = [String : Any]()
let config = AcquireIOConfig.config
config.setDict(options)

//Pass `config` to- setAccount: withOptions:config
```

Set *Dictionary* options in format of key-value. Color code will be hex value of color, start from #. You can remove and leave blank for default theme effect.

> Sample format for setting Config options:

```
let themeDict = [
                  "ACQUIREIO_GLOBAL": [
                      "THEME_COLOR":"#ff87b8"
                  ],
                  "ACQUIREIO_NAVIGATION_BAR": [
                      "BAR_STYLE": "UIBarStyleBlack",
                      "BAR_TINTCOLOR": "#ff87b8",
                      "TINT_COLOR": "#FFFFFF"
                  ],
                  "ACQUIREIO_BADGE_VIEW": [
                      "BACKGROUND_COLOR": "#ff0000",
                      "BORDER_COLOR": "#FE0319",
                      "TEXT_COLOR": "#ff0000"
                  ],
                  
                  "ACQUIREIO_SYSTEM_BUTTON": [
                      "BACKGROUND_COLOR": "#ff0000",
                      "BUTTON_INSET_BOTTOM": NSNumber(value: 100),
                      "BUTTON_INSET_RIGHT": NSNumber(value: 90)
                  ]
                ]

 let option = [ ...
                "ThemeOptions": themeDict
              ]
```

#### Config Options

Along with Theme settings, SDK supports following optional customization options.

```
 let option = [
                "ThemeOptions": themeDict,
                "ShowVideoButton": true,
                "ShowAudioButton": true,
                "ShowChatButton": true,            
                "isHideNewChat": false,
                "SessionConnectAndStartAuto": true,
                "disableAttachment": false,
                "ShowThreadList": true,
                "ButtonImageName": "chat.png",
                "ShowLocalNotificationInApp": true,
                "DisableNetworkMessage": false ] as [String : Any]
```

* `ShowVideoButton` : To show video call button in top bar of visitor's main chat messages screen. Default value is set to `true`.
* `ShowAudioButton` : To show audio call button in top bar of visitor's main chat messages screen. Default value is set to `true`.
* `ShowChatButton` : To hide support system button on bottom right of screen , set to `false` and it will hide the button but chat functionality will not be affected by this option. Default value set to `true`.
* `isHideNewChat` : if set to `true`, user won't be able to start new chat with agents. if set to `false`, user can start new chat with agents. Default value set to `false`.
* `SessionConnectAndStartAuto` : Session will be automatically connected to server and start, no need to invoke any additional method for start session. If you set `false`, then you must call `AcquireIO.support.startSession()` method to start new connection with server. Default value is set to `true`.
* `disableAttachment` : To disable uploading attachment to agents. Default value is set to `false`.
* `ShowThreadList` : To show list of sessions/threads. Default value is set to `true`.
* `ButtonImageName` : To set an Image for AcquireIOsupport chat system button. Custom Image should be put in main bundle of app. Image size 30x30 px, 60x60 px for @2x.
* `ShowLocalNotificationInApp` : To allow SDK to show in-app notification when app state is Active. Default value is `true`.
* `DisableNetworkMessage` : To disable showing “Please Check Internet Connection” message when there is no internet connectivity. Default value is set to `false`, which mean SDK will show this message if not specified in config options.

### Theme Settings

To skin your app, make sure you add AcquireIOConfig `ThemeOptions` key.

* Colors are specified in hexadecimal format, e.g. #FFFFFF is White. # is required before code.
* Font names should be specified by their family name & style. For example, **CaviareDreams-Bold** refers to **Caviare Dreams family** of **bold** style. See using custom fonts section below for more details.

#### Global Attribute

These attributes control the looks of in-app support over many screens.

| Property         | Description                                                                                                                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| THEME\_COLOR     | Applies theme color to whole support SDK according to your app theme. Default theme color is #3A6                                                       |
| FONT\_NAME       | Global font face - applies to texts for sections list, Chat list, Offline form and all. Default font is system font with size according to requirements |
| BOLD\_FONT\_NAME | Applies to headers on chat screen and title of pages. Default font is system bold font with size according to requirement                               |

#### Navigation Bar

| Property       | Description                                                                                                                                                                                  |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BAR\_STYLE     | Use UIBarStyleBlack or UIBarStyleDefault. Default bar style is UIBarStyleDefault                                                                                                             |
| BAR\_TINTCOLOR | The tint color to apply to the navigation bar background. This color is not made translucent by default unless you set the isTranslucent property to true. Default BAR\_TINTCOLOR is #FFFFFF |
| TINT\_COLOR    | The tint color is navigation title and back and other bar button items color. Default color is #000000                                                                                       |

#### System Button Attributes

These attributes applies on default bottom right support button.

| Property              | Description                                                                |
| --------------------- | -------------------------------------------------------------------------- |
| BACKGROUND\_COLOR     | Applies to background color of button. Default theme color is THEME\_COLOR |
| BUTTON\_INSET\_BOTTOM | Inset button from bottom in NSNumber. default bottom inset is 0.           |
| BUTTON\_INSET\_RIGHT  | Inset button from right in NSNumber. default right inset is 0.             |

#### System Badge Button Attributes

These attributes applies on default bottom right support button notification badge.

| Property          | Description                                                       |
| ----------------- | ----------------------------------------------------------------- |
| BACKGROUND\_COLOR | Applies to background color of button badge. Default color is red |
| BORDER\_COLOR     | Applies border to the badge button                                |
| TEXT\_COLOR       | Button badge color. Default color is #ffffff.                     |

#### Using Custom Fonts

**Step 1.** Add the font to your project. Edit your app's plist file and add a key "Fonts provided by application" to it. Under the key, list out file names of all the fonts you want to use in your app and in support. If you've already listed such fonts, skip this step.

![Add Custom Fonts](https://gblobscdn.gitbook.com/assets%2F-LMa9C05MmCnAr03_v9O%2F-LN9EeARIb0jlqCV5rMw%2F-LN9F1_w4tEq2jAlh6ye%2Ffont-screen.png?alt=media\&token=0683d74a-3780-4987-a517-2399008718c3)

**Step 2.** Copy the font's full name. To do this, select the font in Finder and hit `COMMAND` `⌘+I` (Get Info).

![Get full Name of the font](https://gblobscdn.gitbook.com/assets%2F-LMa9C05MmCnAr03_v9O%2F-LN9EeARIb0jlqCV5rMw%2F-LN9FCAVkyfSaMNtD3UV%2FfontName-screen.png?alt=media\&token=889e571b-effb-4059-aa0b-55346b3be3f2)

**Step 3.** Paste the font name into

Set AcquireIOConfig with `@"ThemeOptions" -> @"ACQUIREIO_GLOBAL" ->@"FONT_NAME""` , wherever necessary

![Add custom font in your themeOptions](https://gblobscdn.gitbook.com/assets%2F-LMa9C05MmCnAr03_v9O%2F-LNxYVHfRlIavnBiPh8X%2F-LNxeuBmaeWBQyOh1kJq%2Fimage-sample-code-config-dict.png?alt=media\&token=7828300b-bc6c-407b-b495-a7ae334b7996)


# \[Under Development] Acquire Delegates for iOS

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

## AcquireIOSupport iOS SDK Delegates

To add listeners provided by AcquireIOSupport SDK, add the following line on your class where you want to listen to our SDK events

```
AcquireIO.support.delegate = self
```

#### ConnectionStatusChange

This method will be called by SDK when connection status will change. The details of status that was updated during the connection will be available in the argument.

```
func didChangeConnectionStatus(status: AcquireIOConnectionStatus)
```

AcquireIOConnectionStatus - Connection session status

```
public enum AcquireIOConnectionStatus : Int {
    /// App support session connection status not connected.
    case notConnected = 0
    /// App support session connection status disconnected.
    case disconnected
    /// App support session connection status connecting.
    case connecting
    /// App support session connection status connected.
    case connected
    /// App support session connection status started.
    case sessionStarted
}
```

Once connection is established with Acquire server, the delegate will receive either didChangeConnectionStatus: or onError:.

#### onError

This function will provide connection related error i.e. invalid input data, expire data etc. To get more details about the error encountered while establishing connection, Implement below delegate method

```
func onError(error: Error)
```

#### onCallSupportStatusChange

When status of Audio/Video call with Agent changes SDK will call below method. The details of call status that was updated during the connection will be available in the arguments along with the optional message string. To get the call connection status, use

```
func onCallSupportStatusChange(_ status: AcquireIOCallSupportStatus, withMessage message: String?)
```

AcquireIOCallSupportStatus - Call status

```
public enum AcquireIOCallSupportStatus : Int {
    case notConnected
    case disconnected
    case connecting
    case connected
}
```

#### onAgentConnected

This will be called when agent is connected.

```
func onAgentConnected()
```

#### didChangeAgentStatus

This optional method will be called by SDK when Agent status changes. The details of agent `status` that was updated during the connection will be available in the argument along with `Agent ID`.

```
func didChangeAgentStatus(agentID: String, andStatus status: AcquireIOAgentStatus)
```

AcquireIOAgentStatus - Status for the agent.

```
public enum AcquireIOAgentStatus : Int {
    /// Online status for agent.
    case online = 0
    /// Offline status for agent.
    case offline
    /// Invisible status for agent.
    case invisible
}
```

#### didUserInteracted

This will be called when user interacts with events.

```
func didUserInteracted(withEvent type: AcquireIOInteractionEventType, withData data: [String : Any]?)
```

Event Types available are listed below:

```
public enum AcquireIOInteractionEventType : Int {
    case audioCallStarted = 0
    case videoCallStarted
    case audioCallAnswered
    case videoCallAnswered
    case callDeclined
    case callAutoDeclined
    case callerViewMinimize
    case callerViewMaximize
    case callerViewCameraSwitchToFront
    case callerViewCameraSwitchToBack
    case callSpeakerOn //10
    case callSpeakerOff
    case callMute
    case callUnmute
    case callVideoOn
    case callVideoOff
    case callDisconnected
    case conversationStart
    case conversationEnd
    case conversationFeedbackSubmit
}
```

> Note: For Lite version, only following events will be received

1. conversationStart
2. conversationEnd
3. conversationFeedbackSubmit

#### didReceiveTriggerEvent

This optional method will be called when fire rule matched for created Triggers from the agent panel. It will receive `eventName` as parameter

```
func didReceiveTriggerEvent(_ eventName: String)
```

#### openSupport

This optional method will be called when support view controller is open.

```
func didOpenAcquireSupport()
```

#### hideSupport

This optional method will be called when support view controller is dismissed.

```
func hideSupport()
```

#### didReceiveNewMessage

This optional method will be called by SDK when a new message has been received. The details of the message received will be available in the argument.

```
func didReceiveNewMessage(_ message: Any)
```


# \[Under Development] Widget customization

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

### CHANGE SDK UI COLOR

To customize the color/theme,

Go to `Settings -> Messenger Setup -> Chat Widget`

You can customize the SDK look and feel as per your requirement.

![](https://gblobscdn.gitbook.com/assets%2F-LMa9C05MmCnAr03_v9O%2F-MSgJ2mo03pc0Tx2-JgU%2F-MSgMz8gg2ZFynoQQ1uL%2FNew_WidgetCusomization.png?alt=media\&token=5d0a38ec-410f-4c76-af87-8864a7c463bf)

> If not provided, it will use default primary colors of the app.


# \[Under Development] React Native

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

## AcquireIO Support SDK

There are 2 variants for this SDK

1\) **AcquireIO support (Core)** for real-time chat and audio/video calls. \
2\) **AcquireIO support (Lite)** for real-time chat.

> **Note**: Lite version supports only chat feature. To use audio/video calls, Core version is available.

This guide describes the process of implementing AcquireIOSupport SDK into your **React-Native app.**

You can refer [react-native-doc](https://reactnative.dev/docs/native-modules-ios) to use Native components.

We recommend using [CocoaPods](https://cocoapods.org/) as the most advanced way of managing iOS project dependencies.

#### Installation

AcquireIOSupport SDK is the same as any other third-party native library.

To connect AcquireIOSupport SDK to your app just add it into your Podfile:

**Step 1.** Create a Podfile in your project's root directory, if it doesn't exist yet.

**Step 2.** Add below lines at top of your `podfile`

```javascript
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
```

**Step 3.**

* **AcquireIOSupport-Core** : Podname to add Core SDK to your project
* **AcquireIOSupport-Lite** : Podname to add Lite SDK to your project

Add `podname` to Podfile as per requirement under your desired target. It must look like below:

```
  target 'YourTargetName' do
  config = use_native_modules!

  # NOTE: For AcquireIOSupport-Core require dynamic frameworks
  use_frameworks!
  pod 'AcquireIOSupport-Core'

  use_react_native!(
     :path => config[:reactNativePath],
     # to enable hermes on iOS, change `false` to `true` and then install pods
     :hermes_enabled => false
   )

  end
```

**Note: use\_frameworks! is required to import any dynamic framework.**

**Step 4.** The AcquireIOSupport SDK supports **module stability** and therefore all its dependencies must be built-in with the **"Build Libraries for Distribution"** setting enabled, however this is not currently supported in Cocoapods. Running the below command will ensure Xcode builds the dependencies with the correct settings. Once Cocoapods supports module stability, this workaround can be removed.

Add the following at the end of your Podfile:

```bash
 post_install do |installer|
    react_native_post_install(installer)

     installer.pods_project.targets.each do |target|
       target.build_configurations.each do |config|
         config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
         config.build_settings['ENABLE_BITCODE'] = 'NO'
       end

     if (target.name&.eql?('FBReactNativeSpec'))
       target.build_phases.each do |build_phase|
         if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
           target.build_phases.move(build_phase, 0)
         end
       end
     end
   end
 end
```

4\) Run the below command to install the SDK to your project

```bash
      $ pod install --repo-update
```

5\) Open your project using the generated \*.xcworkspace file.

> #### **Note:** If you are new to CocoaPods, go to [CocoaPods](https://cocoapods.org/) to learn how to install it.

Make sure to always open the Xcode workspace instead of the project file when building your project:

```
open YourTargetName.xcworkspace
```

#### Setup Info.plist

> *Since iOS 10, it's mandatory to add before you access privacy-sensitive data like Camera, Microphone, and so on, you must ask for the authorization, or your app will crash when you access them.*

Open the file in your project named **info.plist**, right-click it, opening as *Source Code*, paste the below code to it. Or you can open info.plist as **Property List** by default, click the **add** button, Xcode will give you the suggested completions while typing `Privacy -` with the help of keyboard and

Remember to write your description of why you ask for this authorization, between `<string>` and `</string>`, or your app will be rejected by Apple:

```
<!-- Camera -->
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) uses camera for video chat</string>

<!-- Microphone -->
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) uses microphone for voice chat</string>

<!-- Photo Library -->
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) send photo/video to agent</string>
```

Also, The AcquireIOSupport SDK uses a background mode `Audio` when you are video/voice call to agent/visitor. If you have not enabled it, the background voice will not work. When the **UIBackgroundModes** key contains the audio value, the system’s media frameworks automatically prevent the corresponding app from being suspended when it moves to the background

To allow your AcquireIOSupport SDK to play audio in the background, Enable it using the below steps 1) Select your project file in the Navigator of Xcode. 2) From the Capabilities section, switch on the **Background Modes** subsection 3) Switch **ON** the Background Modes subsection. After background modes are listed, tick on the *Audio, Airplay & picture in the picture*

![Background Mode](https://s3.amazonaws.com/com.twilio.prod.twilio-docs/images/BackgroundModes.original.png)

### Setup and installation

* To import SDK to your project, add the below lines to your **App.js**

  ```
  //Native modules
  import {NativeModules} from 'react-native';
  //Destructuring AcquireIO Setup from NativeModules
  const {AcquireIOSetup} = NativeModules;
  ```

  And to use in your `FILENAME.m` file, add

  ```
  #import <AcquireIOSupport/AcquireIOSupport.h>
  ```
* To initialize SDK, call

  ```
      AcquireIOSetup.initAcquireIO()
  ```

Your `FILENAME.m` should look like:

```
#import "AcquireIOSetup.h"
#import <React/RCTLog.h>

@implementation AcquireIOSetup

RCT_EXPORT_MODULE(); // Use "AcquireIOSetup" as module's name


RCT_EXPORT_METHOD(initAcquireIO) {

  RCTLogInfo(@"Init AcquireIO");

  dispatch_async(dispatch_get_main_queue(), ^{

    //Config option
    NSDictionary *option = @{
                             @"ShowChatButton": @YES,
                             @"SessionConnectAndStartAuto":@YES  //@NO for manually start socket connection
                           };

    AcquireIOConfig *config = [AcquireIOConfig config];
    [config setDict:option];

    #warning(@"TODO: Add your ACCOUNT_ID (for example, xo3t0x)")
    [[AcquireIO support] setAccount:@"ACCOUNT_ID" withOptions:config];

    //[[AcquireIO support] startSession]; for manually start socket connection

  });

}

@end
```

* To know more about customization of AcquireIOSupport chat theme, Go to [Theme Customization](https://developer.acquire.io/v/2.0.0/sdk/ios/theme-setting).
* To know more about initialization methods, [click here](https://developer.acquire.io/v/2.0.0/sdk/ios/initialization).
* For AcquireIOSupport delegate methods, Go to [Delegate Methods](https://developer.acquire.io/v/2.0.0/sdk/ios/acquire-sdk-delegates).

### Demo App

* Check out our React-native demo app [here](https://drive.google.com/file/d/1BtggKOJyKK6vP_ZhoN1Agp6KqhwyDedC/view?usp=sharing).

### Contact us

* We're only a **message away!**. Feel free to contact us on [AcquireIO Support](https://acquire.io) for any queries you may have.


# \[Under Development] Android

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}


# \[Under Development] Android Setup Guide

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}


# \[Under Development] Getting Started

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

To know about our **android SDK**, check out our source code is available on [github](https://github.com/acquireio/android-sdk).

### Requirements

* Android Studio 3.0+
* Gradle 4.0+
* Android SDK 12.0+
* Android device running Android 9.0 or newer (To get fully functioning SDK)

### Build variants

We are providing two types of build variants :

1. **Core** - Fully featured including Audio/Video calling. [See Integration](/sdk/android/android-setup-guide/integration-guide#steps-to-integrate-acquire-android-sdk-core-are-as-follows)
2. **Lite** - All features excluding Audio/Video Calling. [See Integration](/sdk/android/android-setup-guide/integration-guide-lite#steps-to-integrate-acquire-android-sdk-lite-are-as-follows)

### Related pages:

{% content-ref url="/pages/-LOHPHQIxIVIcaBwZSAU" %}
[\[Under Development\] Integration Guide (Core)](/sdk/android/android-setup-guide/integration-guide)
{% endcontent-ref %}

{% content-ref url="/pages/-Lih1mZ4Celr4dTSqSDG" %}
[\[Under Development\] Integration Guide (Lite)](/sdk/android/android-setup-guide/integration-guide-lite)
{% endcontent-ref %}

{% content-ref url="/pages/-LMfyxqC8ftHhIX73aAL" %}
[\[Under Development\] Acquire Delegates for Android](/sdk/android/acquire-android-delegates)
{% endcontent-ref %}


# \[Under Development] Integration Guide (Core)

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

## **Steps to integrate Acquire android-sdk-core are as follows :**

Add the SDK to your project by including the following snippets in the **`build.gradle`** file:

**STEP 1 :**

Project level **`settings.gradle`** :

```
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        ...
        maven {
            url 'https://android-sdk.acquire.io/artifactory/libs-release/'
        }
    }
}
```

\
Module **`build.gradle`**:\
\
Add below dependencies ->

```
dependencies {
    implementation 'io.acquire:core-twilio-beta:1.+'
}
```

If you have added any of this dependency already then try to match the version.

**STEP 2 :**

Register Acquire SDK in the **onCreate()** method of an Activity/Application where you plan to use the SDK. Use the initialization details provided by the Acquire Support admin and an Application instance:

```
class AppName : Application() {
     override fun onCreate() {
     super.onCreate()
     AcquireApp.registerApp(this)
     AcquireApp.init(accountID)
   }
}
```

**STEP 3 :**&#x20;

Add the following to your manifest file:&#x20;

```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.sdkdemo">
    ...
    <application
        android:name=".AppName"
        ...
    </application>
</manifest>
```

#### STEP 4 :

Initialize Acquire SDK with **accountID** by using this method.&#x20;

{% hint style="warning" %}
This method will connect to the Acquire server in the background.
{% endhint %}

```javascript
AcquireApp.init(accountID)
```

To get the Demo app clone project from GitHub: [SDKs Guide](https://github.com/acquireio/android-sdk)

To know more about initialization options [click here](/sdk/android/acquire-sdk-apis).&#x20;

To get session events [click here](/sdk/android/acquire-android-delegates).&#x20;


# \[Under Development] Integration Guide (Lite)

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

## **Steps to integrate Acquire android-sdk-lite are as follows :**

**STEP 1 :**

Add the SDK to your project by including the following snippets in the **`build.gradle`** file:

Project level **`build.gradle`**:

```javascript
allprojects {
...
    repositories {
   // Add this lines
        maven {
                url "https://android-sdk.acquire.io/artifactory/libs-release/"
        }
    }
...
}
```

Module **`build.gradle`**:

```javascript
dependencies {
    implementation 'io.acquire:lite-beta:1.+'
}
```

If you have added any of this dependency already then try to match the version.

**STEP 2 :**

Register Acquire SDK in the **onCreate()** method of an Activity/Application where you plan to use the SDK. Use the initialization details provided by the Acquire Support admin and an Application instance:

```javascript
class XYZApp : Application() {
     override fun onCreate() {
     super.onCreate()
     AcquireApp.registerApp(this)
   }
}
```

#### STEP 3 :

Initialize Acquire SDK with **accountID** by using this method.&#x20;

{% hint style="warning" %}
This method will connect to the Acquire server in the background.
{% endhint %}

```javascript
AcquireApp.init(accountID)
```

&#x20;To get the Demo app clone project from GitHub: [SDKs Guide](https://github.com/acquireio/android-sdk)

To know more about initialization options [click here](/sdk/android/acquire-sdk-apis).&#x20;

To get session events [click here](/sdk/android/acquire-android-delegates).&#x20;


# \[Under Development] Acquire SDK APIs

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

### SDK APIs:

### Initiate Support Chat

Start chat module directly by calling **`startSupportChat()`**

```java
AcquireApp.startSupportChat()
```

This method is used to open chat. To use this method **AcquireApp** instance is needed. So use this method after successful initialization.

**Alternate Method :** **`startDirectSupportChat(callType: CallType)`**

```java
AcquireApp.startDirectSupportChat(CallType.VIDEO)
```

* **@param** **`callType`** - TEXT, AUDIO, VIDEO

Use this method to start direct Audio/Video call request to the agent. By this method, Audio/Video chat request will be visible to the agent and on the answer to that chat will start Audio/Video call as soon as the chat is connected.

### Get Visitor ID

Get Visitor ID using this method&#x20;

```
AcquireApp.getVisitorId()
```

### Logout Visitor

Logout will clear the current session and also gives a callback when the process is finished. After logout one has to initialize the SDK again to create a new session.&#x20;

```
AcquireApp.logOut { }
```


# \[Under Development] Acquire Delegates for Android

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

### Session Delegates&#x20;

#### To set session listener call sdk method :

```java
AcquireApp.setSessionListener(this);
```

1. **`onSessionConnected()`** Invokes on socket connection is established. One can open chat module after this event.
2. **`onSessionDisconnected(Reason: String)`** Invokes on socket connection is closed and chat is no longer available. ‘Reason’ will give the reason for the disconnection of the socket.
3. **`onAgentAvailable()`** Invokes on agent becomes available to chat.
4. **`onCallConnected()`** Invokes on direct Video/Audio call is connected to the agent.
5. **`onCallDIsconnected()`** Invokes on direct Video/Audio call is disconnected.
6. **`onTriggerEvent(eventName: String?)`** Invokes on custom trigger event has been set and clicked.
7. **`onChatClosed()`** Invokes on chat is closed by the agent.
8. **`noAgentAvailable();`** Invokes on all Agents become unavailable.
9. **`onWaitDialogAppear();`**&#x49;nvokes on Audio/Video call is requested by the user (visitor).
10. **`onWaitDialogDisappear();`** Invokes on agent answer the call request.


# \[Under Development] React Native

{% hint style="warning" %}
Our SDK is currently under review. Check back later for updates.
{% endhint %}

Acquire SDK can be easily integrated into React Native.

You can refer [react-native-doc](https://reactnative.dev/docs/native-modules-android) to use Native components.&#x20;

Acquire SDK is the same as any other third party native library&#x20;

You will need to add

```
allprojects {
...
    repositories {
   // Add this lines
        maven {
                url "https://android-sdk.acquire.io/artifactory/libs-release/"
        }
    }
...
}
```

this maven URL to your **project** level gradle.

And add this to your app **Module's** build.gradle

```
dependencies {
    implementation 'io.acquire:core-twilio-beta:1.+'
}
```

{% hint style="danger" %}
If you want to use the lite version then use the below configuration.
{% endhint %}

```
dependencies {
    implementation 'io.acquire:lite-beta:1.+'
}
```

Register Acquire SDK in the **onCreate()** method of an Activity/Application where you plan to use the SDK. Use the initialization details provided by the Acquire Support admin and an Application instance:

```
class XYZApp : Application() {
     override fun onCreate() {
     super.onCreate()
    AcquireApp.registerApp(this)
   }
}
```

Initialize Acquire SDK with **accountID** by using this method.&#x20;

{% hint style="warning" %}
This method will connect to the Acquire server in the background.
{% endhint %}

```javascript
AcquireApp.init(accountID)
```

**Permissions** \
We include the **INTERNET** permission by default as we need it to make network requests:

```
<uses-permission android:name="android.permission.INTERNET"/>
```

Needed below permissions to make audio/video calls.

```
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
```

Needed below permissions for attachments to share from the app.

```
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
```

{% hint style="success" %}
All the above **permissions** need to be mentioned in your **AndroidManifest** file.
{% endhint %}

You can download our demo react native [source code](https://drive.google.com/file/d/1Ga7vgi5Zg2BKSIDfc9FG-np8j5IqEFRR/view?usp=sharing).

To know more about initialization options [click here](/sdk/android/acquire-sdk-apis).&#x20;

To get session events [click here](/sdk/android/acquire-android-delegates).&#x20;


# Introduction

Instead of making an API call during an event, Acquire can send a request to the endpoint you configured. Respond with dynamic data or record data in other platforms by using webhooks.&#x20;

{% hint style="info" %}
&#x20;**Note**: The Settings section has the option to view, update and log all your webhooks. In Acquire, go to **Settings > For Developers > Webhooks** to get starte&#x64;**.**
{% endhint %}

Learn more about using webhooks in chatbots in our [help docs article](https://help.acquire.io/for-developers/webhooks-for-chatbots).&#x20;


# Getting Started

Acquire uses two types of webhook events:&#x20;

* **Inbound** - collects information from outside sources to be displayed within Acquire. Works with chatbots and during live chats.
* **Outbound** - collects information from within Acquire to be displayed in outside sources.

### Inbound

Once you've configured an inbound webhook in another system, you’ll need to create a reference to it in Acquire. To create a new webhook, go to **Settings > For Developers > Webhooks** and click on the **‘Create Webhook’** button.\
![](/files/Y9jtq4E9CDBfE3jjPkw8)

Provide a new name for your webhook in the ‘Webhook Name’ field. Then, select **Inbound** in the ‘Webhook Flow’ section.&#x20;

Next, set the format, status, security preferences, and email address. Should your webhook fail, a notification will be sent to the email address provided.

![](/files/cNS66YjREFYRCv0GUAb4)

Paste the webhook URL. Once pasted, you’ll be able to set variables. &#x20;

![](/files/TmjWRxbdVpHHO5GUhz2X)

Set a fallback JSON response under “Fallback response, when webhook URL fails”. The system will try to get a response from the original webhook URL three times. If the system does not get a valid response by then, it will send the fallback response.

The “Available Variables” section will list variables if system identifies the variables from the URL response, if it does not list any variables you may add your own variable

To add custom variable names, click on the **‘Add more variables’** option.&#x20;

(You'll need to do this when using more than one special webhook).\
\
Then, press on **‘Create’.**

Your inbound webhook is now ready!

### Outbound

Once you've configured an outbound webhook in another system, you’ll need to create a reference to it in Acquire. To create a new webhook, go to **Settings > For Developers > Webhooks** and click on the **‘Create Webhook’** button.

Provide a new name for your webhook in the ‘Webhook Name’ field. Then, select **Outbound** in the ‘Webhook Flow’ section.&#x20;

Next, set your format, status, and security preferences as well as an email address. Should your webhook fail, a notification will be sent to the email address provided.

![Select Outbound in 'Webhook Flow'. ](/files/-MbcO-YpcRZNY_OKmWrk)

Paste your webhook URL. The Case and Operator Trigger Events sections will appear. Select the events that you'd like to set your webhook triggers to. The trigger events are:&#x20;

* Case new - triggers on new case&#x20;
* Case status is set to Active - triggers when the case status is changed to active
* Case status is set to Closed - triggers when the case status is changed to closed&#x20;
* *Under development:* On Agent status change - triggers when agents change their status to active/inactive (Under development. We'll get back to you when this trigger is ready).&#x20;

Press **‘Create’.**

Your outbound webhook is now ready!


# Securing Webhook

#### Securing Webhook and Signature Hash validation <a href="#securing-webhook-and-signature-hash-validation" id="securing-webhook-and-signature-hash-validation"></a>

When a webhook is configured, a unique signature key is generated and given in the webhook response. The value of this header is an HMAC-SHA256. This signature key is used to sign the webhook payloads, which are sent to your endpoint with the signature key name `x-acquire-signature`.

[See the Getting Started Guide in our Help Docs.](https://help.acquire.io/for-developers/hmac-for-webhooks)

**Your HMAC/Secret Key**

When you create a new webhook you have to allocate/add HMAC/Secret Key.

**Verify Signature -**

All outbound requests keep a hash authenticated header key using the standard SHA256 hash in the header `x-acquire-signature`. To verify the signature on your server generate a SHA256 hash and compare it with the hash sent in the Acquire header `x-acquire-signature`. You will need the HMAC/Secret Key that you provided in the webhook creation.

**Verify Signature example nodejs code:**

```
validateSignature = (secret, body, signature) => {
    // Create a SHA256 hashed code using the HMAC/Secret key and update the hash with body using utf8
    var signatureComputed = crypto.createHmac('SHA256', secret).update(
        new Buffer(JSON.stringify(body), 'utf8')).digest('hex');
    return (signatureComputed === signature);
};
```


# Webhook Events

With events, you can filter what kind of events you want to subscribe to. These events work with outbound webhooks.

| WEBHOOK TRIGGER EVENTS        | DESCRIPTION                                                                                                                                                                                                                                                                |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Chat status is set to Pending | *Coming Soon!* Activates when the chat state is Pending.                                                                                                                                                                                                                   |
| Chat status is set to Active  | Activates when the chat state is Active.                                                                                                                                                                                                                                   |
| Chat status is set to Queue   | *Coming Soon!* Activates when chat state is Queue.                                                                                                                                                                                                                         |
| Chat status is set to Closed  | Activates when chat state is Closed.                                                                                                                                                                                                                                       |
| Agent Status Change           | <p><em>Coming Soon!</em> This indicates that when an agent's status is updated,</p><p>the agent status captures</p><p>(available, unavailable, </p><p>Chat-chat channel is turned on, </p><p>Email-email channel is turned on, </p><p>VOIP-VOIP channel is turned on).</p> |
| Case new                      | Activates when a new case is added.                                                                                                                                                                                                                                        |


# Introduction

Welcome to [Acquire](http://acquire.io/) developer documentation. This document provides instructions for interacting with our API. For questions, contact us at <developer@acquire.io>. <developer@acquire.io>


# Request Types, Permissions, Errors, & Limits

### CREATING REQUESTS

According to RESTful structure, Acquire implements the following HTTP verbs:\
\
`GET -` Read entity\
`POST -` Create new entity\
`PUT -` Modify existing entity\
`DELETE -` Remove entity

## PERMISSIONS

To request any API endpoint, you will need a valid API key with the related access permissions.

Learn more about obtaining an API key and access permissions in the [Authorization](https://developer.acquire.io/rest-apis/authorization) section.&#x20;

## Errors <a href="#errors" id="errors"></a>

Errors are returned using standard HTTP error codes.

In general, the list of error codes includes:<br>

| Code | Explanation                    |
| ---- | ------------------------------ |
| 2xx  | Success                        |
| 4xx  | Bad request sent to the server |
| 5xx  | Server-side error              |

### STATUS CODES

`200 OK` Successful request.\
`400 Bad Request` Returns JSON with the error message.\
`401 Unauthorized` Couldn’t authenticate your request.\
`403 Forbidden` Invalid request.\
`404 Not Found` No such object.\
`500 Internal Server Error` Something went wrong.\
`503 Service Unavailable` Service is down for maintenance.

| Types                          | Code | Explanation                            |
| ------------------------------ | ---- | -------------------------------------- |
| `ERROR_INVALID_INPUT`          | 400  | Invalid request                        |
| `ERROR_RECORD_NOT_FOUND`       | 400  | No credentials in the request body     |
| `ERROR_DUPLICATE_RECORD_FOUND` | 400  | Already exists                         |
| `ERROR_UNAUTHORIZED`           | 401  | Missing, incorrect, or invalid API Key |
| `ERROR_UNAUTHORIZED_ACCESS`    | 403  | Invalid request                        |
| `ERROR_SERVER_ERROR`           | 500  | Internal server error                  |

## API Limit <a href="#api-limit" id="api-limit"></a>

There are no API consumption limits.


# Authorization

All requests to Acquire's API require an **API\_KEY**. Authentication is provided by the API\_KEY. To create or delete an API\_KEY, log in to Acquire and go t&#x6F;**`Settings > For Developers > API Key`**\
\
**Authentication example**\
Include this HTTP header for each API request:

`Authorization: Bearer ${API_KEY}`

**Header Name:** Authorization\
**Header Value:** Bearer {{API\_KEY}}

Note: *Please make sure there is a space between the Bearer and API KEY.*

### **Sample Code**

```javascript
curl --request GET 'https://{{account_id}}.acquire.io/api/v1/account/department' \
--header 'Authorization: Bearer ${API_KEY}'
```

### **How to Generate an API\_KEY**

{% hint style="danger" %}
Make sure you have the necessary permissions to generate an **API\_KEY**.
{% endhint %}

Follow the steps to generate an API\_KEY:

1. Log in to your Acquire account.
2. Navigate to `Settings > For Developers > API Key`.
3. Click on 'Create API Key' and enter a token name and select your token permissions.
4. Click on 'Next'. An API\_KEY will be generated.
5. Copy the API\_KEY and secure it in a safe location. You will not be able to display it again if you misplace it.
6. Once done, close the menu.

![Settings > For Developers > API Key](/files/-MVzvWPLJPsguYna66jd)

{% hint style="warning" %}

#### Save Your API\_KEY

There is no way to display your API\_KEY after closing the menu. Secure it in a safe location before exiting the screen.
{% endhint %}

{% hint style="success" %}
All API requests must be over HTTPS.&#x20;
{% endhint %}

### Revoking an API KEY&#x20;

Following steps to revoke API Key

1. Log in to your Acquire account.
2. Navigate to `Settings > For Developers > API Key`
3. In the 'Action' column, click on the ellipsis ('...') and select 'Delete'.
4. A confirmation will display. Click on 'Delete API Key' to delete the key.

![Delete API KEY](/files/-MW-Ae13f3BwGU6ps-xn)

{% hint style="danger" %}

### Delete Carefully

Deleting an API\_KEY cannot be undone, so delete with caution.
{% endhint %}


# Conversation

A collection of threads is a group of messages. A conversation is a record of messages with a contact and agent(s).


# Cases

Any interaction with a contact creates a case in Acquire.

The Case or Thread API can be used to send, retrieve, update, and delete messages (Chat, Email, VOIP) from a conversation.

### Attributes&#x20;

| ATTRIBUTE    | TYPE                                 | DESCRIPTION                                           |
| ------------ | ------------------------------------ | ----------------------------------------------------- |
| id           | Integer                              | Specify the ID of the case.                           |
| title        | String                               | Specify the case title.                               |
| description  | String                               | Specify the case description.                         |
| channel      | String                               | Specify the case channel.                             |
| status       | String                               | Specify the case status such as active, close, etc.   |
| threadId     | Integer                              | Specify the case threading id or parent id.           |
| closingState | String                               | Specify the operating system version.                 |
| dateQueue    | datetime                             | Specify the case queue date.                          |
| datePending  | datetime                             | Specify the case pending date.                        |
| dateActive   | datetime                             | Specify the case active date.                         |
| dateClosed   | datetime                             | Specify the case close date.                          |
| userId       | Integer                              | Specify the third-party initiated app id of the case. |
| waitTime     | String                               | Specify the case wait time.                           |
| contact      | JSON Array Object (Entity Relations) | Specify the case contact.                             |
| feedbacks    | JSON Array Object (Entity Relations) | Specify the case feedbacks.                           |
| messages     | JSON Array Object (Entity Relations) | Specify the case messages.                            |
| users        | JSON Array Object (Entity Relations) | Specify the case users.                               |
| timeline     | JSON Array Object (Entity Relations) | Specify the contact's time details                    |
| fields       | JSON object (Entity Relations)       | Information about case fields.                        |
| dateCreated  | datetime                             | Case creation timestamp                               |
| dateUpdated  | datetime                             | Case updated timestamp                                |

### **Permissions**

To request a case endpoint, you will need a valid API key with case access permissions.

### **Relations between case and other entities**

Cases are associated with message, contact, feedbacks, and timeline.&#x20;


# Messages

Message threads are conversations between agents and contacts.

Message threads are used to organize messages while keeping users engaged.


# Retrieve a list of messages

Retrieve a list of messages.

## Get message list

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/chat/messages?contactId={{contactId}}&threadId={{threadId}}`

Retrieve a list of messages. The following query parameters must be present: **threadId** and **contactId**.

#### Query Parameters

| Name         | Type    | Description                                                               |
| ------------ | ------- | ------------------------------------------------------------------------- |
| -x-user-type | string  | Send this parameter with a value of "contact" to send messages to Acquire |
| threadId     | integer | ID of the thread.                                                         |
| contactId    | integer | ID of the customer/contact.                                               |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "dateCreated": "2021-04-13T05:22:19.000Z",
            "dateUpdated": "2021-04-13T12:17:02.000Z",
            "id": 854,
            "contactId": 750940,
            "closedBy": null,
            "visitId": 222,
            "title": "#750940  : hi",
            "description": "lk",
            "channel": "chat",
            "status": "active",
            "closingState": "handled",
            "dateQueue": "2021-04-13T05:22:19.000Z",
            "datePending": "2021-04-13T05:22:19.000Z",
            "dateActive": "2021-04-13T05:22:23.000Z",
            "dateClosed": null,
            "queueId": null,
            "queueOrder": 0,
            "parentId": null,
            "userId": null,
            "waitTime": 4,
            "cases": [],
            "users": [
                {
                    "id": 2126,
                    "caseId": 854,
                    "type": "user",
                    "userId": 12,
                    "role": "owner",
                    "status": "active",
                    "dateCreated": "2021-04-13T05:22:18.000Z",
                    "dateLastAssigned": "2021-04-13T05:22:19.000Z",
                    "closed": "no",
                    "meta": null,
                    "user": {
                        "roles": [],
                        "id": 12,
                        "name": "vivek",
                        "firstName": "vivek",
                        "lastName": "",
                        "photo": "",
                        "email": "vivek@acquire.io",
                        "clientId": "",
                        "parentId": 0,
                        "type": "user",
                        "accessLevel": null
                    }
                },
                {
                    "id": 2125,
                    "caseId": 854,
                    "type": "contact",
                    "userId": 750940,
                    "role": "owner",
                    "status": "active",
                    "dateCreated": "2021-04-13T05:22:18.000Z",
                    "dateLastAssigned": "2021-04-13T05:22:18.000Z",
                    "closed": "no",
                    "meta": null,
                    "user": {
                        "type": "contact",
                        "id": 750940,
                        "name": "#750940",
                        "photo": null
                    }
                }
            ],
            "threadId": 854,
            "lastMessage": {
                "id": 3391,
                "caseId": 854,
                "channel": "chat",
                "senderId": 12,
                "senderType": "user",
                "type": "message",
                "message": "lk",
                "dateCreated": "2021-04-13T12:17:02.000Z",
                "dateUpdated": null,
                "seen": "no",
                "meta": {}
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Retrieve a message

Get a single message based on its ID

## Get

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/case-message/{{messageId}}`

Retrieve a single message by passing its **messageId** in to the endpoint as a path parameter.&#x20;

#### Path Parameters

| Name                                        | Type    | Description       |
| ------------------------------------------- | ------- | ----------------- |
| messageId<mark style="color:red;">\*</mark> | integer | ID of the message |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "id": 8285,
    "caseId": 2068,
    "channel": "chat",
    "senderId": 1,
    "senderType": "user",
    "type": "message",
    "message": "hijk",
    "dateCreated": "2021-03-30T15:15:52.000Z",
    "dateUpdated": "2021-03-30T15:16:02.000Z",
    "seen": "no",
    "meta": {},
    "sender": {
      "roles": [],
      "id": 1,
      "name": "David Guetta",
      "firstName": "David Guetta",
      "lastName": "",
      "photo": "",
      "email": "user@example.com",
      "clientId": "",
      "parentId": 0,
      "type": "user",
      "accessLevel": null
    }
  }
}
```

{% endtab %}
{% endtabs %}


# Send a message

Add a new message via a channel

## Send Chat Message

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/chat/add-message`

Send a chat message to a conversation. To send a message to a contact, you must pass a `"message"` object. Only active cases may receive messages via the API.\
\
`"type"`, `"message"`, and `"caseId"` are required keys in the message object. See example body below. You can also add `translateLangKey` to the message object for message translation.\
\
**caseId** - You can retrieve caseId from a Webhook, by sending a GET request to the Retrieve a list of messages endpoint or from the Acquire Dashboard.\
\
**Type** - This indicates the type of message. There are three options: message, note, and event. Set `"type"` to `"message"` to send a chat message.<br>

#### Query Parameters

| Name                                        | Type    | Description                                                                                                                                                                                        |
| ------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| x-user-type                                 | string  | Specifies the type user/contact. If adding as an agent, then use 'user'. If adding  if message needs to be added from agent then it is user and if it is to be added from agent then it is contact |
| contactId<mark style="color:red;">\*</mark> | integer | Specify the contact ID                                                                                                                                                                             |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                      | Type    | Description                             |
| ----------------------------------------- | ------- | --------------------------------------- |
| translateLangKey                          | string  | HTML ISO language code                  |
| caseId<mark style="color:red;">\*</mark>  | integer | The case ID                             |
| message                                   | string  | The chat message you would like to send |
| type<mark style="color:red;">\*</mark>    | string  | "message"                               |
| message<mark style="color:red;">\*</mark> | object  | message object                          |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "channel": "chat",
        "senderType": "user",
        "senderId": 25,
        "type": "message",
        "seen": "no",
        "message": "Hey added from the api",
        "meta": {
            "additionalProp1": {}
        },
        "dateCreated": "2021-03-30T16:05:46.000Z",
        "case": {
            "dateCreated": "2021-03-30T16:04:10.000Z",
            "dateUpdated": "2021-03-30T16:04:11.000Z",
            "id": 2069,
            "closedBy": null,
            "visitId": 1379,
            "title": "#597759 has just started a chat",
            "description": "fdgdfgd",
            "channel": "chat",
            "status": "active",
            "closingState": "handled",
            "dateQueue": "2021-03-30T16:04:10.000Z",
            "datePending": "2021-03-30T16:04:10.000Z",
            "dateActive": "2021-03-30T16:04:10.000Z",
            "dateClosed": null,
            "queueId": null,
            "queueOrder": null,
            "meta": {},
            "parentId": 1875,
            "userId": null,
            "waitTime": 0,
            "contact": {
                "dateCreated": "2021-03-26T08:34:29.000Z",
                "dateUpdated": "2021-03-30T16:04:10.000Z",
                "id": 597759,
                "clientType": "web",
                "clientName": "Chrome",
                "clientVersion": "87.0",
                "clientOsName": "Linux",
                "clientOsVersion": "x86_64",
                "clientDeviceType": "Desktop",
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "clientDetails": {
                    "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36",
                    "engine": {
                        "name": "Blink",
                        "version": "87.0.4280.66"
                    },
                    "network": {
                        "type": "3g",
                        "speed": "2.3400000000000003"
                    }
                },
                "meta": {},
                "archive": "no",
                "companyId": null
            },
            "users": [
                {
                    "id": 4607,
                    "caseId": 2069,
                    "type": "user",
                    "userId": 1,
                    "role": "owner",
                    "status": "active",
                    "dateCreated": "2021-03-30T16:04:10.000Z",
                    "dateLastAssigned": "2021-03-30T16:04:10.000Z",
                    "closed": "no",
                    "meta": null,
                    "user": {
                        "roles": [],
                        "id": 1,
                        "name": "David Guetta",
                        "firstName": "David Guetta",
                        "lastName": "",
                        "photo": "",
                        "email": "user@example.com",
                        "clientId": ""
                    }
                },
                {
                    "id": 4606,
                    "caseId": 2069,
                    "type": "contact",
                    "userId": 597759,
                    "role": "owner",
                    "status": "active",
                    "dateCreated": "2021-03-30T16:04:10.000Z",
                    "dateLastAssigned": "2021-03-30T16:04:10.000Z",
                    "closed": "no",
                    "meta": null,
                    "user": {
                        "type": "contact",
                        "id": 597759,
                        "name": "#597759",
                        "photo": null
                    }
                }
            ],
            "threadId": 1875
        },
        "sender": {
            "roles": [],
            "id": 25,
            "name": "a",
            "firstName": "a",
            "lastName": "",
            "photo": "",
            "email": "",
            "clientId": "",
            "parentId": 0,
            "type": "user",
            "accessLevel": null
        },
        "dateUpdated": null,
        "id": 8289,
        "caseId": 2069,
        "threadId": 1875,
        "contactId": 597759
    }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
  "channel": "chat",
  "message": {
    "type": "message",
    "message": "Hey added from the api",
    "translateLangKey": "en"
  },
  "caseId": 9
}
```

## Send Mail Message

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/mail/add-message`

Send an email message. The email address in the "To" attribute must be an inbox connected to Acquire. See body example below of required attributes.

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                          | Type    | Description                             |
| --------------------------------------------- | ------- | --------------------------------------- |
| htmlBody<mark style="color:red;">\*</mark>    | string  | the email message                       |
| type<mark style="color:red;">\*</mark>        | string  | "message"                               |
| subject<mark style="color:red;">\*</mark>     | string  | the subject of the email                |
| bcc<mark style="color:red;">\*</mark>         | array   | blind carbon copy email addresses       |
| cc<mark style="color:red;">\*</mark>          | array   | carbon copy email addresses             |
| from<mark style="color:red;">\*</mark>        | string  | your Acquire-connected email address    |
| to<mark style="color:red;">\*</mark>          | array   | an array of recipients' email addresses |
| contactId<mark style="color:red;">\*</mark>   | integer | the contact's ID                        |
| caseId<mark style="color:red;">\*</mark>      | integer | the case's ID                           |
| data<mark style="color:red;">\*</mark>        | object  | data object                             |
| attachments<mark style="color:red;">\*</mark> | array   | attachments array                       |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 407,
        "caseMessageId": 407,
        "channelId": null,
        "caseId": 90,
        "inboxId": 1,
        "mailId": 1,
        "type": "message",
        "senderType": "user",
        "senderId": 93,
        "to": [
            {
                "Name": "",
                "Email": "developer@acquire.io"
            }
        ],
        "from": {
            "Name": "test",
            "Email": "surendra@acquire.io",
            "MailboxHash": ""
        },
        "cc": [],
        "bcc": [],
        "reply_to": null,
        "subject": "test",
        "textBody": "test api email\n\nOn Mon, Sep 14 2020, at 05:00 PM<\"surendra@acquire.io\"> wrote:test\n\nOn Mon, Sep 14 2020, at 04:36 PM<\"surendra@acquire.io\"> wrote:yrety",
        "htmlBody": "<div class=\"content-writer\" data-reactroot=\"\">test api email</div><div class=\"acq-content hide\" data-reactroot=\"\"><br><br><div>On Mon, Sep 14 2020, at 05:00 PM&lt;\"surendra@acquire.io\"&gt; wrote:</div><blockquote><div class=\"content-writer\" data-reactroot=\"\">test</div><div class=\"acq-content hide\" data-reactroot=\"\"><br><br><div>On Mon, Sep 14 2020, at 04:36 PM&lt;\"surendra@acquire.io\"&gt; wrote:</div><blockquote>yrety</blockquote></div></blockquote></div>",
        "mailboxMessageId": "0.5345358743514836",
        "messageId": null,
        "mailboxInReplyTo": "<c89eb634-612c-45af-8edf-7e06d425833f@mtasv.net>",
        "originalRecipient": "developer@acquire.io",
        "parentId": 14,
        "attachments": [],
        "dateCreated": "2021-03-12T09:21:20.000Z",
        "dateSeen": null,
        "dateBounce": null,
        "dateFailed": null,
        "dateDelivery": null,
        "seen": "no",
        "isDraft": "no",
        "scheduleAt": "2021-03-12T09:21:20.000Z",
        "meta": null,
        "clickedDate": null,
        "unsubscribeDate": null,
        "appMessageId": null,
        "appThreadId": null,
        "user": {
            "departments": [],
            "roles": [],
            "id": 93,
            "name": "test",
            "firstName": "test",
            "lastName": "",
            "photo": "",
            "email": "",
            "clientId": "",
            "parentId": 0,
            "metaDetails": {
                "isBotClient": false,
                "label": ""
            },
            "type": "user",
            "accessLevel": null
        },
        "sender": {
            "type": "user",
            "id": 93,
            "name": "test",
            "email": "",
            "photo": ""
        },
        "mailMsgId": 13
    }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
    "data": {
        "caseId": 1128,
        "to": [
            "user@gmail.com"
        ],
        "from": "test@acquire.io",
        "cc": [],
        "bcc": [],
        "subject": "test",
        "contactId": 9156860,
        "type": "message", 
        "textBody": "this is the text body",
        "htmlBody": "This is the message body",
        "attachments": []
    }
}
```

## Send SMS

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/voip/send-sms`

Send a message through an SmS channel. You must have a phone number connected to your Acquire account. To find the threadId and timelineId, send a GET rquest to Retrieve a list of messages or to Case List where ID={{contactId}}.&#x20;

#### Query Parameters

| Name          | Type   | Description                                                                                                                                    |
| ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization | string | Bearer {{api\_key}}                                                                                                                            |
| x-user-type   | string | Specifies the type user/contact if message needs to be added from agent then it is user and if it is to be added from agent then it is contact |

#### Request Body

| Name       | Type    | Description                                                                    |
| ---------- | ------- | ------------------------------------------------------------------------------ |
| From       | string  | The phone number in your Acquire platform (must include country and area code) |
| To         | string  | The contact's phone number (must include country and area code)                |
| contactId  | integer | The contact's ID                                                               |
| Body       | string  | The message you intend to send                                                 |
| threadId   | integer | The case ID                                                                    |
| timelineId | integer | The thread's timeline ID                                                       |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "cas": {
      "dateCreated": "2021-04-01T16:31:44.000Z",
      "dateUpdated": "2021-04-01T16:31:48.000Z",
      "id": 2219,
      "contactId": 751069,
      "closedBy": null,
      "visitId": 1424,
      "title": "#751069 has just started a chat",
      "description": "This thread has been reactivated.|translate",
      "channel": "chat",
      "status": "active",
      "closingState": "handled",
      "dateQueue": "2021-04-01T16:31:44.000Z",
      "datePending": "2021-04-01T16:31:44.000Z",
      "dateActive": "2021-04-01T16:31:44.000Z",
      "dateClosed": null,
      "queueId": null,
      "queueOrder": null,
      "meta": {
        "contact": {
          "id": 751069,
          "meta": {},
          "fields": {
            "ip": "2402:8100:21f3:1066:2ced:44dd:d071:88a3",
            "city": "",
            "phone": "919666929552",
            "state": "",
            "country": {
              "lat": "38",
              "lng": "-97",
              "cca2": "US",
              "cca3": "USA",
              "ccn3": "84",
              "name": "United States",
              "region_id": 496,
              "voip_enable": true,
              "calling_code1": 1,
              "name_official": "United States of America"
            },
            "countryId": "517"
          },
          "archive": "no",
          "companyId": null,
          "clientName": "Chrome",
          "clientType": "web",
          "dateCreated": "2021-04-01T13:10:25.000Z",
          "dateUpdated": "2021-04-01T16:31:44.000Z",
          "clientOsName": "Linux",
          "clientDetails": {
            "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36",
            "engine": {
              "name": "Blink",
              "version": "87.0.4280.66"
            },
            "network": {
              "type": "3g",
              "speed": "2.43"
            }
          },
          "clientVersion": "87.0",
          "clientOsVersion": "x86_64",
          "clientDeviceType": "Desktop",
          "clientDeviceModel": null,
          "clientDeviceVendor": null
        },
        "timeline": {
          "id": 2108,
          "meta": {},
          "caseId": 2219,
          "noteId": null,
          "viewId": null,
          "archive": "no",
          "threadId": 2207,
          "contactId": 751069,
          "objectType": "case",
          "dateCreated": "2021-04-01T13:11:02.000Z",
          "dateUpdated": "2021-04-01T16:31:44.000Z"
        },
        "is_new_contact": false
      },
      "parentId": 2207,
      "userId": null,
      "waitTime": 0,
      "users": [
        {
          "id": 6240,
          "caseId": 2219,
          "type": "user",
          "userId": 28,
          "role": "owner",
          "status": "active",
          "dateCreated": "2021-04-01T16:31:44.000Z",
          "dateLastAssigned": "2021-04-01T16:31:44.000Z",
          "closed": "no",
          "meta": null,
          "user": {
            "roles": [],
            "id": 28,
            "name": "myuser",
            "firstName": "myuser",
            "lastName": "",
            "photo": "",
            "email": "myuser@acquire.io",
            "clientId": "",
            "meta": {
              "fields": {
                "onboard_setup": {
                  "structValue": {
                    "fields": {
                      "install": {
                        "boolValue": false,
                        "kind": "boolValue"
                      },
                      "welcome": {
                        "boolValue": false,
                        "kind": "boolValue"
                      },
                      "setupMail": {
                        "boolValue": false,
                        "kind": "boolValue"
                      },
                      "setupVoip": {
                        "boolValue": false,
                        "kind": "boolValue"
                      },
                      "setupAppStore": {
                        "boolValue": false,
                        "kind": "boolValue"
                      },
                      "setupSocialApp": {
                        "boolValue": false,
                        "kind": "boolValue"
                      }
                    }
                  },
                  "kind": "structValue"
                }
              }
            },
            "parentId": 0,
            "type": "user",
            "accessLevel": null
          }
        },
        {
          "id": 6239,
          "caseId": 2219,
          "type": "contact",
          "userId": 751069,
          "role": "owner",
          "status": "active",
          "dateCreated": "2021-04-01T16:31:44.000Z",
          "dateLastAssigned": "2021-04-01T16:31:44.000Z",
          "closed": "no",
          "meta": null,
          "user": {
            "type": "contact",
            "id": 751069,
            "name": "#751069",
            "photo": null
          }
        }
      ],
      "timeline": {
        "id": 2108,
        "objectType": "case",
        "caseId": 2219,
        "viewId": null,
        "noteId": null,
        "threadId": 2207,
        "dateCreated": "2021-04-01T13:11:02.000Z",
        "dateUpdated": "2021-04-01T16:31:48.000Z",
        "contactId": 751069,
        "archive": "no",
        "meta": {}
      },
      "threadId": 2207
    },
    "threadId": 2219,
    "timeline": {
      "id": 2108,
      "objectType": "case",
      "threadId": 2207,
      "dateCreated": "2021-04-01T13:11:02.000Z",
      "dateUpdated": "2021-04-01T16:35:05.000Z",
      "contactId": 751069,
      "archive": "no",
      "meta": {},
      "case": {
        "dateCreated": "2021-04-01T16:31:44.000Z",
        "dateUpdated": "2021-04-01T16:35:05.000Z",
        "id": 2219,
        "contactId": 751069,
        "closedBy": null,
        "visitId": 1424,
        "title": "#751069 has just started a chat",
        "description": "This thread has been reactivated.|translate",
        "channel": "chat",
        "status": "active",
        "closingState": "handled",
        "dateQueue": "2021-04-01T16:31:44.000Z",
        "datePending": "2021-04-01T16:31:44.000Z",
        "dateActive": "2021-04-01T16:31:44.000Z",
        "dateClosed": null,
        "queueId": null,
        "queueOrder": null,
        "meta": {
          "contact": {
            "id": 751069,
            "meta": {},
            "fields": {
              "ip": "2402:8100:21f3:1066:2ced:44dd:d071:88a3",
              "city": "",
              "phone": "919666929552",
              "state": "",
              "country": {
                "lat": "38",
                "lng": "-97",
                "cca2": "US",
                "cca3": "USA",
                "ccn3": "84",
                "name": "United States",
                "region_id": 496,
                "voip_enable": true,
                "calling_code1": 1,
                "name_official": "United States of America"
              },
              "countryId": "517"
            },
            "archive": "no",
            "companyId": null,
            "clientName": "Chrome",
            "clientType": "web",
            "dateCreated": "2021-04-01T13:10:25.000Z",
            "dateUpdated": "2021-04-01T16:31:44.000Z",
            "clientOsName": "Linux",
            "clientDetails": {
              "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36",
              "engine": {
                "name": "Blink",
                "version": "87.0.4280.66"
              },
              "network": {
                "type": "3g",
                "speed": "2.43"
              }
            },
            "clientVersion": "87.0",
            "clientOsVersion": "x86_64",
            "clientDeviceType": "Desktop",
            "clientDeviceModel": null,
            "clientDeviceVendor": null
          },
          "timeline": {
            "id": 2108,
            "meta": {},
            "caseId": 2219,
            "noteId": null,
            "viewId": null,
            "archive": "no",
            "threadId": 2207,
            "contactId": 751069,
            "objectType": "case",
            "dateCreated": "2021-04-01T13:11:02.000Z",
            "dateUpdated": "2021-04-01T16:31:44.000Z"
          },
          "is_new_contact": false
        },
        "parentId": 2207,
        "userId": null,
        "waitTime": 0,
        "users": [
          {
            "id": 6240,
            "caseId": 2219,
            "type": "user",
            "userId": 28,
            "role": "owner",
            "status": "active",
            "dateCreated": "2021-04-01T16:31:44.000Z",
            "dateLastAssigned": "2021-04-01T16:31:44.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "roles": [],
              "id": 28,
              "name": "myuser",
              "firstName": "myuser",
              "lastName": "",
              "photo": "",
              "email": "myuser@acquire.io",
              "clientId": "",
              "meta": {
                "fields": {
                  "onboard_setup": {
                    "structValue": {
                      "fields": {
                        "install": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "welcome": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupMail": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupVoip": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupAppStore": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupSocialApp": {
                          "boolValue": false,
                          "kind": "boolValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  }
                }
              },
              "parentId": 0,
              "type": "user",
              "accessLevel": null
            }
          },
          {
            "id": 6239,
            "caseId": 2219,
            "type": "contact",
            "userId": 751069,
            "role": "owner",
            "status": "active",
            "dateCreated": "2021-04-01T16:31:44.000Z",
            "dateLastAssigned": "2021-04-01T16:31:44.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "type": "contact",
              "id": 751069,
              "name": "#751069",
              "photo": null
            }
          },
          {
            "id": 6214,
            "caseId": 2207,
            "type": "user",
            "userId": 1,
            "role": "owner",
            "status": "rejected",
            "dateCreated": "2021-04-01T13:15:06.000Z",
            "dateLastAssigned": "2021-04-01T13:15:06.000Z",
            "closed": "yes",
            "meta": null,
            "user": {
              "roles": [],
              "id": 1,
              "name": "David Guetta",
              "firstName": "David Guetta",
              "lastName": "",
              "photo": "",
              "email": "user@example.com",
              "clientId": "",
              "meta": {
                "fields": {
                  "onboard_setup": {
                    "structValue": {
                      "fields": {
                        "install": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "welcome": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupMail": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupVoip": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupAppStore": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupSocialApp": {
                          "boolValue": false,
                          "kind": "boolValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  },
                  "productUpdate": {
                    "structValue": {
                      "fields": {
                        "data": {
                          "listValue": {
                            "values": []
                          },
                          "kind": "listValue"
                        },
                        "lastSeenArticleLength": {
                          "numberValue": 0,
                          "kind": "numberValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  }
                }
              },
              "parentId": 0,
              "type": "user",
              "accessLevel": null
            }
          },
          {
            "id": 6213,
            "caseId": 2207,
            "type": "user",
            "userId": 28,
            "role": "owner",
            "status": "assigned",
            "dateCreated": "2021-04-01T13:11:02.000Z",
            "dateLastAssigned": "2021-04-01T13:11:02.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "roles": [],
              "id": 28,
              "name": "myuser",
              "firstName": "myuser",
              "lastName": "",
              "photo": "",
              "email": "myuser@acquire.io",
              "clientId": "",
              "meta": {
                "fields": {
                  "onboard_setup": {
                    "structValue": {
                      "fields": {
                        "install": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "welcome": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupMail": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupVoip": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupAppStore": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupSocialApp": {
                          "boolValue": false,
                          "kind": "boolValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  }
                }
              },
              "parentId": 0,
              "type": "user",
              "accessLevel": null
            }
          },
          {
            "id": 6212,
            "caseId": 2207,
            "type": "contact",
            "userId": 751069,
            "role": "owner",
            "status": "active",
            "dateCreated": "2021-04-01T13:11:02.000Z",
            "dateLastAssigned": "2021-04-01T13:11:02.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "type": "contact",
              "id": 751069,
              "name": "#751069",
              "photo": null
            }
          },
          {
            "id": 6217,
            "caseId": 2208,
            "type": "user",
            "userId": 1,
            "role": "owner",
            "status": "rejected",
            "dateCreated": "2021-04-01T13:20:05.000Z",
            "dateLastAssigned": "2021-04-01T13:20:05.000Z",
            "closed": "yes",
            "meta": null,
            "user": {
              "roles": [],
              "id": 1,
              "name": "David Guetta",
              "firstName": "David Guetta",
              "lastName": "",
              "photo": "",
              "email": "user@example.com",
              "clientId": "",
              "meta": {
                "fields": {
                  "onboard_setup": {
                    "structValue": {
                      "fields": {
                        "install": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "welcome": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupMail": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupVoip": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupAppStore": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupSocialApp": {
                          "boolValue": false,
                          "kind": "boolValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  },
                  "productUpdate": {
                    "structValue": {
                      "fields": {
                        "data": {
                          "listValue": {
                            "values": []
                          },
                          "kind": "listValue"
                        },
                        "lastSeenArticleLength": {
                          "numberValue": 0,
                          "kind": "numberValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  }
                }
              },
              "parentId": 0,
              "type": "user",
              "accessLevel": null
            }
          },
          {
            "id": 6216,
            "caseId": 2208,
            "type": "user",
            "userId": 28,
            "role": "owner",
            "status": "assigned",
            "dateCreated": "2021-04-01T13:15:56.000Z",
            "dateLastAssigned": "2021-04-01T13:15:57.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "roles": [],
              "id": 28,
              "name": "myuser",
              "firstName": "myuser",
              "lastName": "",
              "photo": "",
              "email": "myuser@acquire.io",
              "clientId": "",
              "meta": {
                "fields": {
                  "onboard_setup": {
                    "structValue": {
                      "fields": {
                        "install": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "welcome": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupMail": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupVoip": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupAppStore": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupSocialApp": {
                          "boolValue": false,
                          "kind": "boolValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  }
                }
              },
              "parentId": 0,
              "type": "user",
              "accessLevel": null
            }
          },
          {
            "id": 6215,
            "caseId": 2208,
            "type": "contact",
            "userId": 751069,
            "role": "owner",
            "status": "active",
            "dateCreated": "2021-04-01T13:15:56.000Z",
            "dateLastAssigned": "2021-04-01T13:15:56.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "type": "contact",
              "id": 751069,
              "name": "#751069",
              "photo": null
            }
          },
          {
            "id": 6220,
            "caseId": 2209,
            "type": "user",
            "userId": 1,
            "role": "owner",
            "status": "rejected",
            "dateCreated": "2021-04-01T13:35:05.000Z",
            "dateLastAssigned": "2021-04-01T13:35:05.000Z",
            "closed": "yes",
            "meta": null,
            "user": {
              "roles": [],
              "id": 1,
              "name": "David Guetta",
              "firstName": "David Guetta",
              "lastName": "",
              "photo": "",
              "email": "user@example.com",
              "clientId": "",
              "meta": {
                "fields": {
                  "onboard_setup": {
                    "structValue": {
                      "fields": {
                        "install": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "welcome": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupMail": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupVoip": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupAppStore": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupSocialApp": {
                          "boolValue": false,
                          "kind": "boolValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  },
                  "productUpdate": {
                    "structValue": {
                      "fields": {
                        "data": {
                          "listValue": {
                            "values": []
                          },
                          "kind": "listValue"
                        },
                        "lastSeenArticleLength": {
                          "numberValue": 0,
                          "kind": "numberValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  }
                }
              },
              "parentId": 0,
              "type": "user",
              "accessLevel": null
            }
          },
          {
            "id": 6219,
            "caseId": 2209,
            "type": "user",
            "userId": 28,
            "role": "owner",
            "status": "assigned",
            "dateCreated": "2021-04-01T13:31:22.000Z",
            "dateLastAssigned": "2021-04-01T13:31:23.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "roles": [],
              "id": 28,
              "name": "myuser",
              "firstName": "myuser",
              "lastName": "",
              "photo": "",
              "email": "myuser@acquire.io",
              "clientId": "",
              "meta": {
                "fields": {
                  "onboard_setup": {
                    "structValue": {
                      "fields": {
                        "install": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "welcome": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupMail": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupVoip": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupAppStore": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupSocialApp": {
                          "boolValue": false,
                          "kind": "boolValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  }
                }
              },
              "parentId": 0,
              "type": "user",
              "accessLevel": null
            }
          },
          {
            "id": 6218,
            "caseId": 2209,
            "type": "contact",
            "userId": 751069,
            "role": "owner",
            "status": "active",
            "dateCreated": "2021-04-01T13:31:22.000Z",
            "dateLastAssigned": "2021-04-01T13:31:22.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "type": "contact",
              "id": 751069,
              "name": "#751069",
              "photo": null
            }
          }
        ],
        "fields": {},
        "threadId": 2207,
        "lastMessage": {
          "id": 8651,
          "caseId": 2219,
          "channel": "chat",
          "senderId": 28,
          "senderType": "user",
          "type": "event",
          "message": "This thread has been reactivated.|translate",
          "dateCreated": "2021-04-01T16:31:44.000Z",
          "dateUpdated": null,
          "seen": "yes",
          "meta": {}
        },
        "tags": [],
        "channels": [
          "voip"
        ],
        "msgUnread": 0
      },
      "note": null,
      "view": null,
      "snooze": []
    },
    "data": {
      "members": [],
      "message": "SMS by myuser",
      "msgType": "sms",
      "channelType": "voip",
      "attachments": [],
      "id": 339,
      "caseId": 2219,
      "from": "+12513188609",
      "to": "+919666929552",
      "voip_account_id": 3,
      "senderType": "user",
      "senderId": 28,
      "type": "sms",
      "recording_status": null,
      "meta": {
        "To": "+919666929552",
        "to": "+919666929552",
        "SMS": "hi",
        "sid": "SMf7dc149c12e54cbd9864d543ac8bd041",
        "uri": "/2010-04-01/Accounts/ACf83886e81f434fe02812d132ab8790ce/Messages/SMf7dc149c12e54cbd9864d543ac8bd041.json",
        "Body": "hi",
        "From": "+12513188609",
        "body": "hi",
        "from": "+12513188609",
        "price": null,
        "status": "queued",
        "dateSent": null,
        "numMedia": "0",
        "MediaMeta": [],
        "direction": "outbound-api",
        "errorCode": null,
        "priceUnit": "USD",
        "accountSid": "ACf83886e81f434fe02812d132ab8790ce",
        "apiVersion": "2010-04-01",
        "dateCreated": "2021-04-01T16:35:05.000Z",
        "dateUpdated": "2021-04-01T16:35:05.000Z",
        "numSegments": "1",
        "errorMessage": null,
        "subresourceUris": {
          "media": "/2010-04-01/Accounts/ACf83886e81f434fe02812d132ab8790ce/Messages/SMf7dc149c12e54cbd9864d543ac8bd041/Media.json"
        },
        "messagingServiceSid": null
      },
      "call_transcript": 0,
      "caseMessageId": 8653,
      "timelineId": 2108,
      "contactId": 751069,
      "seen": "yes",
      "dateCreated": "2021-04-01T16:35:05.000Z",
      "call_answered": null,
      "call_end": null,
      "call_sid": "SMf7dc149c12e54cbd9864d543ac8bd041",
      "status": "sent",
      "call_status": null,
      "conferenceId": null,
      "price": "0",
      "sender": {
        "departments": [],
        "roles": [],
        "id": 28,
        "name": "myuser",
        "firstName": "myuser",
        "lastName": "",
        "photo": "",
        "email": "myuser@acquire.io",
        "clientId": "",
        "meta": {
          "fields": {
            "onboard_setup": {
              "structValue": {
                "fields": {
                  "install": {
                    "boolValue": false,
                    "kind": "boolValue"
                  },
                  "welcome": {
                    "boolValue": false,
                    "kind": "boolValue"
                  },
                  "setupMail": {
                    "boolValue": false,
                    "kind": "boolValue"
                  },
                  "setupVoip": {
                    "boolValue": false,
                    "kind": "boolValue"
                  },
                  "setupAppStore": {
                    "boolValue": false,
                    "kind": "boolValue"
                  },
                  "setupSocialApp": {
                    "boolValue": false,
                    "kind": "boolValue"
                  }
                }
              },
              "kind": "structValue"
            }
          }
        },
        "parentId": 0,
        "metaDetails": {
          "isBotClient": false,
          "label": ""
        },
        "type": "user",
        "accessLevel": null
      },
      "is_new_case": false,
      "is_new_contact": false,
      "cas": {
        "dateCreated": "2021-04-01T16:31:44.000Z",
        "dateUpdated": "2021-04-01T16:35:05.000Z",
        "id": 2219,
        "contactId": 751069,
        "closedBy": null,
        "visitId": 1424,
        "title": "#751069 has just started a chat",
        "description": "This thread has been reactivated.|translate",
        "channel": "chat",
        "status": "active",
        "closingState": "handled",
        "dateQueue": "2021-04-01T16:31:44.000Z",
        "datePending": "2021-04-01T16:31:44.000Z",
        "dateActive": "2021-04-01T16:31:44.000Z",
        "dateClosed": null,
        "queueId": null,
        "queueOrder": null,
        "meta": {
          "contact": {
            "id": 751069,
            "meta": {},
            "fields": {
              "ip": "2402:8100:21f3:1066:2ced:44dd:d071:88a3",
              "city": "",
              "phone": "919666929552",
              "state": "",
              "country": {
                "lat": "38",
                "lng": "-97",
                "cca2": "US",
                "cca3": "USA",
                "ccn3": "84",
                "name": "United States",
                "region_id": 496,
                "voip_enable": true,
                "calling_code1": 1,
                "name_official": "United States of America"
              },
              "countryId": "517"
            },
            "archive": "no",
            "companyId": null,
            "clientName": "Chrome",
            "clientType": "web",
            "dateCreated": "2021-04-01T13:10:25.000Z",
            "dateUpdated": "2021-04-01T16:31:44.000Z",
            "clientOsName": "Linux",
            "clientDetails": {
              "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36",
              "engine": {
                "name": "Blink",
                "version": "87.0.4280.66"
              },
              "network": {
                "type": "3g",
                "speed": "2.43"
              }
            },
            "clientVersion": "87.0",
            "clientOsVersion": "x86_64",
            "clientDeviceType": "Desktop",
            "clientDeviceModel": null,
            "clientDeviceVendor": null
          },
          "timeline": {
            "id": 2108,
            "meta": {},
            "caseId": 2219,
            "noteId": null,
            "viewId": null,
            "archive": "no",
            "threadId": 2207,
            "contactId": 751069,
            "objectType": "case",
            "dateCreated": "2021-04-01T13:11:02.000Z",
            "dateUpdated": "2021-04-01T16:31:44.000Z"
          },
          "is_new_contact": false
        },
        "parentId": 2207,
        "userId": null,
        "waitTime": 0,
        "users": [
          {
            "id": 6240,
            "caseId": 2219,
            "type": "user",
            "userId": 28,
            "role": "owner",
            "status": "active",
            "dateCreated": "2021-04-01T16:31:44.000Z",
            "dateLastAssigned": "2021-04-01T16:31:44.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "roles": [],
              "id": 28,
              "name": "myuser",
              "firstName": "myuser",
              "lastName": "",
              "photo": "",
              "email": "myuser@acquire.io",
              "clientId": "",
              "meta": {
                "fields": {
                  "onboard_setup": {
                    "structValue": {
                      "fields": {
                        "install": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "welcome": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupMail": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupVoip": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupAppStore": {
                          "boolValue": false,
                          "kind": "boolValue"
                        },
                        "setupSocialApp": {
                          "boolValue": false,
                          "kind": "boolValue"
                        }
                      }
                    },
                    "kind": "structValue"
                  }
                }
              },
              "parentId": 0,
              "type": "user",
              "accessLevel": null
            }
          },
          {
            "id": 6239,
            "caseId": 2219,
            "type": "contact",
            "userId": 751069,
            "role": "owner",
            "status": "active",
            "dateCreated": "2021-04-01T16:31:44.000Z",
            "dateLastAssigned": "2021-04-01T16:31:44.000Z",
            "closed": "no",
            "meta": null,
            "user": {
              "type": "contact",
              "id": 751069,
              "name": "#751069",
              "photo": null
            }
          }
        ],
        "timeline": {
          "id": 2108,
          "objectType": "case",
          "caseId": 2219,
          "viewId": null,
          "noteId": null,
          "threadId": 2207,
          "dateCreated": "2021-04-01T13:11:02.000Z",
          "dateUpdated": "2021-04-01T16:35:05.000Z",
          "contactId": 751069,
          "archive": "no",
          "meta": {}
        },
        "threadId": 2207
      },
      "case_id": 2219,
      "timeline": {
        "id": 2108,
        "objectType": "case",
        "caseId": 2219,
        "viewId": null,
        "noteId": null,
        "threadId": 2207,
        "dateCreated": "2021-04-01T13:11:02.000Z",
        "dateUpdated": "2021-04-01T16:35:05.000Z",
        "contactId": 751069,
        "archive": "no",
        "meta": {}
      },
      "is_case_join": false
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
    "Body": "hi",
    "From": "+12513188609",
    "To": "+919666929552",
    "contactId": 751069,
    "id": 2219,
    "isClosed": false,
    "isMultiChannel": false,
    "markValue": "<p>hi</p>",
    "message": "hi",
    "msgType": "message",
    "sms": "hi",
    "threadId": 2219,
    "timelineId": 2108,
    "title": "#751069 has just started a chat"
}
```


# Update message

Update a message

## Update

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/chat/message/{{messageId}}`

Use this endpoint to modify a message in a Conversation. The **messageId** needs to be passed as a path parameter in the endpoint URL.\
\
**messageId** - the message ID. Use a webhook or GET request to find the message ID. If doing a GET request to Single Case, the message Id will be found in the object "messageSeen": { "1": 4334 } where 4334 corresponds to the messageId.&#x20;

#### Path Parameters

| Name                                 | Type    | Description      |
| ------------------------------------ | ------- | ---------------- |
| id<mark style="color:red;">\*</mark> | integer | The message's ID |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                      | Type   | Description                                                |
| ----------------------------------------- | ------ | ---------------------------------------------------------- |
| translateLangKey                          | string | Within the message object. ISO language code               |
| message<mark style="color:red;">\*</mark> | string | Within the message object. The message you intend to send. |
| type<mark style="color:red;">\*</mark>    | string | Within the message object. "message"                       |
| message<mark style="color:red;">\*</mark> | object | The message object                                         |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "id": 8288,
    "channel": "chat",
    "senderId": 1,
    "senderType": "user",
    "type": "message",
    "message": "updating the sent message",
    "dateCreated": "2021-03-30T16:04:11.000Z",
    "dateUpdated": "2021-03-30T16:10:54.000Z",
    "seen": "no",
    "meta": {},
    "case": {
      "dateCreated": "2021-03-30T16:04:10.000Z",
      "dateUpdated": "2021-03-30T16:05:46.000Z",
      "id": 2069,
      "contactId": 597759,
      "closedBy": null,
      "visitId": 1379,
      "title": "#597759 has just started a chat",
      "description": "Hey added from the api",
      "channel": "chat",
      "status": "active",
      "closingState": "handled",
      "dateQueue": "2021-03-30T16:04:10.000Z",
      "datePending": "2021-03-30T16:04:10.000Z",
      "dateActive": "2021-03-30T16:04:10.000Z",
      "dateClosed": null,
      "queueId": null,
      "queueOrder": null,
      "meta": {},
      "parentId": 1875,
      "userId": null,
      "waitTime": 0,
      "threadId": 1875
    },
    "sender": {
      "roles": [],
      "id": 1,
      "name": "David Guetta",
      "firstName": "David Guetta",
      "lastName": "",
      "photo": "",
      "email": "user@example.com",
      "clientId": "",
      "parentId": 0,
      "type": "user",
      "accessLevel": null
    },
    "caseId": 2069,
    "threadId": 1875
  }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
  "channel": "chat",
  "message": {
    "type": "message",
    "message": "Hey added from the api",
    "translateLangKey": "en"
  },
  "caseId": 9
}
```


# Delete Message

Delete a message.

## Delete a message

<mark style="color:red;">`DELETE`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/case-message/{{messageId}}`

Deletes a message. The **messageId** must be passed into the endpoint as a path parameter. **Warning:** This action cannot be undone.&#x20;

#### Path Parameters

| Name                                        | Type    | Description       |
| ------------------------------------------- | ------- | ----------------- |
| messageId<mark style="color:red;">\*</mark> | integer | The message's ID. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "deleted": 1
  }
}
```

{% endtab %}
{% endtabs %}


# Case List

Retrieve a list of cases

## Get case list

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/case`

Retrieve a list of cases.&#x20;

#### Query Parameters

| Name      | Type   | Description                                                                                                                                                                                        |    |                                   |             |    |           |          |         |       |             |        |              |           |            |            |         |      |              |
| --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -- | --------------------------------- | ----------- | -- | --------- | -------- | ------- | ----- | ----------- | ------ | ------------ | --------- | ---------- | ---------- | ------- | ---- | ------------ |
| where     | string | <p>Specifies the condition to filter. Set condition with the column name followed by the expression and its value e.g., status                                                                     | eq | active<br>Filters:<br>dateCreated | dateUpdated | id | contactId | closedBy | visitId | title | description | status | closingState | dateQueue | dateActive | dateClosed | queueId | meta | parentId</p> |
| relations | string | You can pass multiple relations along with the case. Available relations : contact\|messages\|cases\|users \|fields\|tags\|feedbacks\|timeline\|parent\| datePending\|queueOrder\|userId\|waitTime |    |                                   |             |    |           |          |         |       |             |        |              |           |            |            |         |      |              |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "page": 0,
        "offset": 0,
        "limit": 2,
        "count": 72,
        "data": [
            {
                "id": 1,
                "channel": "chat",
                "contact": {
                    "dateCreated": "2020-08-11T07:25:59.000Z",
                    "dateUpdated": "2020-08-11T07:27:14.000Z",
                    "id": 1,
                    "clientType": "web",
                    "clientName": "Chrome",
                    "clientVersion": "84.0",
                    "clientOsName": "Windows",
                    "clientOsVersion": "10",
                    "clientDeviceType": null,
                    "clientDeviceVendor": null,
                    "clientDeviceModel": null,
                    "clientDetails": {
                        "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
                        "engine": {
                            "name": "Blink",
                            "version": "84.0.4147.105"
                        },
                        "network": {
                            "type": "3g",
                            "speed": "2.52"
                        }
                    },
                    "archive": "no",
                    "companyId": 1
                },
                "threadId": 1
            },
            {
                "id": 2,
                "channel": "chat",
                "contact": {
                    "dateCreated": "2020-08-11T07:25:59.000Z",
                    "dateUpdated": "2020-08-11T07:27:14.000Z",
                    "id": 1,
                    "clientType": "web",
                    "clientName": "Chrome",
                    "clientVersion": "84.0",
                    "clientOsName": "Windows",
                    "clientOsVersion": "10",
                    "clientDeviceType": null,
                    "clientDeviceVendor": null,
                    "clientDeviceModel": null,
                    "clientDetails": {
                        "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
                        "engine": {
                            "name": "Blink",
                            "version": "84.0.4147.105"
                        },
                        "network": {
                            "type": "3g",
                            "speed": "2.52"
                        }
                    },
                    "archive": "no",
                    "companyId": 1
                },
                "threadId": 2
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## Get case list by date

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/case?where={{dateSelector}}|{{gt or lt}}|{{unix}}`

Retrieve a list of cases by date. Dates must be converted into their [unix timestamp.](https://www.unixtimestamp.com/index.php)

#### Query Parameters

| Name                                           | Type    | Description                        |
| ---------------------------------------------- | ------- | ---------------------------------- |
| where<mark style="color:red;">\*</mark>        | string  | where query parameter              |
| dateSelector<mark style="color:red;">\*</mark> | string  | dateQueue\|dateActive\|dateClosed  |
| gt or lt<mark style="color:red;">\*</mark>     | string  | gt\|lt (greater than or less than) |
| unix<mark style="color:red;">\*</mark>         | integer | the date's unix timestamp          |

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer{{API\_KEY}} |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "data": {
        "page": 0,
        "offset": 0,
        "limit": 20,
        "count": 281,
        "data": [
            {
                "dateCreated": "2021-05-17T19:50:40.000Z",
                "dateUpdated": "2021-05-26T22:01:30.000Z",
                "id": 1,
                "contactId": 1,
                "closedBy": 1,
                "visitId": 1,
                "messageSeen": null,
                "title": "this is test chat",
                "description": "The thread has been closed by {username}.",
                "channel": "chat",
                "status": "closed",
                "closingState": "handled",
                "dateQueue": "2021-05-17T19:50:40.000Z",
                "datePending": "2021-05-17T19:50:40.000Z",
                "dateActive": "2021-05-17T19:50:40.000Z",
                "dateClosed": "2021-05-26T22:01:30.000Z",
                "queueId": null,
                "queueOrder": null,
                "meta": {},
                "parentId": null,
                "userId": null,
                "waitTime": 0,
                "threadId": 1
            }
        [...]
}
```

{% endtab %}
{% endtabs %}


# Single Case

Retrieve a single case.

## Get a case

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/case/{{caseId}}`

Retrieve a single case. The **caseId** must be passed in to the endpoint as a path parameter.&#x20;

#### Path Parameters

| Name                                     | Type    | Description  |
| ---------------------------------------- | ------- | ------------ |
| caseId<mark style="color:red;">\*</mark> | integer | The case ID. |

#### Query Parameters

| Name      | Type   | Description                                                                                                                                                                                                                                                                     |
| --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| select    | string | Available filters: channel \| status \| dateCreated \| dateUpdated \| id \| contactId \| closedBy \| visitId \| title \| description \| closingState \| dateQueue \| datePending \| dateActive \| dateClosed \| queueId \| queueOrder \| meta \| parentId \| userId \| waitTime |
| relations | string | contact                                                                                                                                                                                                                                                                         |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 30,
        "channel": "chat",
        "status": "active",
        "contact": {
            "dateCreated": "2020-12-10T11:54:24.000Z",
            "dateUpdated": "2021-03-03T10:19:49.000Z",
            "id": 5,
            "clientType": "web",
            "clientName": "Chrome",
            "clientVersion": "88.0",
            "clientOsName": "Windows",
            "clientOsVersion": "10",
            "clientDeviceType": "Desktop",
            "clientDeviceVendor": null,
            "clientDeviceModel": null,
            "clientDetails": {
                "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36",
                "engine": {
                    "name": "Blink",
                    "version": "88.0.4324.190"
                },
                "network": {
                    "type": "4g",
                    "speed": "18"
                }
            },
            "archive": "no",
            "companyId": null
        },
        "threadId": 30
    }
}
```

{% endtab %}
{% endtabs %}


# Create

Create a new case

## Create

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/chat/create?contactId={{contactId}}`

Create a case. The **contactId** must be passed in to the endpoint as a query parameter. The body is optional. \
\
**contactId** - the contact's ID. Send a GET request to List all contacts to retrieve a list of contacts and their IDs or log in to your Acquire platform and hover over the contact's name in `Contact List`.&#x20;

#### Query Parameters

| Name                                        | Type    | Description                                    |
| ------------------------------------------- | ------- | ---------------------------------------------- |
| contactId<mark style="color:red;">\*</mark> | integer | Contact's ID. All cases must have a contactId. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "title": "string",
        "description": "I'm reopening the closed case",
        "channel": "chat",
        "contact": {
            "dateCreated": "2021-03-24T10:06:57.000Z",
            "dateUpdated": "2021-03-30T18:21:41.353Z",
            "id": 597752,
            "clientType": "web",
            "clientName": "Chrome",
            "clientVersion": "87.0",
            "clientOsName": "Linux",
            "clientOsVersion": "x86_64",
            "clientDeviceType": "Desktop",
            "clientDeviceVendor": null,
            "clientDeviceModel": null,
            "clientDetails": {
                "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36",
                "engine": {
                    "name": "Blink",
                    "version": "87.0.4280.66"
                },
                "network": {
                    "type": "4g",
                    "speed": "1.71"
                }
            },
            "archive": "no",
            "fields": [
                {
                    "value": null,
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 1,
                        "object": "contact",
                        "key": "name",
                        "type": "text",
                        "config": {
                            "input": {
                                "type": "text",
                                "label": "Name",
                                "required": false,
                                "placeholder": "",
                                "validationType": "format",
                                "validationFormat": "any",
                                "requiredErrorMessage": "Unfortunately this cannot be blank.",
                                "validationErrorMessage": "Oops! Seems incorrect format that you entered. Can you please recheck your name?"
                            },
                            "label": "Name",
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api",
                                "chat-online-pre"
                            ],
                            "online_order": 9,
                            "offline_order": 8494
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": null,
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 2,
                        "object": "contact",
                        "key": "email",
                        "type": "text",
                        "config": {
                            "input": {
                                "type": "text",
                                "label": "Email!!!!",
                                "required": false,
                                "placeholder": "",
                                "validationType": "format",
                                "validationFormat": "email",
                                "requiredErrorMessage": "Unfortunately this cannot be blank.",
                                "validationErrorMessage": "Oops! Looks like format you entered is wrong. Can you please recheck your email?"
                            },
                            "label": "Email!!!!",
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api",
                                "chat-online-pre"
                            ],
                            "online_order": 4,
                            "offline_order": 8492
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": "",
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 5,
                        "object": "contact",
                        "key": "city",
                        "type": "text",
                        "config": {
                            "input": {
                                "type": "text",
                                "label": "city",
                                "required": false,
                                "placeholder": "",
                                "validationType": "format",
                                "validationFormat": "any",
                                "requiredErrorMessage": "Unfortunately this cannot be blank.",
                                "validationErrorMessage": "Oops! Look like you entered the wrong value."
                            },
                            "label": "city",
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api"
                            ],
                            "online_order": 0,
                            "offline_order": 0,
                            "attributeInputDelay": 0
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": "",
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 6,
                        "object": "contact",
                        "key": "state",
                        "type": "text",
                        "config": {
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api"
                            ]
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": "517",
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 7,
                        "object": "contact",
                        "key": "countryId",
                        "type": "text",
                        "config": {
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api"
                            ]
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": "2402:8100:21f5:3d13:d9da:18ea:aa28:f778",
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 8,
                        "object": "contact",
                        "key": "ip",
                        "type": "text",
                        "config": {
                            "input": {
                                "type": "text",
                                "label": "ip",
                                "required": true,
                                "placeholder": "",
                                "validationType": "format",
                                "validationFormat": "any",
                                "requiredErrorMessage": "Unfortunately this cannot be blank.",
                                "validationErrorMessage": "Oops! I don't understand that."
                            },
                            "label": "ip",
                            "backend": {
                                "list": false
                            },
                            "capture": [],
                            "online_order": 8489,
                            "offline_order": 8490,
                            "attributeInputDelay": 0
                        },
                        "system": "yes"
                    }
                }
            ],
            "company": null,
            "tags": [],
            "visits": [
                {
                    "id": 1367,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:06:57.000Z"
                },
                {
                    "id": 1368,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:31:15.000Z"
                },
                {
                    "id": 1369,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:42:13.000Z"
                },
                {
                    "id": 1370,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:43:01.000Z"
                },
                {
                    "id": 1371,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:43:03.000Z"
                }
            ]
        },
        "status": "active",
        "dateQueue": "2021-03-30T18:21:41.338Z",
        "dateCreated": "2021-03-30T18:21:41.000Z",
        "datePending": null,
        "dateActive": null,
        "visitId": 1371,
        "users": [],
        "parentId": 1683,
        "userId": 25,
        "dateUpdated": null,
        "closedBy": null,
        "closingState": null,
        "dateClosed": null,
        "id": 2071,
        "threadId": 1683,
        "fields": [],
        "isCaseJoined": false,
        "timelineId": 1604,
        "preMessages": []
    }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
  "title": "string",
  "source": "firstMessage",
  "mentionUsers": [
    "00"
  ],
  "message": {
    "type": "message",
    "message": "I'm reopening the closed case",
    "translateLangKey": ""
  },
  "channel": "chat",
  "routeAgentId": 0,
  "agentId": 0,
  "isFromCobrowse": true,
  "fields": {}
}
```


# Close Case

Close a case

## Close a case

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/chat/close`

Closes a case. The **caseId** must be passed in the body of the request.&#x20;

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                     | Type    | Description |
| ---------------------------------------- | ------- | ----------- |
| caseId<mark style="color:red;">\*</mark> | integer | The case ID |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "0": {
      "foreverClosed": true,
      "leftUser": true,
      "caseId": 5,
      "contactId": 6
    },
    "userId": 1,
    "userType": "user"
  }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
  "caseId": 5
}
```


# Reopen Case

Reopen a close case.

## Reopen a case

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/chat/create?contactId={{contactId}}`

Reopens a chat. The **contactId** must be passed into the endpoint as a path parameter.

#### Query Parameters

| Name                                        | Type    | Description       |
| ------------------------------------------- | ------- | ----------------- |
| contactId<mark style="color:red;">\*</mark> | integer | ID of the contact |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "title": "string",
        "description": "I'm reopening the closed case",
        "channel": "chat",
        "contact": {
            "dateCreated": "2021-03-24T10:06:57.000Z",
            "dateUpdated": "2021-03-24T11:08:17.498Z",
            "id": 597752,
            "clientType": "web",
            "clientName": "Chrome",
            "clientVersion": "87.0",
            "clientOsName": "Linux",
            "clientOsVersion": "x86_64",
            "clientDeviceType": "Desktop",
            "clientDeviceVendor": null,
            "clientDeviceModel": null,
            "clientDetails": {
                "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36",
                "engine": {
                    "name": "Blink",
                    "version": "87.0.4280.66"
                },
                "network": {
                    "type": "4g",
                    "speed": "1.71"
                }
            },
            "archive": "no",
            "fields": [
                {
                    "value": null,
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 1,
                        "object": "contact",
                        "key": "name",
                        "type": "text",
                        "config": {
                            "input": {
                                "type": "text",
                                "label": "Name",
                                "required": false,
                                "placeholder": "",
                                "validationType": "format",
                                "validationFormat": "any",
                                "requiredErrorMessage": "Unfortunately this cannot be blank.",
                                "validationErrorMessage": "Oops! Seems incorrect format that you entered. Can you please recheck your name?"
                            },
                            "label": "Name",
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api",
                                "chat-online-pre"
                            ],
                            "online_order": 9,
                            "offline_order": 8494
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": null,
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 2,
                        "object": "contact",
                        "key": "email",
                        "type": "text",
                        "config": {
                            "input": {
                                "type": "text",
                                "label": "Email!!!!",
                                "required": false,
                                "placeholder": "",
                                "validationType": "format",
                                "validationFormat": "email",
                                "requiredErrorMessage": "Unfortunately this cannot be blank.",
                                "validationErrorMessage": "Oops! Looks like format you entered is wrong. Can you please recheck your email?"
                            },
                            "label": "Email!!!!",
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api",
                                "chat-online-pre"
                            ],
                            "online_order": 4,
                            "offline_order": 8492
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": "",
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 5,
                        "object": "contact",
                        "key": "city",
                        "type": "text",
                        "config": {
                            "input": {
                                "type": "text",
                                "label": "city",
                                "required": false,
                                "placeholder": "",
                                "validationType": "format",
                                "validationFormat": "any",
                                "requiredErrorMessage": "Unfortunately this cannot be blank.",
                                "validationErrorMessage": "Oops! Look like you entered the wrong value."
                            },
                            "label": "city",
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api"
                            ],
                            "online_order": 0,
                            "offline_order": 0,
                            "attributeInputDelay": 0
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": "",
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 6,
                        "object": "contact",
                        "key": "state",
                        "type": "text",
                        "config": {
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api"
                            ]
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": "517",
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 7,
                        "object": "contact",
                        "key": "countryId",
                        "type": "text",
                        "config": {
                            "backend": {
                                "list": false
                            },
                            "capture": [
                                "api"
                            ]
                        },
                        "system": "yes"
                    }
                },
                {
                    "value": "2402:8100:21f5:3d13:d9da:18ea:aa28:f778",
                    "owner": "contact",
                    "contactId": 597752,
                    "field": {
                        "id": 8,
                        "object": "contact",
                        "key": "ip",
                        "type": "text",
                        "config": {
                            "input": {
                                "type": "text",
                                "label": "ip",
                                "required": true,
                                "placeholder": "",
                                "validationType": "format",
                                "validationFormat": "any",
                                "requiredErrorMessage": "Unfortunately this cannot be blank.",
                                "validationErrorMessage": "Oops! I don't understand that."
                            },
                            "label": "ip",
                            "backend": {
                                "list": false
                            },
                            "capture": [],
                            "online_order": 8489,
                            "offline_order": 8490,
                            "attributeInputDelay": 0
                        },
                        "system": "yes"
                    }
                }
            ],
            "company": null,
            "tags": [],
            "visits": [
                {
                    "id": 1367,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:06:57.000Z"
                },
                {
                    "id": 1368,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:31:15.000Z"
                },
                {
                    "id": 1369,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:42:13.000Z"
                },
                {
                    "id": 1370,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:43:01.000Z"
                },
                {
                    "id": 1371,
                    "contactId": 597752,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://5mkg3t.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2021-03-24T10:43:03.000Z"
                }
            ]
        },
        "status": "active",
        "dateQueue": "2021-03-24T11:08:17.400Z",
        "dateCreated": "2021-03-24T11:08:17.000Z",
        "datePending": null,
        "dateActive": null,
        "visitId": 1371,
        "users": [],
        "parentId": 1683,
        "userId": 25,
        "dateUpdated": null,
        "closedBy": null,
        "closingState": null,
        "dateClosed": null,
        "id": 1694,
        "threadId": 1683,
        "fields": [],
        "isCaseJoined": false,
        "timelineId": 1604,
        "preMessages": []
    }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
  "title": "string",
  "source": "firstMessage",
  "mentionUsers": [
    "00"
  ],
  "message": {
    "type": "message",
    "message": "I'm reopening the closed case",
    "translateLangKey": ""
  },
  "channel": "chat",
  "routeAgentId": 0,
  "agentId": 0,
  "isFromCobrowse": true,
  "fields": {},
  "sessionId": 3711819272,
  "threadId": 1683
}
```


# Invite Agent

Invite an agent or department to a case.

## Invite an agent&#x20;

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/agent/invite-agent`

Invite agents or departments to the chat. The **caseId** must be passed in the body of the request. The agent IDs or department IDs **(agentId | department)** must be passed to the body as a JSON array of integers. You can add as many agents as you'd like and invite a department. Agents or departments will receive an in-app notification and an email which they can use to access the conversion. \
\
**agentId** - An agent's ID. To find agent IDs, log in to Acquire and go to `Settings > Users and Roles` or send a GET request to Agent List.\
\
**department -** A department's ID. Send a GET request to Department List to find department IDs. <br>

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                     | Type   | Description                                          |
| ---------------------------------------- | ------ | ---------------------------------------------------- |
| caseId<mark style="color:red;">\*</mark> | string | The case ID                                          |
| department                               | array  | Array of integers. Required if inviting departments. |
| agentIds                                 | array  | Array of integers. Required if inviting agents.      |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "1": {
      "userId": 1,
      "online": true,
      "sent": true
    },
    "11": {
      "userId": 11,
      "online": false,
      "sent": false
    },
    "26": {
      "userId": 26,
      "online": false,
      "sent": false
    }
  
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
    "caseId": 22,
    "department": [
    2,
    3,
    4
  ],
    "agentIds": [
        1,
        11,
        26
    ]
}
```


# Snooze

Snooze allows the agent to remove the conversation from active view for a set time.

This API allows you to manage a snooze for a specific day and time. That conversation will be marked 'snoozed' on the specified day and time.&#x20;

### Attributes&#x20;

| ATTRIBUTE    | TYPE              | DESCRIPTION                                     |
| ------------ | ----------------- | ----------------------------------------------- |
| id           | Integer           | Specify the ID of the Snooze                    |
| objectType   | String            | Specify the snooze set for 'contact' or 'case'. |
| contactId    | Integer           | Specify the Snooze for a contact.               |
| scheduleDate | datetime          | Specify the timestamp of the Snooze.            |
| objectId     | Integer           | Specify the case or contact id.                 |
| userId       | Integer           | Specify the user id.                            |
| message      | String            | Specify the snooze message.                     |
| users        | JSON Array Object | Specify the owner of the Snooze.                |

### Permissions

To request a snooze endpoint, you will need a valid API Key with the Snooze permissions enabled.


# \[Under Construction] Delete Snooze

Delete a specific Snooze

{% hint style="info" %}
These endpoints are in beta testing. Some features may not work as documented or may behave unexpectedly.&#x20;
{% endhint %}

## Delete Snooze

<mark style="color:red;">`DELETE`</mark> `https://{{acount_id}}.acquire.io/api/v1/crm/follow-up/{{snoozeId}}`

**This endpoint is under construction** \
\
Delete a specific snooze based on its ID. The **snoozeId** must be passed in to the endpoint as a path parameter. Snoozes may *only* be deleted by the agent who created them. **Warning**: This action cannot be undone.&#x20;

#### Path Parameters

| Name                                       | Type    | Description      |
| ------------------------------------------ | ------- | ---------------- |
| snoozeId<mark style="color:red;">\*</mark> | integer | ID of the snooze |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "success": true,
    "message": "Snooze has been removed successfully"
  }
}
```

{% endtab %}
{% endtabs %}


# Create Snooze

Create a snooze. A snooze can be created both at the contact level and case level.

## Create Snooze

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/follow-up/create`

Create a snooze. The body requires the following: \
\
`"contactId"` and/or `"caseId"`  \
\
&#x20;`"objectType"` set to `"case"`  \
\
`"scheduleDate"`  in `"YYYY-MM-DD HH:MM:SS"` format.

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                           | Type    | Description                                               |
| ---------------------------------------------- | ------- | --------------------------------------------------------- |
| scheduleDate<mark style="color:red;">\*</mark> | string  | Date when the snooze elapses. YYYY-MM-DD HH:MM:SS format. |
| objectType<mark style="color:red;">\*</mark>   | string  | "case"                                                    |
| caseId                                         | integer | The case ID (not required if contactId is present)        |
| contactId                                      | integer | The contact ID (not required if caseId is present)        |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "success": true,
    "message": "Snooze added successfully",
    "data": {
      "id": 3,
      "objectType": "case",
      "contactId": 53,
      "scheduleDate": "2020-05-28 12:30:00",
      "objectId": 53,
      "userId": 12,
      "message": "This is simple message",
      "users": [
        {
          "1": {
            "id": 1,
            "email": "user@gmail.com",
            "name": "User Name"
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
    "caseId": null,
    "contactId": 9156872,
    "message": "",
    "objectId": 768,
    "objectType": "contact",
    "scheduleDate": "2022-04-05T13:44:12.000Z",
    "users": []
}
```


# Notes

Notes are texts that are linked to case and contact objects.

Create, retrieve, update or delete notes for a particular contact or case.

## Attributes

| Attribute   | Type    | Description                                                                                          |
| ----------- | ------- | ---------------------------------------------------------------------------------------------------- |
| id          | Integer | Specifies ID of the note.                                                                            |
| contactId   | Integer | <p>Specifies the contactID of the note </p><p>under which it was created.</p>                        |
| type        | String  | <p>Specifies the type of note and whether or not  </p><p>it's a separate note or a note message.</p> |
| title       | String  | Specifies the title of the note which was created.                                                   |
| description | String  | Specifies the description of the note.                                                               |
| userId      | Integer | Specifies the ID of the user who created the note.                                                   |
| dateCreated | Date    | Specifies the date on which the note was created.                                                    |
| users       | Object  | <p>Specifies the details of the users </p><p>involved in the notes.</p>                              |
| lastMessage | Object  | Specifies the last, or most recent, message in the note section                                      |

## Permissions

To request a case endpoint, you will need a valid API key with note access permissions.


# List all notes

Retrieve all notes.

## List all Notes

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/note?lcontact_id={{contact_id}}`

Retrieve a list of notes. The **contact\_id** must be passed in to the endpoint as a query parameter. \
\
**contact\_id** - The contact's ID. All notes are attached to a contact. To find a contact\_id, log in to Acquire, go to `Contact List` and hover a contact's name or submit a GET request to List All Contacts.

#### Query Parameters

| Name                                          | Type    | Description                                        |
| --------------------------------------------- | ------- | -------------------------------------------------- |
| contact\_id<mark style="color:red;">\*</mark> | integer | ID of the contact.                                 |
| page                                          | integer | The page number.                                   |
| limit                                         | integer | The maximum number of results to display per page. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "count": 5,
        "rows": [
            {
                "id": 7,
                "contactId": 1,
                "userId": 22,
                "type": "note",
                "title": "this is test note titleeqqw",
                "description": null,
                "dateCreated": "2020-09-11T12:33:04.000Z",
                "users": [
                    {
                        "id": 7,
                        "noteId": 7,
                        "userId": 22
                    }
                ],
                "lastMessage": {
                    "id": 9,
                    "noteId": 7,
                    "parentId": null,
                    "userId": 22,
                    "type": "message",
                    "message": "this is test notessssssssssssssssssssssssssssssssssssssss",
                    "dateCreated": "2020-09-11T12:33:04.000Z"
                }
            },
            {
                "id": 4,
                "contactId": 1,
                "userId": 22,
                "type": "note",
                "title": "this is test note title",
                "description": null,
                "dateCreated": "2020-09-11T12:24:28.000Z",
                "users": [
                    {
                        "id": 4,
                        "noteId": 4,
                        "userId": 22
                    }
                ],
                "lastMessage": {
                    "id": 17,
                    "noteId": 4,
                    "parentId": 0,
                    "userId": 93,
                    "type": "message",
                    "message": "this is test note by surendra",
                    "dateCreated": "2021-03-12T05:23:25.000Z"
                }
            },
            {
                "id": 3,
                "contactId": 1,
                "userId": 22,
                "type": "note",
                "title": "this is test note title",
                "description": null,
                "dateCreated": "2020-09-11T12:23:11.000Z",
                "users": [
                    {
                        "id": 3,
                        "noteId": 3,
                        "userId": 22
                    }
                ],
                "lastMessage": {
                    "id": 3,
                    "noteId": 3,
                    "parentId": null,
                    "userId": 22,
                    "type": "message",
                    "message": "this is test note",
                    "dateCreated": "2020-09-11T12:23:11.000Z"
                }
            },
            {
                "id": 2,
                "contactId": 1,
                "userId": 1,
                "type": "note",
                "title": "this is test note title",
                "description": null,
                "dateCreated": "2020-09-11T12:22:09.000Z",
                "users": [
                    {
                        "id": 2,
                        "noteId": 2,
                        "userId": 1,
                        "user": {
                            "departments": [],
                            "roles": [],
                            "id": 1,
                            "name": "Surendra Suthar",
                            "firstName": "Surendra Suthar",
                            "lastName": "",
                            "photo": "https://uat-drive.acquire.io/suthar/media/2020/10/IMG_2353-(3)-201aff39871a8ccc0f3e9ff0.jpg",
                            "email": "surendra@acquire.io",
                            "clientId": "",
                            "parentId": 0,
                            "type": "user",
                            "accessLevel": null
                        }
                    }
                ],
                "lastMessage": {
                    "id": 2,
                    "noteId": 2,
                    "parentId": null,
                    "userId": 1,
                    "type": "message",
                    "message": "this is test note",
                    "dateCreated": "2020-09-11T12:22:09.000Z"
                }
            },
            {
                "id": 1,
                "contactId": 1,
                "userId": 1,
                "type": "note",
                "title": "this is test note titleeqqw",
                "description": null,
                "dateCreated": "2020-09-11T12:17:33.000Z",
                "users": [
                    {
                        "id": 1,
                        "noteId": 1,
                        "userId": 1,
                        "user": {
                            "departments": [],
                            "roles": [],
                            "id": 1,
                            "name": "Surendra Suthar",
                            "firstName": "Surendra Suthar",
                            "lastName": "",
                            "photo": "https://uat-drive.acquire.io/suthar/media/2020/10/IMG_2353-(3)-201aff39871a8ccc0f3e9ff0.jpg",
                            "email": "surendra@acquire.io",
                            "clientId": "",
                            "parentId": 0,
                            "type": "user",
                            "accessLevel": null
                        }
                    }
                ],
                "lastMessage": {
                    "id": 1,
                    "noteId": 1,
                    "parentId": null,
                    "userId": 1,
                    "type": "message",
                    "message": "Instantly engage your customers on any channel using the best communication tools, all from one dashboard.",
                    "dateCreated": "2020-09-11T12:17:33.000Z"
                }
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}


# Retrieve a note

Retrieve a single note.

## Single Note

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/note/get/{{noteId}}`

Retrieve a single note. The **noteId** must be passed in to the endpoint as a path parameter. \
\
**noteId** - The note's ID. To retrieve a list of noteIds, submit a GET request to List all notes.

#### Path Parameters

| Name                                     | Type    | Description    |
| ---------------------------------------- | ------- | -------------- |
| noteId<mark style="color:red;">\*</mark> | integer | ID of the note |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 1,
        "contactId": 1,
        "userId": 1,
        "type": "note",
        "title": "this is test note titleeqqw",
        "description": null,
        "dateCreated": "2020-09-11T12:17:33.000Z",
        "users": [
            {
                "id": 1,
                "noteId": 1,
                "userId": 1,
                "user": {
                    "departments": [],
                    "roles": [],
                    "id": 1,
                    "name": "Surendra Suthar",
                    "firstName": "Surendra Suthar",
                    "lastName": "",
                    "photo": "https://uat-drive.acquire.io/suthar/media/2020/10/IMG_2353-(3)-201aff39871a8ccc0f3e9ff0.jpg",
                    "email": "surendra@acquire.io",
                    "clientId": "",
                    "parentId": 0,
                    "type": "user",
                    "accessLevel": null
                }
            }
        ],
        "lastMessage": {
            "id": 1,
            "noteId": 1,
            "parentId": null,
            "userId": 1,
            "type": "message",
            "message": "Instantly engage your customers on any channel using the best communication tools, all from one dashboard.",
            "dateCreated": "2020-09-11T12:17:33.000Z"
        }
    }
}
```

{% endtab %}
{% endtabs %}


# Create

Create a note.

## Create a Note

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/note/create?contactId={{contactId}}`

Create a note. The **contact\_id** must be passed in to the body as a query parameter. The body must contain a `"type"` key set to `"note"`. \ <br>

#### Query Parameters

| Name                                        | Type    | Description      |
| ------------------------------------------- | ------- | ---------------- |
| contactId<mark style="color:red;">\*</mark> | integer | The contact's ID |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name         | Type   | Description                                     |
| ------------ | ------ | ----------------------------------------------- |
| mentionUsers | array  | Array of integers. Mention userIds in the note. |
| message      | string | Message of the note                             |
| description  | string | A description for the note                      |
| title        | string | Title for the note                              |
| type         | string | "note"                                          |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "contactId": "90",
    "userId": 1,
    "title": "this is test note title",
    "description": "this is test note description",
    "type": "note",
    "dateCreated": "2021-03-11T11:47:51.874Z",
    "id": 13,
    "users": [
      {
        "note": {
          "contactId": "90",
          "userId": 1,
          "title": "this is test note title",
          "description": "this is test note description",
          "type": "note",
          "dateCreated": "2021-03-11T11:47:51.874Z",
          "id": 13
        },
        "userId": 1
      }
    ],
    "lastMessage": {
      "userId": 1,
      "message": "this is test note",
      "type": "message",
      "parentId": null,
      "dateCreated": "2021-03-11T11:47:52.000Z",
      "note": {
        "id": 13,
        "contactId": 90,
        "userId": 1,
        "type": "note",
        "title": "this is test note title",
        "description": "this is test note description",
        "dateCreated": "2021-03-11T11:47:52.000Z"
      },
      "id": 15,
      "user": {
        "departments": [],
        "roles": [],
        "id": 1,
        "name": "Surendra Suthar",
        "firstName": "Surendra Suthar",
        "lastName": "",
        "photo": "https://uat-drive.acquire.io/suthar/media/2020/10/IMG_2353-(3)-201aff39871a8ccc0f3e9ff0.jpg",
        "email": "surendra@acquire.io",
        "clientId": "",
        "parentId": 0,
        "type": "user",
        "accessLevel": null
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
  "type": "note",
  "title": "this is test note title",
  "description": "this is test note description",
  "message": "this is test note",
  "mentionUsers": [
    "00"
  ]
}
```


# Add note message

Add a message to a note.

## Add a message to the note.

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/note/add-message`

Add a message to a note. The body must contain the **note\_id, contact\_id,** and a key of `"type"` set to `"message"`.

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                          | Type    | Description                                   |
| --------------------------------------------- | ------- | --------------------------------------------- |
| type<mark style="color:red;">\*</mark>        | string  | message                                       |
| contact\_id<mark style="color:red;">\*</mark> | integer | The contact's ID that the note is attached to |
| note\_id<mark style="color:red;">\*</mark>    | integer | The note's ID                                 |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "userId": 1,
    "message": "this is test notewwwwwwwwwwwwwwwwwww",
    "type": "message",
    "parentId": 0,
    "dateCreated": "2021-03-11T12:35:32.000Z",
    "note": {
      "id": 10,
      "contactId": 1794,
      "userId": 1,
      "type": "note",
      "title": "this is test note title",
      "description": null,
      "dateCreated": "2020-09-16T06:49:16.000Z"
    },
    "id": 16,
    "user": {
      "departments": [],
      "roles": [],
      "id": 1,
      "name": "Surendra Suthar",
      "firstName": "Surendra Suthar",
      "lastName": "",
      "photo": "https://uat-drive.acquire.io/suthar/media/2020/10/IMG_2353-(3)-201aff39871a8ccc0f3e9ff0.jpg",
      "email": "surendra@acquire.io",
      "clientId": "",
      "parentId": 0,
      "type": "user",
      "accessLevel": null
    }
  }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
  "type": "message",
  "mentionUsers": [
    "00"
  ],
  "message": "this is test note message",
  "parent_id": 0,
  "note_id": 10,
  "contact_id": 90
}
```


# Delete note

Delete a note

## Delete a note

<mark style="color:red;">`DELETE`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/note/{{noteId}}`

Delete a a note. The **noteId** must be passed in to the endpoint as a path parameter. **Warning**: The action cannot be undone.&#x20;

#### Path Parameters

| Name                                     | Type    | Description    |
| ---------------------------------------- | ------- | -------------- |
| noteId<mark style="color:red;">\*</mark> | integer | ID of the note |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "success": true,
    "message": "Note has been deleted successfully."
  }
}
```

{% endtab %}
{% endtabs %}


# Retrieve note messages

Retrieve a list of note messages

## Retrieve a note's messages

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/note/messages?noteId={{noteId}}`

Retrieve note messages. The **noteId** must be passed in to the endpoint as a path parameter.

#### Query Parameters

| Name                                     | Type    | Description     |
| ---------------------------------------- | ------- | --------------- |
| noteId<mark style="color:red;">\*</mark> | integer | ID of the note. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "count": 2,
        "rows": [
            {
                "id": 11,
                "noteId": 8,
                "parentId": null,
                "userId": 1,
                "type": "message",
                "message": "Hello test note",
                "dateCreated": "2020-09-14T06:34:55.000Z",
                "user": {
                    "departments": [],
                    "roles": [],
                    "id": 1,
                    "name": "Surendra Suthar",
                    "firstName": "Surendra Suthar",
                    "lastName": "",
                    "photo": "https://uat-drive.acquire.io/suthar/media/2020/10/IMG_2353-(3)-201aff39871a8ccc0f3e9ff0.jpg",
                    "email": "surendra@acquire.io",
                    "clientId": "",
                    "parentId": 0,
                    "type": "user",
                    "accessLevel": null
                }
            },
            {
                "id": 12,
                "noteId": 8,
                "parentId": null,
                "userId": 1,
                "type": "message",
                "message": "Hello test note",
                "dateCreated": "2020-09-14T06:35:08.000Z",
                "user": {
                    "departments": [],
                    "roles": [],
                    "id": 1,
                    "name": "Surendra Suthar",
                    "firstName": "Surendra Suthar",
                    "lastName": "",
                    "photo": "https://uat-drive.acquire.io/suthar/media/2020/10/IMG_2353-(3)-201aff39871a8ccc0f3e9ff0.jpg",
                    "email": "surendra@acquire.io",
                    "clientId": "",
                    "parentId": 0,
                    "type": "user",
                    "accessLevel": null
                }
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}


# Contact

A contact is someone who has initiated a conversation through any channel. Contacts can also belong to a company.

The Contact API can be used to create, update, retrieve, and delete records in a Contact object. You can retrieve single contact and a list of all contacts. You can assign **Tags** & create **Custom Attributes** for a contact.

### Attributes&#x20;

| ATTRIBUTE          | TYPE                                 | DESCRIPTION                                                               |
| ------------------ | ------------------------------------ | ------------------------------------------------------------------------- |
| id                 | Integer                              | Specify the ID of the contact                                             |
| clientType         | String                               | Specify the platform: 'web', 'client',  or 'sdk'.                         |
| clientName         | String                               | Specify the contact's browser name.                                       |
| clientVersion      | String                               | Specify the browser version.                                              |
| clientOsName       | String                               | Specify the operating system name.                                        |
| clientOsVersion    | String                               | Specify the operating system version.                                     |
| clientDeviceType   | String                               | Specify the device type: desktop, mobile, etc.                            |
| clientDeviceVendor | String                               | Specify the device vendor: Apple, Microsoft, etc.                         |
| clientDeviceModel  | String                               | Specify the device model: iPhone, Android.                                |
| clientDetails      | JSON Object                          | Specify the user info in details such as engine, CPU, WebKit, etc.        |
| archive            | String                               | Specify the visibility of the contact                                     |
| company            | JSON Array Object (Entity Relations) | Information about contact's company.                                      |
| cases              | JSON Array Object (Entity Relations) | Specify the cases                                                         |
| tags               | JSON Array Object (Entity Relations) | Specify the contact tags                                                  |
| visits             | JSON Array Object (Entity Relations) | Specify the contact's visit history                                       |
| timeline           | JSON Array Object (Entity Relations) | Specify the contact's timeline details                                    |
| fields             | JSON object (Entity Relations)       | Information about contact such as name, email, phone, & custom attributes |
| dateCreated        | datetime                             | Contact creation timestamp                                                |
| dateUpdated        | datetime                             | Contact updated timestamp                                                 |

### **Permissions**

To request a contact's endpoint, you will need a valid API key with the contact access permissions.

### **Relations between contact and other entities**

Contacts are associated with a company, case, tags, and timeline.\ <br>


# List all contacts

Lists all the contacts for an account

## Get contacts

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/contact`

&#x20;Retrieve a list of all contacts from the platform's `Contact List`.&#x20;

#### Query Parameters

| Name      | Type   | Description                                                            |
| --------- | ------ | ---------------------------------------------------------------------- |
| limit     | string | Limits the number of results                                           |
| select    | array  | dateCreate \| dateUpdated \| id \| parent                              |
| where     | array  |                                                                        |
| relations | array  | Can be one of company \| cases \| tags \| visits \| timeline \| fields |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "list": [
            {
                "dateCreated": "2020-09-09T10:01:36.000Z",
                "dateUpdated": "2020-09-09T10:02:04.000Z",
                "id": 82,
                "clientType": "web",
                "clientName": "Chrome",
                "clientVersion": "85.0",
                "clientOsName": "Windows",
                "clientOsVersion": "10",
                "clientDeviceType": "Desktop",
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "clientDetails": {
                    "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36",
                    "engine": {
                        "name": "Blink",
                        "version": "85.0.4183.83"
                    },
                    "network": {
                        "type": "4g",
                        "speed": "18"
                    }
                },
                "fields": {
                    "name": "test",
                    "email": "test@gmailc.om",
                    "phone": "23232323",
                    "city": "Kanpur",
                    "state": "Uttar Pradesh",
                    "country": {
                        "name": "India",
                        "name_official": "Republic of India",
                        "cca2": "IN",
                        "ccn3": "35",
                        "cca3": "IND",
                        "calling_code1": 91,
                        "region_id": 366,
                        "lat": "20",
                        "lng": "77",
                        "voip_enable": true
                    },
                    "countryId": "387",
                    "ip": "112.196.188.108"
                },
                "company": {
                    "dateCreated": "2020-09-09T10:02:01.000Z",
                    "dateUpdated": null,
                    "id": 3,
                    "fields": {
                        "name": "Gmail",
                        "website": "gmailc.om",
                        "logo": null,
                        "industry": null,
                        "description": null,
                        "source": null,
                        "address": null,
                        "employees": null,
                        "foundation": null
                    }
                },
                "tags": [],
                "latestTimelineId": "12",
                "caseId": "6",
                "latestObjectType": "case",
                "title": "test : ",
                "description": "hi",
                "channel": "chat",
                "status": "active",
                "agentList": [
                    {
                        "departments": [],
                        "roles": [],
                        "id": 1,
                        "name": "Surendra Suthar",
                        "firstName": "Surendra Suthar",
                        "lastName": "",
                        "photo": "",
                        "email": "surendra@acquire.io",
                        "clientId": "",
                        "parentId": 0,
                        "title": "Surendra Suthar",
                        "url": "",
                        "alt": "Surendra Suthar"
                    }
                ],
                "departmentList": [],
                "lastViewObject": null,
                "clientUserId": null,
                "contactCompanyCount": 1,
                "companyId": 3,
                "totalTimeline": 1,
                "lastDateUpdated": "2020-09-09 10:02:04",
                "totalNotes": 0,
                "totalViews": 0,
                "totalCase": 1,
                "caseDateUpdated": "2020-09-09T10:02:04.000Z",
                "msgUnread": 0,
                "channels": [
                    "chat"
                ],
                "firstInteractionType": null,
                "lastInteractionType": "chat",
                "isBlocked": "NO",
                "lastVisit": {
                    "id": 23,
                    "contactId": 82,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-09-09T10:01:36.000Z"
                },
                "firstVisit": {
                    "id": 24,
                    "contactId": 82,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-09-10T03:33:38.000Z"
                },
                "interaction": [],
                "snoozeInContact": false
            },
            {
                "dateCreated": "2020-08-18T13:10:59.000Z",
                "dateUpdated": "2020-08-18T13:12:13.000Z",
                "id": 80,
                "clientType": "web",
                "clientName": "Chrome",
                "clientVersion": "84.0",
                "clientOsName": "Windows",
                "clientOsVersion": "10",
                "clientDeviceType": "Desktop",
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "clientDetails": {
                    "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36",
                    "engine": {
                        "name": "Blink",
                        "version": "84.0.4147.125"
                    },
                    "network": {
                        "type": "3g",
                        "speed": "2.25"
                    }
                },
                "fields": {
                    "city": "Barmer",
                    "state": "Rajasthan",
                    "country": {
                        "name": "India",
                        "name_official": "Republic of India",
                        "cca2": "IN",
                        "ccn3": "35",
                        "cca3": "IND",
                        "calling_code1": 91,
                        "region_id": 366,
                        "lat": "20",
                        "lng": "77",
                        "voip_enable": true
                    },
                    "countryId": "387",
                    "ip": "157.37.175.233"
                },
                "company": {
                    "fields": {}
                },
                "tags": [],
                "latestTimelineId": "11",
                "viewId": "7",
                "latestObjectType": "view",
                "title": "Book a Meeting",
                "description": "Book a Meeting",
                "channel": "view",
                "status": null,
                "agentList": [],
                "departmentList": [],
                "lastViewObject": {
                    "viewId": 7,
                    "iconImageUrl": "../../../../../assets/app-store/book_a_meeting.svg",
                    "iconFont": null
                },
                "clientUserId": null,
                "contactCompanyCount": null,
                "companyId": null,
                "totalTimeline": 1,
                "lastDateUpdated": "2020-08-18 13:12:13",
                "totalNotes": 0,
                "totalViews": 1,
                "totalCase": 0,
                "msgUnread": 0,
                "channels": [
                    "view"
                ],
                "firstInteractionType": null,
                "lastInteractionType": "view",
                "isBlocked": "NO",
                "lastVisit": {
                    "id": 18,
                    "contactId": 80,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-08-18T13:10:59.000Z"
                },
                "firstVisit": {
                    "id": 18,
                    "contactId": 80,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-08-18T13:10:59.000Z"
                },
                "interaction": [],
                "snoozeInContact": false
            },
            {
                "dateCreated": "2020-08-18T07:02:07.000Z",
                "dateUpdated": "2020-08-18T10:56:32.000Z",
                "id": 79,
                "clientType": "web",
                "clientName": "Chrome",
                "clientVersion": "84.0",
                "clientOsName": "Windows",
                "clientOsVersion": "10",
                "clientDeviceType": "Desktop",
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "clientDetails": {
                    "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
                    "engine": {
                        "name": "Blink",
                        "version": "84.0.4147.135"
                    },
                    "network": {
                        "type": "4g",
                        "speed": "13.32"
                    }
                },
                "fields": {
                    "city": "Ahmedabad",
                    "state": "Gujarat",
                    "country": {
                        "name": "India",
                        "name_official": "Republic of India",
                        "cca2": "IN",
                        "ccn3": "35",
                        "cca3": "IND",
                        "calling_code1": 91,
                        "region_id": 366,
                        "lat": "20",
                        "lng": "77",
                        "voip_enable": true
                    },
                    "countryId": "387",
                    "ip": "103.85.11.73"
                },
                "company": {
                    "fields": {}
                },
                "tags": [],
                "latestTimelineId": "10",
                "viewId": "6",
                "latestObjectType": "view",
                "title": "Book a Meeting",
                "description": "Book a Meeting",
                "channel": "view",
                "status": null,
                "agentList": [],
                "departmentList": [],
                "lastViewObject": {
                    "viewId": 6,
                    "iconImageUrl": "../../../../../assets/app-store/book_a_meeting.svg",
                    "iconFont": null
                },
                "clientUserId": null,
                "contactCompanyCount": null,
                "companyId": null,
                "totalTimeline": 2,
                "lastDateUpdated": "2020-08-18 10:56:32",
                "totalNotes": 0,
                "totalViews": 2,
                "totalCase": 0,
                "msgUnread": 0,
                "channels": [
                    "view"
                ],
                "firstInteractionType": null,
                "lastInteractionType": "view",
                "isBlocked": "NO",
                "lastVisit": {
                    "id": 11,
                    "contactId": 79,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-08-18T07:02:07.000Z"
                },
                "firstVisit": {
                    "id": 22,
                    "contactId": 79,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-08-24T04:15:22.000Z"
                },
                "interaction": [],
                "snoozeInContact": false
            },
            {
                "dateCreated": "2020-08-10T08:32:48.000Z",
                "dateUpdated": "2020-08-12T07:06:19.000Z",
                "id": 78,
                "clientType": "web",
                "clientName": "Chrome",
                "clientVersion": "84.0",
                "clientOsName": "Windows",
                "clientOsVersion": "10",
                "clientDeviceType": null,
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "clientDetails": {
                    "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
                    "engine": {
                        "name": "Blink",
                        "version": "84.0.4147.105"
                    },
                    "network": {
                        "type": "4g",
                        "speed": "1.62"
                    }
                },
                "fields": {
                    "email": "test@facebook.com",
                    "city": "Jaipur",
                    "state": "Rajasthan",
                    "country": {
                        "name": "India",
                        "name_official": "Republic of India",
                        "cca2": "IN",
                        "ccn3": "35",
                        "cca3": "IND",
                        "calling_code1": 91,
                        "region_id": 366,
                        "lat": "20",
                        "lng": "77",
                        "voip_enable": true
                    },
                    "countryId": "387",
                    "ip": "157.37.148.6"
                },
                "company": {
                    "dateCreated": "2020-08-12T07:06:24.000Z",
                    "dateUpdated": null,
                    "id": 2,
                    "fields": {
                        "name": "Facebook",
                        "website": "facebook.com",
                        "logo": "https://organization.uat.env.acquire.io/logo/facebook.com.png"
                    }
                },
                "tags": [],
                "latestTimelineId": "8",
                "viewId": "4",
                "latestObjectType": "view",
                "title": "Book a Meeting",
                "description": "Book a Meeting",
                "channel": "view",
                "status": null,
                "agentList": [],
                "departmentList": [],
                "lastViewObject": {
                    "viewId": 4,
                    "iconImageUrl": "../../../../../assets/app-store/book_a_meeting.svg",
                    "iconFont": null
                },
                "clientUserId": null,
                "contactCompanyCount": 1,
                "companyId": 2,
                "totalTimeline": 1,
                "lastDateUpdated": "2020-08-10 09:24:59",
                "totalNotes": 0,
                "totalViews": 1,
                "totalCase": 0,
                "msgUnread": 0,
                "channels": [
                    "view"
                ],
                "firstInteractionType": null,
                "lastInteractionType": "view",
                "isBlocked": "NO",
                "lastVisit": {
                    "id": 8,
                    "contactId": 78,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-08-10T08:32:48.000Z"
                },
                "firstVisit": {
                    "id": 10,
                    "contactId": 78,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-08-10T08:39:05.000Z"
                },
                "interaction": [],
                "snoozeInContact": false
            },
            {
                "dateCreated": "2020-05-22T06:04:45.000Z",
                "dateUpdated": "2020-08-11T11:07:46.000Z",
                "id": 77,
                "clientType": "web",
                "clientName": "Chrome",
                "clientVersion": "83.0",
                "clientOsName": "Windows",
                "clientOsVersion": "10",
                "clientDeviceType": null,
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "clientDetails": {
                    "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
                    "engine": {
                        "name": "Blink",
                        "version": "83.0.4103.116"
                    },
                    "network": {
                        "type": "4g",
                        "speed": "16.56"
                    }
                },
                "fields": {
                    "name": "Surendra Sutahr",
                    "email": "surendra@docusign.com",
                    "city": "Jaipur",
                    "state": "Rajasthan",
                    "country": {
                        "name": "India",
                        "name_official": "Republic of India",
                        "cca2": "IN",
                        "ccn3": "35",
                        "cca3": "IND",
                        "calling_code1": 91,
                        "region_id": 366,
                        "lat": "20",
                        "lng": "77",
                        "voip_enable": true
                    },
                    "countryId": "387",
                    "ip": "157.37.236.36"
                },
                "company": {
                    "dateCreated": "2020-08-11T11:07:46.000Z",
                    "dateUpdated": "2020-08-11T11:07:46.000Z",
                    "id": 1,
                    "fields": {
                        "name": "new company"
                    }
                },
                "tags": [],
                "latestTimelineId": "6",
                "viewId": "2",
                "latestObjectType": "view",
                "title": "DocuSign: Test Email",
                "description": "DocuSign: Test Email",
                "channel": "view",
                "status": null,
                "agentList": [],
                "departmentList": [],
                "lastViewObject": {
                    "viewId": 2,
                    "iconImageUrl": "../../../../../assets/app-store/docusign.svg",
                    "iconFont": null
                },
                "clientUserId": null,
                "contactCompanyCount": 1,
                "companyId": 1,
                "totalTimeline": 6,
                "lastDateUpdated": "2020-07-08 07:10:58",
                "totalNotes": 0,
                "totalViews": 3,
                "totalCase": 3,
                "msgUnread": 0,
                "channels": [
                    "view"
                ],
                "firstInteractionType": null,
                "lastInteractionType": "view",
                "isBlocked": "NO",
                "lastVisit": {
                    "id": 2,
                    "contactId": 77,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-05-22T06:04:45.000Z"
                },
                "firstVisit": {
                    "id": 7,
                    "contactId": 77,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-07-08T07:03:57.000Z"
                },
                "interaction": [],
                "snoozeInContact": false
            },
            {
                "dateCreated": "2020-05-27T05:52:05.000Z",
                "dateUpdated": "2020-05-27T05:52:22.000Z",
                "id": 1,
                "clientType": "web",
                "clientName": "Chrome",
                "clientVersion": "81.0",
                "clientOsName": "Windows",
                "clientOsVersion": "10",
                "clientDeviceType": null,
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "clientDetails": {
                    "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
                    "engine": {
                        "name": "Blink",
                        "version": "81.0.4044.138"
                    },
                    "network": {
                        "type": "4g",
                        "speed": "4.41"
                    }
                },
                "fields": {
                    "city": "Jodhpur",
                    "state": "Rajasthan",
                    "country": {
                        "name": "India",
                        "name_official": "Republic of India",
                        "cca2": "IN",
                        "ccn3": "35",
                        "cca3": "IND",
                        "calling_code1": 91,
                        "region_id": 366,
                        "lat": "20",
                        "lng": "77",
                        "voip_enable": true
                    },
                    "countryId": "387",
                    "ip": "103.61.112.45"
                },
                "company": {
                    "fields": {}
                },
                "tags": [],
                "latestTimelineId": "1",
                "caseId": "1",
                "latestObjectType": "case",
                "title": "#1 : test",
                "description": "test",
                "channel": "chat",
                "status": "closed",
                "agentList": [
                    {
                        "departments": [],
                        "roles": [],
                        "id": 1,
                        "name": "Surendra Suthar",
                        "firstName": "Surendra Suthar",
                        "lastName": "",
                        "photo": "",
                        "email": "surendra@acquire.io",
                        "clientId": "",
                        "parentId": 0,
                        "title": "Surendra Suthar",
                        "url": "",
                        "alt": "Surendra Suthar"
                    }
                ],
                "departmentList": [],
                "lastViewObject": null,
                "clientUserId": null,
                "contactCompanyCount": null,
                "companyId": null,
                "totalTimeline": 1,
                "lastDateUpdated": "2020-05-27 05:52:22",
                "totalNotes": 0,
                "totalViews": 0,
                "totalCase": 1,
                "caseDateUpdated": "2020-05-27T05:52:22.000Z",
                "msgUnread": 0,
                "channels": [
                    "chat"
                ],
                "firstInteractionType": null,
                "lastInteractionType": "chat",
                "isBlocked": "NO",
                "lastVisit": {
                    "id": 1,
                    "contactId": 1,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-05-27T05:52:05.000Z"
                },
                "firstVisit": {
                    "id": 1,
                    "contactId": 1,
                    "title": "Acquire | Test Simulate Page",
                    "url": "https://suthar.uat.env.acquire.io/simulate",
                    "source": "",
                    "dateCreated": "2020-05-27T05:52:05.000Z"
                },
                "interaction": [],
                "snoozeInContact": false
            }
        ],
        "counts": {
            "total": 6,
            "records": 6,
            "pending": 0,
            "active": 1
        }
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The Search Contact List endpoint is in beta testing. Some features may not work as documented or may behave unexpectedly.&#x20;
{% endhint %}

## Search Contact List

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/contact/list`

Search contact list by keyword.&#x20;

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

| Name   | Type   | Description                        |
| ------ | ------ | ---------------------------------- |
| search | string | Specify the string value to search |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "list": [
            {
                "id": 6545537,
                "meta": {},
                "archive": "no",
                "field_id": 2,
                "value": "viswanath.sarma@acquire.io",
                "owner": "contact",
                "object": "contact",
                "key": "email",
                "type": "text",
                "config": "{\"input\": {\"type\": \"text\", \"label\": \"Email!!!!\", \"required\": false, \"placeholder\": \"\", \"validationType\": \"format\", \"validationFormat\": \"email\", \"requiredErrorMessage\": \"Unfortunately this cannot be blank.\", \"validationErrorMessage\": \"Oops! Looks like format you entered is wrong. Can you please recheck your email?\"}, \"label\": \"Email!!!!\", \"backend\": {\"list\": false}, \"capture\": [\"api\"], \"online_order\": 9, \"offline_order\": 8492}",
                "system": "yes",
                "mainContactId": 6545537,
                "contactId": 6545537,
                "clientType": null,
                "clientName": null,
                "clientVersion": null,
                "clientOsName": null,
                "clientOsVersion": null,
                "clientDeviceType": null,
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "companyId": 149,
                "dateCreated": "2021-07-16 11:49:24",
                "dateUpdated": "2021-07-16 11:49:51",
                "clientDetails": null,
                "fields": {
                    "email": "viswanath.sarma@acquire.io",
                    "city": "",
                    "state": null,
                    "country": {
                        "name": "United States",
                        "name_official": "United States of America",
                        "cca2": "US",
                        "ccn3": "84",
                        "cca3": "USA",
                        "calling_code1": 1,
                        "region_id": 496,
                        "lat": "38",
                        "lng": "-97",
                        "voip_enable": true
                    },
                    "countryId": "517",
                    "ip": "2405:201:c032:1014:76e9:781c:e56d:ebc",
                    "calling_code": "1",
                    "contact_country_flag": "USA"
                },
                "tags": [],
                "company": {
                    "fields": {
                        "name": "Acquire",
                        "website": "acquire.io",
                        "logo": "https://organization.uat.env.acquire.io/logo/acquire.io.png",
                        "industry": null,
                        "description": "",
                        "source": null,
                        "employees": "100",
                        "foundation": null,
                        "address": ""
                    },
                    "id": 149,
                    "dateCreated": "2021-05-20 09:57:31",
                    "dateUpdated": "2021-05-25 06:04:13"
                }
            },
            {
                "id": 57,
                "meta": {},
                "archive": "no",
                "field_id": 2,
                "value": "viswanath.sarma@acquire.io",
                "owner": "contact",
                "object": "contact",
                "key": "email",
                "type": "text",
                "config": "{\"input\": {\"type\": \"text\", \"label\": \"Email!!!!\", \"required\": false, \"placeholder\": \"\", \"validationType\": \"format\", \"validationFormat\": \"email\", \"requiredErrorMessage\": \"Unfortunately this cannot be blank.\", \"validationErrorMessage\": \"Oops! Looks like format you entered is wrong. Can you please recheck your email?\"}, \"label\": \"Email!!!!\", \"backend\": {\"list\": false}, \"capture\": [\"api\"], \"online_order\": 9, \"offline_order\": 8492}",
                "system": "yes",
                "mainContactId": 57,
                "contactId": 57,
                "clientType": "web",
                "clientName": "Chrome",
                "clientVersion": "84.0",
                "clientOsName": "Windows",
                "clientOsVersion": "8.1",
                "clientDeviceType": null,
                "clientDeviceVendor": null,
                "clientDeviceModel": null,
                "companyId": null,
                "dateCreated": "2020-08-05 10:48:24",
                "dateUpdated": "2021-07-05 06:29:13",
                "clientDetails": {
                    "ua": "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
                    "engine": {
                        "name": "Blink",
                        "version": "84.0.4147.105"
                    },
                    "network": {
                        "type": "3g",
                        "speed": "2.52"
                    }
                },
                "fields": {
                    "name": "Viswanath Sarma",
                    "email": "viswanath.sarma@acquire.io",
                    "phone": "7412356890"
                },
                "tags": [],
                "company": {
                    "fields": {}
                }
            }
        ],
        "counts": {
            "filteredCount": 2
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
  "payload": {},
  "page": 0,
  "limit": 0,
  "search": "viswanath.sarma@acquire.io"
}
```


# Retrieve a contact

Retrieve a single contact.

## Single contact

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/contact/{{contactId}}`

Retrieve data for a single contact. The **contactId** must be passed in to the endpoint as a path parameter.

#### Path Parameters

| Name                                        | Type    | Description       |
| ------------------------------------------- | ------- | ----------------- |
| contactId<mark style="color:red;">\*</mark> | integer | ID of the contact |

#### Query Parameters

| Name      | Type   | Description                                                            |            |            |               |                 |             |              |                     |                  |                        |                   |                   |               |
| --------- | ------ | ---------------------------------------------------------------------- | ---------- | ---------- | ------------- | --------------- | ----------- | ------------ | ------------------- | ---------------- | ---------------------- | ----------------- | ----------------- | ------------- |
| select    | string | <p>Can be one of id                                                    | clientName | clientType | clientVersion | <br>dateUpdated | dateCreated | clientOsName | <br>clientOsVersion | clientDeviceType | <br>clientDeviceVendor | clientDeviceModel | <br>clientDetails | companyId</p> |
| relations | string | Can be one of company \| cases \| fields \| tags \| visits \| timeline |            |            |               |                 |             |              |                     |                  |                        |                   |                   |               |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "dateCreated": "2020-08-11T07:25:59.000Z",
        "dateUpdated": "2020-08-11T07:27:14.000Z",
        "id": 1,
        "clientType": "web",
        "clientName": "Chrome",
        "clientVersion": "84.0",
        "clientOsName": "Windows",
        "clientOsVersion": "10",
        "clientDeviceType": null,
        "clientDeviceVendor": null,
        "clientDeviceModel": null,
        "clientDetails": {
            "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
            "engine": {
                "name": "Blink",
                "version": "84.0.4147.105"
            },
            "network": {
                "type": "3g",
                "speed": "2.52"
            }
        },
        "archive": "no",
        "company": {
            "dateCreated": "2020-08-11T07:26:24.000Z",
            "dateUpdated": null,
            "id": 1,
            "fields": {
                "name": "Yahoo!",
                "website": "yahoo.com",
                "logo": "https://organization.acquire.io/logo/yahoo.com.png"
            }
        },
        "cases": [
            {
                "dateCreated": "2020-08-11T07:26:23.000Z",
                "dateUpdated": "2020-08-11T07:26:28.000Z",
                "id": 1,
                "contactId": 1,
                "closedBy": null,
                "visitId": 1,
                "title": "test : ",
                "description": "",
                "channel": "chat",
                "status": "active",
                "closingState": "handled",
                "dateQueue": "2020-08-11T07:26:23.000Z",
                "datePending": "2020-08-11T07:26:23.000Z",
                "dateActive": "2020-08-11T07:26:28.000Z",
                "dateClosed": null,
                "queueId": null,
                "queueOrder": null,
                "parentId": null,
                "userId": null,
                "waitTime": 0,
                "users": [
                    {
                        "id": 2,
                        "caseId": 1,
                        "type": "user",
                        "userId": 1,
                        "role": "owner",
                        "status": "active",
                        "dateCreated": "2020-08-11T07:26:22.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 3,
                        "caseId": 1,
                        "type": "user",
                        "userId": 6,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:26:22.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 4,
                        "caseId": 1,
                        "type": "user",
                        "userId": 7,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:26:22.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 5,
                        "caseId": 1,
                        "type": "user",
                        "userId": 8,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:26:22.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 6,
                        "caseId": 1,
                        "type": "user",
                        "userId": 9,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:26:22.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 7,
                        "caseId": 1,
                        "type": "user",
                        "userId": 10,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:26:22.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 1,
                        "caseId": 1,
                        "type": "contact",
                        "userId": 1,
                        "role": "owner",
                        "status": "active",
                        "dateCreated": "2020-08-11T07:26:22.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    }
                ],
                "threadId": 1
            },
            {
                "dateCreated": "2020-08-11T07:27:14.000Z",
                "dateUpdated": "2020-08-11T07:27:19.000Z",
                "id": 2,
                "contactId": 1,
                "closedBy": null,
                "visitId": 2,
                "title": "test : ",
                "description": "",
                "channel": "chat",
                "status": "active",
                "closingState": "handled",
                "dateQueue": "2020-08-11T07:27:14.000Z",
                "datePending": "2020-08-11T07:27:14.000Z",
                "dateActive": "2020-08-11T07:27:18.000Z",
                "dateClosed": null,
                "queueId": null,
                "queueOrder": null
                "parentId": null,
                "userId": null,
                "waitTime": 0,
                "users": [
                    {
                        "id": 9,
                        "caseId": 2,
                        "type": "user",
                        "userId": 1,
                        "role": "owner",
                        "status": "active",
                        "dateCreated": "2020-08-11T07:27:13.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 10,
                        "caseId": 2,
                        "type": "user",
                        "userId": 6,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:27:13.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 11,
                        "caseId": 2,
                        "type": "user",
                        "userId": 7,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:27:13.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 12,
                        "caseId": 2,
                        "type": "user",
                        "userId": 8,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:27:13.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 13,
                        "caseId": 2,
                        "type": "user",
                        "userId": 9,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:27:13.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 14,
                        "caseId": 2,
                        "type": "user",
                        "userId": 10,
                        "role": "owner",
                        "status": "rejected",
                        "dateCreated": "2020-08-11T07:27:13.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    },
                    {
                        "id": 8,
                        "caseId": 2,
                        "type": "contact",
                        "userId": 1,
                        "role": "owner",
                        "status": "active",
                        "dateCreated": "2020-08-11T07:27:13.000Z",
                        "dateLastAssigned": "2020-10-15T09:01:54.000Z",
                        "closed": "no"
                    }
                ],
                "threadId": 2
            }
        ],
        "fields": {
            "name": "test",
            "email": "test@yahoo.com",
            "phone": "1343435454545",
            "city": "Sikar",
            "state": "Rajasthan",
            "country": {
                "name": "India",
                "name_official": "Republic of India",
                "cca2": "IN",
                "ccn3": "35",
                "cca3": "IND",
                "calling_code1": 91,
                "region_id": 366,
                "lat": "20",
                "lng": "77",
                "voip_enable": true
            },
            "countryId": "387",
            "ip": "157.37.227.248"
        }
    }
}
```

{% endtab %}
{% endtabs %}


# Add contact

Add a contact.

## Add a contact

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/contact`

Add a contact. Contacts may be created with attributes such as `"name"`, `"email"`, `"phone"`, `"city"`, etc. See example body below. \
\
You may use Custom Attributes during a POST request. If you're using radio or drop-down fields, ensure that the input matches the options. Use the Custom Attribute key in the fields body. You may find the Custom Attribute key in **Settings > Account Settings > Custom Attributes**. For example: \
`"fields":{`\
&#x20;  `"custom attribute key": "my custom attribute"`\
`}`

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                     | Type   | Description     |
| ---------------------------------------- | ------ | --------------- |
| phone                                    | string | Contact's phone |
| email                                    | string | Contact's email |
| name                                     | string | Contact's name  |
| fields<mark style="color:red;">\*</mark> | object | field body      |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "dateCreated": "2021-03-10T07:27:53.593Z",
        "dateUpdated": "string",
        "clientType": "web",
        "clientName": "Chrome",
        "clientVersion": "81.0",
        "clientOsName": "Windows",
        "clientOsVersion": "10",
        "clientDeviceType": null,
        "clientDeviceVendor": null,
        "clientDeviceModel": null,
        "clientDetails": {},
        "archive": "no",
        "companyId": null,
        "id": 12,
        "fields": {
            "name": "API  Deo",
            "email": "John@acquire.io",
            "phone": "9460731950",
            "city": "San Francisco",
            "state": "California",
            "country": {
                "name": "United States",
                "name_official": "United States of America",
                "cca2": "US",
                "ccn3": "84",
                "cca3": "USA",
                "calling_code1": 1,
                "region_id": 496,
                "lat": "38",
                "lng": "-97",
                "voip_enable": true
            },
            "countryId": "517",
            "ip": "103.61.112.45"
        }
    }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
    "fields": {
        "name": "API  Deo",
        "email": "John@acquire.io",
        "phone": "9460731950",
        "city": "San Francisco",
        "state": "California",
        "countryId": "517",
        "ip": "103.61.112.45"
    },
    "dateCreated": "string",
    "dateUpdated": "string",
    "clientType": "web",
    "clientName": "Chrome",
    "clientVersion": "81.0",
    "clientOsName": "Windows",
    "clientOsVersion": "10",
    "clientDeviceType": null,
    "clientDeviceVendor": null,
    "clientDeviceModel": null,
    "clientDetails": {}
}
```


# Block Contact

Block an existing contact from the contact list and widget.

## Block a contact

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/block-visitor​`

Use this endpoint to block contacts. Contacts are blocked by their ID. To find a contact's ID, log in to Acquire and hover over their name in the Contact List or send a GET request to List all contacts.

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                        | Type   | Description                   |
| ------------------------------------------- | ------ | ----------------------------- |
| data<mark style="color:red;">\*</mark>      | array  | array of contact IDs to block |
| type<mark style="color:red;">\*</mark>      | string | contact                       |
| blockTill<mark style="color:red;">\*</mark> | string | date until block expires      |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": true
}
```

{% endtab %}
{% endtabs %}

**Body(raw)**

```
{
    "data": [
        827
    ],
    "type": "contact",
    "blockTill": "2021-09-09T07:08:12.658Z"
}
```


# Merge contact

Use this endpoint to merge two or more contacts. The secondary contacts **(mergeIds)** will be merged onto the primary contact (**primary\_contact\_id)**. Merge data includes conversation, chats, notes, views, etc. The primary contact ID in the endpoint URL **(primary\_contact\_id)** is required. Place the secondary\_contact\_ids  in the request body.

**Contact Ids** can be found by going to the Acquire platform and hovering over a contact's name in `Contact List` or by using the endpoint **GET** All Contacts.

If a secondary merge's contact details are different from the primary contact details, both contact details will be preserved on the primary contact profile. For example, if a secondary merge contact has an email that differs from their primary email, both emails will be preserved on the primary contact profile after the merge.

{% hint style="danger" %}
Warning: merges cannot be reverted.
{% endhint %}

## Merge Contact

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/contact/merge/{{contactId}}`

#### Path Parameters

| Name                                        | Type    | Description       |
| ------------------------------------------- | ------- | ----------------- |
| contactId<mark style="color:red;">\*</mark> | integer | ID of the contact |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                       | Type    | Description                         |
| ------------------------------------------ | ------- | ----------------------------------- |
| soureIds<mark style="color:red;">\*</mark> | integer | ID of the contact you want to merge |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 83,
        "message": "#78 contact timeline's merged with #83 successfully."
    }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
  "sourceIds": [
    11
  ]
}
```


# Update contact

Update a contact.

## Update a contact

<mark style="color:orange;">`PUT`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/contact/{{contactId}}`

Update data for a single customer. The **contactId** must be passed in to the endpoint as a path parameter.

#### Path Parameters

| Name                                        | Type    | Description      |
| ------------------------------------------- | ------- | ---------------- |
| contactId<mark style="color:red;">\*</mark> | integer | ID of a contact. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{api\_key}} |

#### Request Body

| Name   | Type   | Description     |
| ------ | ------ | --------------- |
| phone  | string | Contact's phone |
| email  | string | Contact's email |
| name   | string | Contact's name  |
| fields | object | field object    |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "dateCreated": "string",
        "dateUpdated": "string",
        "id": 2,
        "clientType": "web",
        "clientName": "Chrome",
        "clientVersion": "81.0",
        "clientOsName": "Windows",
        "clientOsVersion": "10",
        "clientDeviceType": null,
        "clientDeviceVendor": null,
        "clientDeviceModel": null,
        "clientDetails": {},
        "archive": "no",
        "companyId": 5,
        "fields": {
            "name": "John  Deo",
            "email": "John@acquire.io",
            "phone": "9460731950",
            "city": "San Francisco",
            "state": "California",
            "country": {
                "name": "United States",
                "name_official": "United States of America",
                "cca2": "US",
                "ccn3": "84",
                "cca3": "USA",
                "calling_code1": 1,
                "region_id": 496,
                "lat": "38",
                "lng": "-97",
                "voip_enable": true
            },
            "countryId": "517",
            "ip": "103.61.112.45"
        }
    }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
    "fields": {
        "name": "John  Deo",
        "email": "John@acquire.io",
        "phone": "9460731950",
        "city": "San Francisco",
        "state": "California",
        "countryId": "517",
        "ip": "103.61.112.45"
    },
    "dateCreated": "string",
    "dateUpdated": "string",
    "clientType": "web",
    "clientName": "Chrome",
    "clientVersion": "81.0",
    "clientOsName": "Windows",
    "clientOsVersion": "10",
    "clientDeviceType": null,
    "clientDeviceVendor": null,
    "clientDeviceModel": null,
    "clientDetails": {}
}
```


# Delete contact

Delete a contact.

## Delete contact

<mark style="color:red;">`DELETE`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/contact/{{contactId}}`

Delete a customer. The **contactId** must be passed in to the endpoint as a path parameter. **Warning**: This action cannot be undone.

#### Path Parameters

| Name                                        | Type    | Description      |
| ------------------------------------------- | ------- | ---------------- |
| contactId<mark style="color:red;">\*</mark> | integer | The contact's ID |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "deleted": 1
  }
}
```

{% endtab %}
{% endtabs %}


# Company

A company is an organization that a contact belongs to. Contacts from the same organization should be grouped in a company.

The Company API can be used to create, update, retrieve, and delete records in a company object. The **relations** parameter with a value **contact** is required to obtain a company's contacts (i.e., employees).

### Attributes&#x20;

| ATTRIBUTE   | TYPE                                 | DESCRIPTION                                                                                                                                             |
| ----------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id          | Integer                              | ID of the company                                                                                                                                       |
| fields      | JSON object (Entity Relations)       | Information about a company such as company name, website, industry, description, source, revenue, city, state, country, address, employees, foundation |
| contacts    | JSON Array Object (Entity Relations) | Information about company's contacts                                                                                                                    |
| dateCreated | datetime                             | Company creation timestamp                                                                                                                              |
| dateUpdated | datetime                             | Company updated timestamp                                                                                                                               |

### **Permissions**

To request a company endpoint you will need a valid API Key with company access permissions.

### **Relations between companies and other entities**

A company has many contacts. Contacts belong to a company.&#x20;


# List all companies

Lists all companies in the account.

## All Companies

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/company`

This API can be used to retrieve a list of companies with contact objects.

#### Query Parameters

| Name      | Type   | Description                                              |            |                                      |    |        |
| --------- | ------ | -------------------------------------------------------- | ---------- | ------------------------------------ | -- | ------ |
| limit     | string | The number of results *e.g.* 20                          |            |                                      |    |        |
| where     | array  | <p>Format :<br>column                                    | expression | value columns</p><p><em>e.g.</em> id | eq | 12</p> |
| select    | array  | Can be one of dateCreated \| dateUpdated \| id \| parent |            |                                      |    |        |
| relations | array  | Can be one of contacts \| fields \| parent \| companies  |            |                                      |    |        |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "page": 0,
        "offset": 0,
        "limit": 20,
        "count": 5,
        "data": [
            {
                "dateCreated": "2020-08-11T11:07:46.000Z",
                "dateUpdated": "2020-08-11T11:07:46.000Z",
                "id": 1,
                "parent": null,
                "companies": [],
                "contacts": [
                    {
                        "dateCreated": "2020-05-22T06:04:45.000Z",
                        "dateUpdated": "2020-08-11T11:07:46.000Z",
                        "id": 77,
                        "clientType": "web",
                        "clientName": "Chrome",
                        "clientVersion": "83.0",
                        "clientOsName": "Windows",
                        "clientOsVersion": "10",
                        "clientDeviceType": null,
                        "clientDeviceVendor": null,
                        "clientDeviceModel": null,
                        "clientDetails": {
                            "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
                            "engine": {
                                "name": "Blink",
                                "version": "83.0.4103.116"
                            },
                            "network": {
                                "type": "4g",
                                "speed": "16.56"
                            }
                        },
                        "companyId": 1,
                        "fields": {
                            "name": "Surendra Sutahr",
                            "email": "surendra@docusign.com",
                            "city": "Jaipur",
                            "state": "Rajasthan",
                            "country": {
                                "name": "India",
                                "name_official": "Republic of India",
                                "cca2": "IN",
                                "ccn3": "35",
                                "cca3": "IND",
                                "calling_code1": 91,
                                "region_id": 366,
                                "lat": "20",
                                "lng": "77",
                                "voip_enable": true
                            },
                            "countryId": "387",
                            "ip": "157.37.236.36"
                        },
                        "objectCounts": {
                            "totalCases": 3,
                            "totalNotes": 0,
                            "totalViews": 3
                        }
                    }
                ],
                "fields": {
                    "name": "new company"
                }
            },
            {
                "dateCreated": "2020-08-12T07:06:24.000Z",
                "dateUpdated": null,
                "id": 2,
                "parent": null,
                "companies": [],
                "contacts": [
                    {
                        "dateCreated": "2020-08-10T08:32:48.000Z",
                        "dateUpdated": "2020-08-12T07:06:19.000Z",
                        "id": 78,
                        "clientType": "web",
                        "clientName": "Chrome",
                        "clientVersion": "84.0",
                        "clientOsName": "Windows",
                        "clientOsVersion": "10",
                        "clientDeviceType": null,
                        "clientDeviceVendor": null,
                        "clientDeviceModel": null,
                        "clientDetails": {
                            "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
                            "engine": {
                                "name": "Blink",
                                "version": "84.0.4147.105"
                            },
                            "network": {
                                "type": "4g",
                                "speed": "1.62"
                            }
                        },
                        "companyId": 2,
                        "fields": {
                            "email": "test@facebook.com",
                            "city": "Jaipur",
                            "state": "Rajasthan",
                            "country": {
                                "name": "India",
                                "name_official": "Republic of India",
                                "cca2": "IN",
                                "ccn3": "35",
                                "cca3": "IND",
                                "calling_code1": 91,
                                "region_id": 366,
                                "lat": "20",
                                "lng": "77",
                                "voip_enable": true
                            },
                            "countryId": "387",
                            "ip": "157.37.148.6"
                        },
                        "objectCounts": {
                            "totalCases": 0,
                            "totalNotes": 0,
                            "totalViews": 1
                        }
                    }
                ],
                "fields": {
                    "name": "Facebook",
                    "website": "facebook.com",
                    "logo": "https://organization.uat.env.acquire.io/logo/facebook.com.png"
                }
            },
            {
                "dateCreated": "2020-09-09T10:02:01.000Z",
                "dateUpdated": null,
                "id": 3,
                "parent": null,
                "companies": [],
                "contacts": [
                    {
                        "dateCreated": "2020-09-09T10:01:36.000Z",
                        "dateUpdated": "2020-09-09T10:01:58.000Z",
                        "id": 82,
                        "clientType": "web",
                        "clientName": "Chrome",
                        "clientVersion": "85.0",
                        "clientOsName": "Windows",
                        "clientOsVersion": "10",
                        "clientDeviceType": "Desktop",
                        "clientDeviceVendor": null,
                        "clientDeviceModel": null,
                        "clientDetails": {
                            "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36",
                            "engine": {
                                "name": "Blink",
                                "version": "85.0.4183.83"
                            },
                            "network": {
                                "type": "4g",
                                "speed": "18"
                            }
                        },
                        "companyId": 3,
                        "fields": {
                            "name": "test",
                            "email": "test@gmailc.om",
                            "phone": "23232323",
                            "city": "Kanpur",
                            "state": "Uttar Pradesh",
                            "country": {
                                "name": "India",
                                "name_official": "Republic of India",
                                "cca2": "IN",
                                "ccn3": "35",
                                "cca3": "IND",
                                "calling_code1": 91,
                                "region_id": 366,
                                "lat": "20",
                                "lng": "77",
                                "voip_enable": true
                            },
                            "countryId": "387",
                            "ip": "112.196.188.108"
                        },
                        "objectCounts": {
                            "totalCases": 1,
                            "totalNotes": 0,
                            "totalViews": 0
                        }
                    }
                ],
                "fields": {
                    "name": "Gmail",
                    "website": "gmailc.om",
                    "logo": null,
                    "industry": null,
                    "description": null,
                    "source": null,
                    "address": null,
                    "employees": null,
                    "foundation": null
                }
            },
            {
                "dateCreated": "2020-09-10T11:44:05.000Z",
                "dateUpdated": "2020-09-10T11:44:05.000Z",
                "id": 4,
                "parent": null,
                "companies": [],
                "contacts": [],
                "fields": {
                    "name": "new company"
                }
            },
            {
                "dateCreated": "2020-09-10T11:44:05.000Z",
                "dateUpdated": "2020-09-10T11:49:52.000Z",
                "id": 5,
                "parent": null,
                "companies": [],
                "contacts": [],
                "fields": {
                    "name": "Zery",
                    "website": "zery.com",
                    "industry": "IT",
                    "description": "No description ",
                    "source": "No source added",
                    "revenue": "100000",
                    "city": "SF",
                    "state": "california",
                    "country": {
                        "name": "United States",
                        "name_official": "United States of America",
                        "cca2": "US",
                        "ccn3": "84",
                        "cca3": "USA",
                        "calling_code1": 1,
                        "region_id": 496,
                        "lat": "38",
                        "lng": "-97",
                        "voip_enable": true
                    },
                    "countryId": "517",
                    "address": "SF, california",
                    "employees": "50-100",
                    "foundation": "2020"
                }
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}


# Retrieve a company

Gets the specified company.

## Single Company

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/company/{{companyId}}`

This endpoint is used to obtain specific company details.

#### Path Parameters

| Name      | Type    | Description        |
| --------- | ------- | ------------------ |
| companyId | integer | ID of the company. |

#### Query Parameters

| Name      | Type  | Description                                   |
| --------- | ----- | --------------------------------------------- |
| select    | array | Can be one of  id\|dateCreated\|dateUpdated   |
| relations | array | Can be one of fields \| contacts \| companies |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "dateCreated": "2020-09-10T11:44:05.000Z",
        "dateUpdated": "2020-09-10T11:44:05.000Z",
        "id": 7,
        "fields": {
            "name": "Zery12",
            "website": "zery12.com",
            "logo": "IT",
            "industry": "IT",
            "description": "No description ",
            "source": "No source added",
            "revenue": "1050000",
            "city": "SF1",
            "state": "california"
        },
        "contacts": []
    }
}
```

{% endtab %}
{% endtabs %}


# Add company

Add a company.

&#x20;

## Creates a new company

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/company`

This endpoint allows you to create a company. The body requires a `"fields"` key. See body example below.\
**Please note** that the system will try to match a company's name to the website address provided. You may need to manually add the correct name afterward.

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                          | Type   | Description                        |
| --------------------------------------------- | ------ | ---------------------------------- |
| description<mark style="color:red;">\*</mark> | string | A short description of the company |
| industry                                      | string | The company's industry             |
| website                                       | string | The company website                |
| name                                          | string | The company name                   |
| fields<mark style="color:red;">\*</mark>      | object | fields object                      |
| dateUpdated                                   | string | 2020-09-10T11:44:05.143Z           |
| dateCreated                                   | string | 2020-09-10T11:44:05.143Z           |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "fields": {
            "name": "Website.com Solutions Inc.",
            "website": "website.com",
            "industry": "IT",
            "description": "No description ",
            "source": "No source added",
            "revenue": "1050000",
            "city": "SF1",
            "state": "california",
            "logo": "https://organization.uat.env.acquire.io/logo/website.com.png"
        },
        "dateCreated": "2020-09-10T11:44:05.000Z",
        "dateUpdated": "2020-09-10T11:44:05.143Z",
        "id": 8
    }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
   "fields": {
       "name": "company name",
       "website": "example.com",
       "industry": "IT",
       "description": "No description ",
       "source": "No source added",
       "revenue": "1050000",
       "city": "SF1",
       "state": "california"
   },
   "dateCreated": "2020-09-10T11:44:05.143Z",
   "dateUpdated": "2020-09-10T11:44:05.143Z"
}
```


# Update company

Update company information.

## Update a Company

<mark style="color:orange;">`PUT`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/company/{{companyId}}`

This endpoint allows you to update a company. The **companyId** must be passed in to the endpoint as a path parameter. The `"fields"` key is required in the body. See example body below.\
**Please note** that the system will try to match a company's name to the website address provided. You may need to manually add the correct name afterward.

#### Path Parameters

| Name                                        | Type    | Description        |
| ------------------------------------------- | ------- | ------------------ |
| companyId<mark style="color:red;">\*</mark> | integer | ID of the company. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                     | Type   | Description  |
| ---------------------------------------- | ------ | ------------ |
| fields<mark style="color:red;">\*</mark> | object | field object |

{% tabs %}
{% tab title="200 " %}

```
{
   "data": {
       "dateCreated": "2020-09-10T11:44:05.000Z",
       "dateUpdated": "2020-09-10T11:44:05.000Z",
       "id": 77,
       "fields": {
           "name": "Updated Company",
           "website": "website.com",
           "industry": "IT",
           "description": "No description ",
           "source": "No source added",
           "revenue": "1050000",
           "city": "SF1",
           "state": "california"
       }
   }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```javascript
{
    "fields": {
        "name": "ZeryUpdated",
        "website": "zeryUpdated.com",
        "logo": "IT",
        "industry": "IT",
        "description": "No description ",
        "source": "No source added",
        "revenue": "1050000",
        "city": "SF1",
        "state": "california"
    },
    "dateCreated": "string",
    "dateUpdated": "string"
}
```


# Delete company

Delete a company.

## Delete a Company

<mark style="color:red;">`DELETE`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/objects/company/{{companyId}}`

This endpoint allows you to delete a company. Deleting companies doesn't delete related objects such as contacts or cases. **Warning:** This action cannot be undone.

#### Path Parameters

| Name                                        | Type    | Description        |
| ------------------------------------------- | ------- | ------------------ |
| companyId<mark style="color:red;">\*</mark> | integer | ID of the company. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

{% tabs %}
{% tab title="200 " %}

```
{
   "data": {
       "deleted": 1
   }
}
```

{% endtab %}
{% endtabs %}


# Phone

Import voice from phone systems into Acquire as conversations.

Integrate voice data into Acquire. These endpoints allow you to monitor and analyze audio data and integrate and interact with other telephony services.&#x20;

![](/files/-MbGixoRZOclpud0xyvs)

### Attributes&#x20;

| ATTRIBUTE    | TYPE   | DESCRIPTION                                                                              |
| ------------ | ------ | ---------------------------------------------------------------------------------------- |
| CallId       | String | Specify the ID of the call.                                                              |
| From         | String | Specify the phone number of the caller 'From'.                                           |
| To           | String | Specify the phone number of the callee 'To'.                                             |
| CallStatus   | String | <p>Specify the call status.<br>\['busy','no-answer','canceled','failed','completed']</p> |
| Duration     | Number | Specify the call duration in seconds.                                                    |
| Direction    | String | Specify the call direction. '**outgoing** \| **incoming**'                               |
| RecordingUrl | String | Specify the call recording URL.                                                          |
| email        | String | Specify the email of the callee.                                                         |

### Permissions

Permission and API Keys are not required to request a telecommunication-outsider endpoint.


# Call in queue

Capture data while calls are in the queue.

## Create a call in queue

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/voip/call-in-queue`

Create a call in the queue.

#### Request Body

| Name                                     | Type   | Description                |
| ---------------------------------------- | ------ | -------------------------- |
| CallId<mark style="color:red;">\*</mark> | string | ID of the call             |
| To<mark style="color:red;">\*</mark>     | string | Callee phone number 'To'   |
| From<mark style="color:red;">\*</mark>   | string | Caller phone number 'From' |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "success": true,
    "message": "Successfully saved"
  }
}
```

{% endtab %}
{% endtabs %}

## Body(raw)

```
{
  "From": "+1234567890",
  "To": "+1789451230",
  "CallId": "CA12345678904567890"
}
```


# Ringing

Capture data while a call is ringing.

## Create a ringing call

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/voip/call-ringing`

Create a ringing call.&#x20;

#### Request Body

| Name                                        | Type   | Description                                                   |
| ------------------------------------------- | ------ | ------------------------------------------------------------- |
| email<mark style="color:red;">\*</mark>     | string | Email of the callee. Email isn't required for incoming calls. |
| Direction<mark style="color:red;">\*</mark> | string | The direction of the call 'outgoing' \| 'incoming'            |
| CallId<mark style="color:red;">\*</mark>    | string | ID of the call                                                |
| To<mark style="color:red;">\*</mark>        | string | phone number of the callee                                    |
| From<mark style="color:red;">\*</mark>      | string | phone number of the caller                                    |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "success": true,
    "message": "Successfully saved"
  }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
  "From": "+1234567890",
  "To": "+1789451230",
  "CallId": "CA12345678904567890",
  "Direction": "incoming",
  "email": "user@example.com"
}
```


# Answered

Capture data while a call is answered.

## Create an answered call&#x20;

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/voip/call-answered`

Create an answered call.

#### Request Body

| Name                                        | Type   | Description                                         |
| ------------------------------------------- | ------ | --------------------------------------------------- |
| Direction<mark style="color:red;">\*</mark> | string | The direction of the call. 'outgoing' \| 'incoming' |
| From<mark style="color:red;">\*</mark>      | string | Phone number of the caller                          |
| To<mark style="color:red;">\*</mark>        | string | Phone number of the callee                          |
| CallId<mark style="color:red;">\*</mark>    | string | ID of the call                                      |
| email<mark style="color:red;">\*</mark>     | string | Email of the callee                                 |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "success": true,
    "message": "Successfully saved"
  }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
  "From": "+1234567890",
  "To": "+1789451230",
  "CallId": "CA12345678904567890",
  "email": "user@example.com",
  "Direction": "incoming"
}
```


# Call end

Capture data when a call ends.

## Create an end call

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/voip/call-end`

Create an ended call.

#### Request Body

| Name                                           | Type   | Description                                                                                                      |
| ---------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| Email<mark style="color:red;">\*</mark>        | string | Email of the callee. Email is optional for an incoming call.                                                     |
| From<mark style="color:red;">\*</mark>         | string | Phone number of the caller                                                                                       |
| To<mark style="color:red;">\*</mark>           | string | Phone number of the callee                                                                                       |
| CallId<mark style="color:red;">\*</mark>       | string | ID of the call.                                                                                                  |
| CallStatus<mark style="color:red;">\*</mark>   | string | <p>Specify the status of the call. <br>\['busy',<br>'no-answer',<br>'canceled',<br>'failed',<br>'completed']</p> |
| RecordingUrl<mark style="color:red;">\*</mark> | string | Specify the URL of the recording.                                                                                |
| Duration<mark style="color:red;">\*</mark>     | string | Specify the call duration (sec).                                                                                 |
| Direction<mark style="color:red;">\*</mark>    | string | Specify the direction of the call. 'outgoing' \| 'incoming'                                                      |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "success": true,
    "message": "Successfully saved"
  }
}
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
  "From": "+1234567890",
  "To": "+1789451230",
  "CallId": "CA12345678904567890",
  "email": "user@example.com",
  "CallStatus": "completed",
  "RecordingUrl": "string",
  "Duration": "10",
  "Direction": "incoming"
}
```


# Chatbot

Chatbots provide an automated way of interacting with visitors. There are two types: Conversational and Sequential.

### Permissions

To request a chatbot endpoint, you will need a valid API Key with chatbot access permissions.


# Conversational Bot

The Conversational Bot uses AI to respond to visitors.

Conversational bot API allows you to view, add, and edit questions in the group.

Source instruction guide, [click here](https://help.acquire.io/chatbots/build-conversational-bot).&#x20;

### Attributes&#x20;

| ATTRIBUTE   | TYPE     | DESCRIPTION                           |
| ----------- | -------- | ------------------------------------- |
| id          | Integer  | Specify the ID of the group.          |
| title       | String   | Specify the name of the group.        |
| description | String   | Specify the details of the group.     |
| isDefault   | Enum     | Specify the default or primary group. |
| askFeedback | Enum     | Specify the feedback of the bot.      |
| createdBy   | Integer  | Specify the owner or created user.    |
| updatedBy   | Integer  | Specify the updated by user id.       |
| dateCreated | datetime | Specify the group creation timestamp. |
| dateUpdated | datetime | Specify the group updated timestamp.  |

### **Permissions**

To request this endpoint you will need a valid API Key with the chatbot access permissions enabled.


# Groups

Questions and answers for Conversational bots are organized into Groups.

A group is a collection of questions and answers for a Conversational Chatbot.&#x20;

### Attributes&#x20;

| ATTRIBUTE   | TYPE     | DESCRIPTION                           |
| ----------- | -------- | ------------------------------------- |
| id          | Integer  | Specify the ID of the group.          |
| title       | String   | Specify the name of the group.        |
| description | String   | Specify the details of the group.     |
| isDefault   | Enum     | Specify the default or primary group. |
| askFeedback | Enum     | Specify the feedback of the bot.      |
| createdBy   | Integer  | Specify the owner or created user.    |
| updatedBy   | Integer  | Specify the updated by user id.       |
| dateCreated | datetime | Specify the group creation timestamp. |
| dateUpdated | datetime | Specify the group updated timestamp.  |

### Permissions&#x20;

To request a group endpoint, you will need a valid API Key with conversational chatbot group access permissions.

###


# Get Default Group

API to get the default bot group

## Get Default Group

<mark style="color:blue;">`GET`</mark> `https:/{{account_id}}.acquire.io/api/v1/bot/conv/default`

API to get the default bot group

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{api\_key}} |

{% tabs %}
{% tab title="200  " %}
{% tabs %}
{% tab title="Plain Text" %}

```
{
  "data": {
    "id": 1,
    "title": "Primary Group",
    "description": "Default question group created at the time of account registration.",
    "isDefault": "yes",
    "askFeedback": "disabled",
    "cascadeApplicable": "disabled",
    "createdBy": 1,
    "updatedBy": 1,
    "dateCreated": "2020-06-22T16:17:32.000Z",
    "dateUpdated": "2021-01-19T05:05:08.000Z"
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}


# List

API to list all the available groups

## List Groups

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/bot/group`

Retrieve a list of questions and answers in the Conversational Bot groups.&#x20;

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{api\_key}} |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "rows": [
      {
        "id": 1,
        "title": "Primary Group",
        "description": "Default question group created at the time of account registration.",
        "isDefault": "yes",
        "askFeedback": "disabled",
        "cascadeApplicable": "disabled",
        "createdBy": 1,
        "updatedBy": 1,
        "dateCreated": "2020-06-22T16:17:32.000Z",
        "dateUpdated": "2021-01-19T05:05:08.000Z"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}




---

[Next Page](/llms-full.txt/1)

