Upload Attachment (Resume) in Zoho Recruit in PHP code

Upload Attachment (Resume) in Zoho Recruit in PHP code

There is a function for the upload attachment API

function uploadAttachment($candidateId, $fileAttachment) {
            $header = [
                'Authorization: Zoho-oauthtoken '.$token->access_token,
                'Content-Type: multipart/form-data',
            ];

            $url = 'https://recruit.zoho.com/recruit/v2/Candidates/'.$candidateId.'/Attachments?attachments_category=Resume';
            $ch = curl_init( $url );
            curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
            curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
            curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
            curl_setopt( $ch, CURLOPT_POST, true );
            curl_setopt( $ch, CURLOPT_POSTFIELDS, $fileAttachment);
            $json_response = curl_exec( $ch );
            curl_getinfo( $ch, CURLINFO_HTTP_CODE );
            curl_close( $ch );

            $response = json_decode( $json_response );

            return $response;
        }

However, I am not sure how to complete the method. Candidates can be created from the form from our website, but resumes are not uploaded.

Can I have assistance how I can finish this?