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

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

- Page: https://pluginprobe.com/plugins/bit-form/1.4.18/code/includes/Core/Util/ApiResponse.php
- Raw: https://pluginprobe.com/plugins/bit-form/1.4.18/raw/includes/Core/Util/ApiResponse.php
- Modified: 2020-11-24T13:07:08+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/1.4.18/code/includes/Core/Util/ApiResponse.php#L10-L20`.

```php
<?php

namespace BitCode\BitForm\Core\Util;

use BitCode\BitForm\Core\Database\FormEntryLogModel;
use BitCode\BitForm\Core\Util\IpTool;

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(
            array(
                "log_id" => $logID,
                "integration_id" => $integrationId,
                "api_type" =>  $apiType,
                "response_type" => $responseType,
                "response_obj" => $responseObj,
                "created_at" => $user_details['time'],
            )
        );
        return $result;
    }
}

```
