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

1 Answer 1

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

1
  • Brill! Thank you! That works :)
    – Caroline B
    Commented Nov 22, 2019 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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