Getting a 400 Invalid Data on the response

Getting a 400 Invalid Data on the response

Hi this is my code,
function upsert_users()
{
try {
$recordsArray = [ "data" => [
"First_Name" => "fname",
"Name" => "lname",
"Phone_number" => "+14055555555",
"Email" => "badboy@gmail.com",
"Account_Created_Date" => "42-15-2015",
"User_Status" => "active inactive",
"User_Login_Type" => "0 form website 1 from fb 2 from gp",
"User_Description" => "about the user description",
"User_Skills" => "handyman plumber",
"User_Future_Skills" => "newskills booking taxservice",
"User_PayPal_Id" => "asdfasf@asdfadsf.com",
"User_Address" => "142 hallow st",
"User_Other_Address" => "apt 111",
"User_City" => "plano",
"User_State" => "TX",
"User_ZipCode" => "75034",
"User_Degree" => "Bachelors",
'User_Institute' => "East Central University",
"User_Account_Type" => "1 for the provider and 2 for the consumer",
"User_Coupon_Code" => "PLANO2018",
"User_School" => "Newman Elementary",
"User_Where_Did_You_Hear_About_Us" => "links/friends",
"User_Last_Logged_In_Date" => "4-29-2019",
"User_Twitter_Verify" => "0/1",
"User_Instagram_Verify" => "0/1",
"User_LinkedIn_Verify" => "0/1",
"User_Facebook_Verify" => "0/1",
"User_Google_Verify" => "0/1",
"Record_Image" => "./assets/images/accounting.jpg",
"duplicate_check_fields" => [
"Email",
],
],
];
var_dump( json_encode( $recordsArray, JSON_PRETTY_PRINT));
$zcrmModuleIns = ZCRMModule:: getInstance( "aloovi");
$bulkAPIResponse = $zcrmModuleIns-> upsertRecords( json_encode( $recordsArray)); // $recordsArray - array of ZCRMRecord instances filled with required data for upsert.
$entityResponses = $bulkAPIResponse-> getEntityResponses();
if ( "success" == $entityResponse-> getStatus()) {
echo "Status:" . $entityResponse-> getStatus();
echo "Message:" . $entityResponse-> getMessage();
echo "Code:" . $entityResponse-> getCode();
$upsertData = $entityResponse-> getUpsertDetails();
echo "UPSERT_ACTION:" . $upsertData[“action”];
echo "UPSERT_DUPLICATE_FIELD:" . $upsertData[“duplicate_field”];
$createdRecordInstance = $entityResponse-> getData();
echo "EntityID:" . $createdRecordInstance-> getEntityId();
echo "moduleAPIName:" . $createdRecordInstance-> getModuleAPIName();
} else {
vardump( $entityResponse);
}
} catch ( ZCRMException $e) {
var_dump( $e);
echo $e-> getCode();
echo $e-> getMessage();
echo $e-> getExceptionCode();
}
}

upsert_users();

This is my response:
'{
    "data": {
        "First_Name": "fname",
        "Name": "lname",
        "Phone_number": "+14055555555",
        "Email": "badboy@gmail.com",
        "Account_Created_Date": "42-15-2015",
        "User_Status": "active inactive",
        "User_Login_Type": "0 form website 1 from fb 2 from gp",
        "User_Description": "about the user description",
        "User_Skills": "handyman plumber",
        "User_Future_Skills": "newskills booking taxservice",
        "User_PayPal_Id": "asdfasf@asdfadsf.com",
        "User_Address": "142 hallow st",
        "User_Other_Address": "apt 111",
        "User_City": "plano",
        "User_State": "TX",
        "User_ZipCode": "75034",
        "User_Degree": "Bachelors",
        "User_Institute": "East Central University",
        "User_Account_Type": "1 for the provider and 2 for the consumer",
        "User_Coupon_Code": "PLANO2018",
        "User_School": "Newman Elementary",
        "User_Where_Did_You_Hear_About_Us": "links\/friends",
        "User_Last_Logged_In_Date": "4-29-2019",
        "User_Twitter_Verify": "0\/1",
        "User_Instagram_Verify": "0\/1",
        "User_LinkedIn_Verify": "0\/1",
        "User_Facebook_Verify": "0\/1",
        "User_Google_Verify": "0\/1",
        "Record_Image": ".\/assets\/images\/accounting.jpg",
        "duplicate_check_fields": [
            "Email"
        ]
    }
}' (length=1379)

