Open Rafikul-babu1 opened 3 years ago
@Rafikul-babu1 You can refer below PHP code for this API call.
`<?php $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://cdndemo-api.co-vin.in/api/v2/vaccinator/beneficiaries/new'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"name\":\"Apparao\",\"birth_year\":\"1980\",\"gender_id\":1,\"mobile_number\":\"9876543210\",\"photo_id_type\":1,\"photo_id_number\":\"9999\",\"consent_version\":\"1\"}");
$headers = array(); $headers[] = 'Accept: application/json'; $headers[] = 'X-Api-Key: 3sjOr2rmM52GzhpMHjDEE1kpQeRxwFDr4YcBEimi'; $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close($ch);
echo $result; ?>`
You will need API Key to access this APIs.
Thanks, Logicmaker
Url : https://cdn-api.co-vin.in/api/v2/vaccinator/beneficiaries/new West Bengal Health.