Jump to content

Invalid request. ReportDataRequest property of the GetDataRequest2 object cannot be null. Expected object format is: \r\n


johnman

Recommended Posts

Good day

I will like to get customers credit details in my app after inputer the required parameters through the
form input. After inputing the required values in the form fields and clicking the submit button the
response was json with key but null value.

My Code
 

// Collection object

        $data = [

            'BVN' => $_POST["customerBVN2"],

            'SessionCode' => $_POST["sessionCode2"],

        ];

        $url = "https://api2.creditregistry.com/nigeria/AutoCred/v7.Test/api/Reports/GetData2";

        // Initializes a new cURL session

        $curl = curl_init($url);

        // Set the CURLOPT_RETURNTRANSFER option to true

        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

        // Set the CURLOPT_POST option to true for POST request

        curl_setopt($curl, CURLOPT_POST, true);

        // Set the request data as JSON using json_encode function

        curl_setopt($curl, CURLOPT_POSTFIELDS,  json_encode($data));

        // Set custom headers for RapidAPI Auth and Content-Type header


        curl_setopt($curl, CURLOPT_HTTPHEADER, [

            'Content-Type: application/json'

          ]);

        

        // Execute cURL request with all previous settings

        $response = curl_exec($curl);

        // Close cURL session

        curl_close($curl);

        echo $response . PHP_EOL;

Error response

{"Success":false,"Errors":["Invalid request. ReportDataRequest property of the GetDataRequest2 object cannot be null. Expected object format is: \r\n {\r\n \"SessionCode\": \"\",\r\n \"ReportDataRequest\": {\r\n \"BVN\": \"\",\r\n \"AccountOwnerIDs\": \"\",\r\n \"HistoryLengthInMonths\": 84,\r\n \"SectorExclusionIDs\": \"\",\r\n \"IncludeSMARTScore\": false,\r\n \"IncludePDFReport\": false,\r\n \"PDFReportType\": 110,\r\n \"Reason\": \"General credit inquiry\",\r\n \"GetNoMatchReport\": 0\r\n }\r\n}"],"SMARTScores":[],"Accounts":[],"PerformanceSummary":{"Inquiry_Count_12_Months":null,"Count_AccountStatus_Closed":null,"Count_AccountStatus_Delinquent_30_over_60_days":null,"Count_AccountStatus_Derogatory_120_days":null,"Count_AccountStatus_Derogatory_150_days":null,"Count_AccountStatus_Derogatory_Doubtful_180":null,"Count_AccountStatus_Derogatory_Lost_360":null,"Count_AccountStatus_Derogatory_Substandard_90":null,"Count_AccountStatus_Late_less_than_30_days":null,"Count_AccountStatus_Open":null,"Count_AccountStatus_Performing":null,"Count_AccountStatus_Unknown":null,"Count_AccountStatus_Unspecified":null,"Count_AccountStatus_Written_off":null,"Count_LegalStatus_Judgment":null,"Count_LegalStatus_Litigation":null,"Count_LegalStatus_Notice":null,"Count_LegalStatus_Receivership":null,"SelfInquiriesLast12Months":null,"DishonouredChequesLast12Months":null},"AccountSummaries":[],"PDFReport":{"Success":true,"Errors":[],"PDFContent":"","NoMatchPDFContent":"","ReportNo":"","Filename":"","StatusCode":200,"Message":""},"StatusCode":400,"Message":"Invalid request. ReportDataRequest property of the GetDataRequest2 object cannot be null."}

 

Kindly help

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.