Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

460
Views
Hubspot CRM API: cómo filtrar contactos y mostrar las propiedades deseadas

Estoy usando la API de contactos de Hubspot en PHP y estoy intentando dos cosas:

  1. Filtrar en un token de usuario de Hubspot
  2. Mostrar las propiedades deseadas del resultado

Sin embargo, no sé cómo filtrar en un token de usuario y agregar las propiedades para mostrar, aparece el siguiente error: No se puede deserializar la instancia de java.util.LinkedHashMap fuera del token START_ARRAY

Aquí está el código necesario:

 $url = 'https://api.hubapi.com/crm/v3/objects/contacts?limit=100&archived=false&hapikey=xxxxxxxxxxxxxxxxxxx'; // Create a new cURL resource $ch = curl_init($url); // Setup request to send json via POST $data = array( 'properties' => array( 'firstname', 'lastname', 'email' ), 'filters' => array( [ 'propertyName' => 'firstname', 'operator'=> 'EQ', 'value'=> 'Mats' ] ) ); $payload = json_encode($data); echo $payload; // Attach encoded JSON string to the POST fields curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); // Set the content type to application/json curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); // Return response instead of outputting curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Execute the POST request $result = curl_exec($ch); // Close cURL resource curl_close($ch);

Cuando elimino las 'propiedades' de los datos, obtengo el siguiente resultado (que parece vacío, pero sé con certeza que hay alguien con el primer nombre Mats en la base de datos, soy yo):

 {"id":"4764001","properties":{"createdate":"2021-08-04T20:48:28.711Z","hs_is_unworked":"true","hs_marketable_status":"false","hs_marketable_until_renewal":"false","hs_object_id":"4764001","lastmodifieddate":"2021-08-04T20:48:28.711Z"},"createdAt":"2021-08-04T20:48:28.711Z","updatedAt":"2021-08-04T20:48:28.711Z","archived":false}

¡Gracias de antemano chicos!

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!