Answers.Body: <p>You can, certainly - but it sounds like what you really want to do is set the Supervised Dedupe rule to dedupe on phone number.  That way, when someone enters a new contact, when they try to save it, it will recognize the person as a duplicate.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-23T12:22:00.913Z
Answers.Text: I have been using CiviCRM for about 10 years. But I couldn't make the registration to the same number from the rules. Most of them also damaged the database. I had to reinstall. This is probably related to the number format used in our country.
  
  The other company will give me a code. It is necessary to bring that code together with the API, a doc that explains how to do this. Is there?
Answers.UserDisplayName: Fatih ATEŞ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-23T10:51:07.297Z
Answers.LastActivityDate: 2020-10-23T10:51:07.297Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <blockquote>
  <p>Can she create an API to enter a phone number and output a name</p>
  </blockquote>
  <p>If I understand the question right, the API is already available. If you simply need an api that provides the name based on phone number, you can use -</p>
  <pre><code>$contact = civicrm_api3('Phone', 'get', [
    'sequential' =&gt; 1,
    'return' =&gt; [&quot;contact_id&quot;],
    'is_primary' =&gt; 1,
    'phone_numeric' =&gt; &lt;numeric value of the phone number&gt;, // 12345678 if phone number is 12-345-678
    'api.Contact.get' =&gt; ['id' =&gt; &quot;\$value.contact_id&quot;],
  ]);
  </code></pre>
  <p>$contact has all the information related to contact. You can try more such API combination from the API explorer</p>
  <p><a href="https://i.sstatic.net/3z1ib.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3z1ib.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-26T12:11:03.863Z
Answers.LastActivityDate: 2020-10-26T12:11:03.863Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>There is a system where we answer calls from our members. We save all of these calls by creating contact information on CiviCRM and create the conversation in an activity.</p>
  <p>People answering the calls create a contact by entering different information on the same number. I don't want that to happen. So, Can she create an API to enter a phone number and output a name?</p>
  
Tags: <contacts><joomla><search>
Title: Enter Phone Number, Show Contact Details with API?
ThreadText: # Enter Phone Number, Show Contact Details with API?
  
  (Asked by: username_0 on 2020-10-23)
  
  There is a system where we answer calls from our members. We save all of these calls by creating contact information on CiviCRM and create the conversation in an activity.
  
  People answering the calls create a contact by entering different information on the same number. I don't want that to happen. So, Can she create an API to enter a phone number and output a name?
  
  **Tags:** contacts, joomla, search
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-10-23. Score: 1
  
  You can, certainly - but it sounds like what you really want to do is set the Supervised Dedupe rule to dedupe on phone number. That way, when someone enters a new contact, when they try to save it, it will recognize the person as a duplicate.
  
  > **Comments:**
  > **username_0**: I have been using CiviCRM for about 10 years. But I couldn't make the registration to the same number from the rules. Most of them also damaged the database. I had to reinstall. This is probably related to the number format used in our country.  The other company will give me a code. It is necessary to bring that code together with the API, a doc that explains how to do this. Is there?  
  
  ---
  
  ### Answer by username_2 on 2020-10-26. Score: 0
  
  Can she create an API to enter a phone number and output a name
  
  If I understand the question right, the API is already available. If you simply need an api that provides the name based on phone number, you can use -
  $contact = civicrm_api3('Phone', 'get', [
    'sequential' => 1,
    'return' => ["contact_id"],
    'is_primary' => 1,
    'phone_numeric' => , // 12345678 if phone number is 12-345-678
    'api.Contact.get' => ['id' => "\$value.contact_id"],
  ]);
  
  $contact has all the information related to contact. You can try more such API combination from the API explorer
  
  
  ---
  
  