WordPress: The parameter is required in custom_questions in zoom

before 3 days ago the code work good and auto registration is work, but today the auto registration not work and show me this error message

The parameter is required in custom_questions: I declare that I am responsible to write down my name the way I want it to appear on the Certificate of Attendance and no changes will be done after certificate issuance.

why !!

this is my code and add parameter and not work

function call_zoom_api($args){
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL => 'https://api.zoom.us/v2/' . $args['zoom_type'] . '/' . $args['zoom_meeting_id'] . '/registrants',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => '',
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 0,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => $args['type'],
        CURLOPT_POSTFIELDS => $args['data'],
        CURLOPT_HTTPHEADER => array(
            'authorization: Bearer ' . $args['api_key'],
            'Content-Type: application/json'
        ),
    ));
    $response = curl_exec($curl);
    curl_close($curl);
    return json_decode($response, true);
}

function store_zoom($user,$data){
    $responses = array();

    $zoom_options = get_option("zoom-option");
    foreach ($data["meetingIdSenda"] as $key => $zoom_meeting_id) {
        $zoom_type = $data["meetingIdType"][$key];
        $res = call_zoom_api([
            'zoom_type' => $zoom_type,
            'zoom_meeting_id' => $zoom_meeting_id,
            'type' => 'POST',
            'data' => '{
              "email": "' . $user->user_email . '",
              "first_name": "' . $data["fnameSenda"] . '",
              "last_name": "' . $data["lnameSenda"] . '",
              "phone": "' . $data["phoneSenda"] . '",
              "city": "string",
              "country": "AE",
              "custom_questions": [
                {
                    "title": "string",
                    "value": "string"
                }
            ],
              "address": "' . $data["saudiID"] . '"
            }',
            'api_key' => $zoom_options['api-token'],
        ]);

        if(!empty($res['join_url'])){
            wc_add_order_item_meta($data["itemId"][$key], '_zoom_registered',$res['registrant_id'],true);

            $responses[] = [
                'code' => 200,
                'res'=> $res,
                'message' => "Success Registration - for ". $zoom_type ." <a href='" . $res['join_url'] . "'>Meeting link</a>"
            ];
        }else {

            $responses['error'] = true;
            $responses[] = [
                'code' => 300,
                'res' => $res,
                'message' => $res['message']
            ];
        }

    }
    return $responses;

}

function get_zoom_data($order_item_id){


    $zoom_type = get_post_meta($order_item_id, 'zoom-type', true);
    $zoom_meeting_id = get_post_meta($order_item_id, 'zoom-meeting-id', true);
    if (!empty($zoom_meeting_id) && !empty($zoom_type)) {
        return [
            'zoom_types' => $zoom_type,
            'zoom_meeting_ids' => $zoom_meeting_id,
        ];
    }
    return false;
}
function update_zoom($order){

    $responses = array();
    $single_meet = array();
    foreach ($order->get_items() as $item) {
        $is_registered = !empty(wc_get_order_item_meta($item->get_id(), '_zoom_registered', true));
        if ($is_registered) {
            continue;
        }

        $order_item_id = wc_get_order_item_meta($item->get_id(), '_course_id');
        if ($order_item_id || $order_item_id == 0) {
            $order_item_id = $item->get_product_id();
        }

        $zoom_data = get_zoom_data($order_item_id);

        if($zoom_data){
            $single_meet[] = [
                'zoom_meeting_ids' => $zoom_data['zoom_meeting_ids'],
                'zoom_types' => $zoom_data['zoom_types'],
                'itemId' => $item->get_id(),
            ];
        }
    }

    if (!empty($single_meet) || $single_meet != null) {
        $responses[] = [
            'code' => 200,
            'res'=> $single_meet,
            'message' => "One step to be done"
        ];
    }

    return $responses;

}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.