1

I am trying to work out how to call both a phone number and a mobile number using the API. I am in civicrm/api and can get one or the other but not both. Can anyone suggest a solution!?

Thanks Caroline

2

you can get both Phone and Mobile in a single API call as below

    $result = civicrm_api3('Phone', 'get', [
  'sequential' => 1,
  'contact_id' => 203,
  'phone_type_id' => ['IN' => ["Phone", "Mobile"]],
]);

I have created the test example against https://dmaster.demo.civicrm.org

I guess this helps !!!

Thanks

| improve this answer | |
  • Brill! Thank you! That works :) – Caroline B Nov 22 '19 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.