Advertisement
verygoodplugins

Untitled

Jun 24th, 2020
1,266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1.     $params  = wp_fusion()->crm->get_params(); // Get the authentication headers
  2.     $request = 'https://api.hubapi.com/crm/v3/objects/contacts/search';
  3.  
  4.     $search = array(
  5.         'filterGroups' => array(
  6.             array(
  7.                 'filters' => array(
  8.                     array(
  9.                         'propertyName' => 'firstname',
  10.                         'operator'     => 'EQ',
  11.                         'value'        => 'Alice',
  12.                     ),
  13.                 ),
  14.             ),
  15.         ),
  16.     );
  17.  
  18.     $params['body'] = json_encode( $search );
  19.  
  20.     $response = wp_remote_post( $request, $params );
  21.  
  22.     if ( is_wp_error( $response ) ) {
  23.         // handle error
  24.     }
  25.  
  26.     $response = json_decode( wp_remote_retrieve_body( $response ) );
  27.  
  28.     // ^ The object containing the data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement