Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"message":"invalid json"}
- $json = '{
- "sex": "'.$gender.'",
- "age": '.$age.',
- "evidence": [
- {"id": "'.$symptom_id1.'", "choice_id": "present", "initial": true},
- {"id": "'.$symptom_id2.'", "choice_id": "present", "initial": true},
- {"id": "p_7", "choice_id": "'.$test1.'"},
- {"id": "p_8", "choice_id": "'.$test2.'"},
- {"id": "p_9", "choice_id": "'.$test3.'"},
- {"id": "p_10", "choice_id": "'.$test4.'"},
- {"id": "p_28", "choice_id": "'.$test5.'"},
- {"id": "'.$location.'", "choice_id": "present"}
- ],
- "extras": {
- "disable_groups": true
- }
- }';
- $ch = curl_init('https://api.infermedica.com/v2/diagnosis');
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch, CURLOPT_HTTPHEADER, [
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($json),
- 'app_id: '. APP_ID,
- 'app_key: '. APP_KEY,
- 'Interview-Id: '.$interview_id,
- 'User-Id: '. $hasheduser_id
- ]);
- $result = curl_exec($ch);
- echo '<pre>';
- print_r( $result );
- echo '</pre>';
Add Comment
Please, Sign In to add comment