title: check data exist or not before inserting using curl?
body: <p>I want to insert data into an active-campaign. Before that, I want to check if the data is existing or not in the active campaign. </p>
  
  <pre><code>function syncContact($data)
  {
      $contact = [
          'u' =&gt; 7,
          'f' =&gt; 7,
          's' =&gt; null,
          'c' =&gt; 0,
          'm' =&gt; 0,
          'act' =&gt; 'sub',
          'v' =&gt; 2,
          // Form fields
          'field[1]' =&gt; $data['field[1]'], // For gender field
          'fullname' =&gt; $data['firstName'] .' ' . $data['lastName'], // Firstname + lastname
          'email' =&gt; $data['email'],  // For email field,
          'field[7]' =&gt; $data['field[7]'], // For datum,
          'field[15]' =&gt; $data['field[15]'], // For ChatVerlauf
          'field[14]' =&gt; $data['field[14]'], // For ChatTag
          'field[16]' =&gt; $data['field[16]'], // For ChatURL
          'field[17]' =&gt; $data['field[17]'], // For ChatInteresse
      ];
  
      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, "https://.......");
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($curl, CURLINFO_HEADER_OUT, true);
      curl_setopt($curl, CURLOPT_POST, true);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $contact);
      $result = curl_exec($curl);
  
      return $result;
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>if($data) {
              $data['email'] = $data[3];
              $data['firstName'] = $data[5];
              $data['lastName'] = $data[6];
              $data['field[1]'] = $data[4];
              $data['field[7]'] = $data[1];
              $data['field[15]'] = $data[7];
              $data['field[14]'] = $data[2];
              $data['field[16]'] = $data[9];
              $data['field[17]'] = $data[10];
  
              $this-&gt;syncContact($data);
          }
  </code></pre>
  
  <p>Insertion is working perfectly. But before that, I want to check the data is exists or not and if not exist insert.</p>