( ! ) Warning: sizeof(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\aloovi\vendor\zohocrm\php-sdk\src\com\zoho\crm\library\api\handler\MassEntityAPIHandler.php on line 81
Call Stack
# Time Memory Function Location
1 0.4018 439056 {main}( ) ...\zohocrm.php:0
2 0.7078 2968368 upsert_users( ) ...\zohocrm.php:117
3 0.7079 2973104 ZCRMModule->upsertRecords( ) ...\zohocrm.php:94
4 0.7079 2973264 MassEntityAPIHandler->upsertRecords( ) ...\ZCRMModule.php:961
5 0.7079 2973264 sizeof ( ) ...\MassEntityAPIHandler.php:81

( ! ) Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\aloovi\vendor\zohocrm\php-sdk\src\com\zoho\crm\library\api\handler\MassEntityAPIHandler.php on line 91
Call Stack
# Time Memory Function Location
1 0.4018 439056 {main}( ) ...\zohocrm.php:0
2 0.7078 2968368 upsert_users( ) ...\zohocrm.php:117
3 0.7079 2973104 ZCRMModule->upsertRecords( ) ...\zohocrm.php:94
4 0.7079 2973264 MassEntityAPIHandler->upsertRecords( ) ...\ZCRMModule.php:961
400invalid dataINVALID_DATA

And this is the response i get if i try the fields meta data api , i have followed everything that is says on the documentation and still i am getting 400 Invalid data. I cannot find what i am doing wrong.

  1. First_Name, 255, 1, First Name, default, , 0, , text, 3745992000000208282, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , Name, 120, 1, Last Name, default, , 0, , text, 3745992000000208236, , , VIEW, QUICK_CREATE, CREATE, EDIT, , , , , , , , , , , , , , Phone_number, 30, 1, Phone Number, default, , 0, , phone, 3745992000000208284, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , Email, 100, 1, Email, default, , 0, , email, 3745992000000208240, , 1, VIEW, QUICK_CREATE, CREATE, EDIT, , , , , , , , , , , , , , Created_Time, 120, 1, Created Time, default, , 0, , datetime, 3745992000000208248, , , VIEW, , , , , , , , , , , , , , Modified_Time, 120, 1, Modified Time, default, , 0, , datetime, 3745992000000208250, , , VIEW, , , , , , , , , , , , , , Last_Activity_Time, 120, 1, Last Activity Time, default, , 0, , datetime, 3745992000000208252, , , VIEW, , , , , , , , , , , , , , Account_Created_Date, 255, 1, Account Created Date, default, , 0, , text, 3745992000000244119, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Status, 255, 1, User Status, default, , 0, , text, 3745992000000244125, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Login_Type, 255, 1, User Login Type, default, , 0, , text, 3745992000000244131, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , Tag, 2000, 1, Tag, default, , 0, , text, 3745992000000208262, , 1, VIEW, , , , , , , , , , , , , , User_Description, 255, 1, User Description, default, , 0, , text, 3745992000000244137, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Skills, 255, 1, User Skills, default, , 0, , text, 3745992000000244059, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Future_Skills, 255, 1, User Future Skills, default, , 0, , text, 3745992000000244071, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_PayPal_Id, 255, 1, User PayPal Id, default, , 0, , text, 3745992000000244065, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Address, 255, 1, User Address, default, , 0, , text, 3745992000000244083, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Other_Address, 255, 1, User Other Address, default, , 0, , text, 3745992000000244077, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_City, 255, 1, User City, default, , 0, , text, 3745992000000244095, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_State, 255, 1, User State, default, , 0, , text, 3745992000000244089, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_ZipCode, 255, 1, User ZipCode, default, , 0, , text, 3745992000000244107, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Degree, 255, 1, User Degree, default, , 0, , text, 3745992000000244101, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Institute, 255, 1, User Institute, default, , 0, , text, 3745992000000244113, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Account_Type, 255, 1, User Account Type, default, , 0, , text, 3745992000000244017, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Coupon_Code, 255, 1, User Coupon Code, default, , 0, , text, 3745992000000244011, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_School, 255, 1, User School, default, , 0, , text, 3745992000000244029, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Where_Did_You_Hear_About_Us, 255, 1, User Where Did You Hear About Us, default, , 0, , text, 3745992000000244207, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Last_Logged_In_Date, 255, 1, User Last Logged In Date, default, , 0, , text, 3745992000000244213, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Twitter_Verify, 255, 1, User Twitter Verify, default, , 0, , text, 3745992000000244023, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Instagram_Verify, 255, 1, User Instagram Verify, default, , 0, , text, 3745992000000244041, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_LinkedIn_Verify, 255, 1, User LinkedIn Verify, default, , 0, , text, 3745992000000244035, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Facebook_Verify, 255, 1, User Facebook Verify, default, , 0, , text, 3745992000000244053, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , User_Google_Verify, 255, 1, User Google Verify, default, , 0, , text, 3745992000000244047, 1, 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , Owner, 120, 1, aloovi Owner, default, , 0, , ownerlookup, 3745992000000208238, , 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , , Record_Image, 255, 1, aloovi Image, default, , 0, , profileimage, 3745992000000208278, , 1, VIEW, CREATE, EDIT, , , , , , , , , , , , , ,
I am using php version 7.3.2