# bit-form/2.9.1/includes/Core/Util/ApiResponse.php

Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator &amp; Custom Form Builder, version 2.9.1. 33 lines.

- Page: https://pluginprobe.com/plugins/bit-form/2.9.1/code/includes/Core/Util/ApiResponse.php
- Raw: https://pluginprobe.com/plugins/bit-form/2.9.1/raw/includes/Core/Util/ApiResponse.php
- Modified: 2023-07-16T07:55:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bit-form/2.9.1/code/includes/Core/Util/ApiResponse.php#L10-L20`.

```php
<?php

namespace BitCode\BitForm\Core\Util;

use BitCode\BitForm\Core\Database\FormEntryLogModel;

final class ApiResponse
{
  public function apiResponse($logID, $integrationId, $apiType, $responseType, $responseObj)
  {
    if (!$apiType || !$responseObj) {
      return false;
    }
    $apiType = wp_json_encode($apiType);
    $responseObj = wp_json_encode($responseObj);

    $ipTool = new IpTool();
    $user_details = $ipTool->getUserDetail();
    $formEntryModel = new FormEntryLogModel();
    $result = $formEntryModel->log_history_insert(
      [
        'log_id'         => $logID,
        'integration_id' => $integrationId,
        'api_type'       => $apiType,
        'response_type'  => $responseType,
        'response_obj'   => $responseObj,
        'created_at'     => $user_details['time'],
      ]
    );
    return $result;
  }
}

```
