I have tried getting a response from my request but it didn't work.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://sandbox.monnify.com/api/v1/bank-transfer/reserved-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{\n \"accountReference\": \"0111443-JP098\",\n \"accountName\": \"Joe Philips\",\n \"currencyCode\": \"NGN\",\n \"contractCode\": \"6146592431\",\n \"customerEmail\": \"jp@tester.com\",\n \"customerName\": \"Joe Philips\",\n \"incomeSplitConfig\": [\n {\n \"subAccountCode\": \"MFY_SUB_275274693326\",\n \"feePercentage\": 10.5,\n \"splitPercentage\": 20,\n \"feeBearer\": true\n }\n ]\n}",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsibW9ubmlmeS1wYXltZW50LWVuZ2luZSJdLCJzY29wZSI6WyJwcm9maWxlIl0sImV4cCI6MTU5NzI2MzAyNCwiYXV0aG9yaXRpZXMiOlsiTVBFX01BTkFHRV9MSU1JVF9QUk9GSUxFIiwiTVBFX1VQREFURV9SRVNFUlZFRF9BQ0NPVU5UIiwiTVBFX0lOSVRJQUxJWkVfUEFZTUVOVCIsIk1QRV9SRVNFUlZFX0FDQ09VTlQiLCJNUEVfQ0FOX1JFVFJJRVZFX1RSQU5TQUNUSU9OIiwiTVBFX1JFVFJJRVZFX1JFU0VSVkVEX0FDQ09VTlQiLCJNUEVfREVMRVRFX1JFU0VSVkVEX0FDQ09VTlQiLCJNUEVfUkVUUklFVkVfUkVTRVJWRURfQUNDT1VOVF9UUkFOU0FDVElPTlMiXSwianRpIjoiYTQ5YjIxNDgtNTJkMy00ZGI1LTg2NGYtYzdiM2NjM2M4NzUzIiwiY2xpZW50X2lkIjoiTUtfVEVTVF9DSFZRRlJBN1NHIn0.mqwi5y7wnXpBCk6R9dC3ORhf9pNkwHVOCJr2SHUfk9TFYpVMnGuBUVyxJFOwLHROyKVodquPr1eS2AT1nTUDCrW0YXlX9tX5BPrfckvDoPPza7Klc8uQrw1aVxF6sAK-hFZgC79lKOq9gowOqWP1frbJ5BqozZfYiQ6ZsZcf2LubDOoen_G6_13wGtCM58-9BcY6aMKv--Vxr0AFwSqujBMny1D-x2SgsqT98asoYvtaHGtiC4MbVg-jFwwJuG4BYststO0k1J0YI5frpyLyQfaNEJSR6Y-WJiCqFWIDpHgDFINl65xtMIE_15OV2BKfBsruCo5mkx_rHPH_4_tXWw"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
These is the request code in curl, and below is the response
{
"requestSuccessful": true,
"responseMessage": "success",
"responseCode": "0",
"responseBody": {
"contractCode": "6146592431",
"accountReference": "abc123",
"accountName": "Test Reserved Account",
"currencyCode": "NGN",
"customerEmail": "test@tester.com",
"accountNumber": "3000004533",
"bankName": "Providus Bank",
"bankCode": "101",
"collectionChannel": "RESERVED_ACCOUNT",
"reservationReference": "W3HP7E6VZP78TUKV4U9E",
"reservedAccountType": "GENERAL",
"status": "ACTIVE",
"createdOn": "2020-08-12 18:56:49.0",
"contract": {
"name": "Default Contract",
"code": "6146592431",
"description": null,
"supportsAdvancedSettlementAccountSelection": false,
"sweepToExternalAccount": false
},
"transactionCount": 0,
"restrictPaymentSource": false
}
}
In all of the response body, I need just the following response;
"accountNumber": "3000004533",
"customerEmail": "test@tester.com",
"bankName": "Providus Bank",
Please, how do I get this done.