Cercar contactes per nom
contacts:contacts.readhttps://api.holded.com/api/v2/contacts/searchCerca contactes per nom. Compara contra el camp `name` amb coincidència per prefix (estil autocompletat): `?name=Joh` coincideix amb `John Due`, `John Smith`, etc. Sensible a tokens, insensible a majúscules i diacrítics. La resposta inclou un valor `cursor` i un booleà `has_more`. Passa el `cursor` a la següent petició per obtenir la pàgina següent. La mida de pàgina per defecte és 25 contactes. Pots augmentar-la fins a 100 amb el paràmetre `limit`.
Paràmetres
Paràmetres de consulta
stringobligatoriTerme de cerca comparat contra el camp `name` del contacte (coincidència per prefix, insensible a majúscules i diacrítics)
stringopcionalCursor opac per a la paginació. Utilitza el valor retornat a la resposta anterior per obtenir la pàgina següent
integeropcional= 50Nombre màxim de contactes a retornar per pàgina. Per defecte 25, màxim 100
Petició
import requests
url = "https://api.holded.com/api/v2/contacts/search?name=value&cursor=value&limit=50"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())Respostes
Resposta
{
"items": [
{
"id": "507f1f77bcf86cd799439011",
"custom_id": "string",
"name": "string",
"code": "string",
"vat_number": "string",
"trade_name": "string",
"is_person": false,
"email": "string",
"mobile": "string",
"phone": "string",
"type": "client",
"iban": "string",
"swift": "string",
"sepa_ref": "string",
"sepa_date": "2024-01-15",
"tax_operation": "string",
"group_id": "string",
"tags": [
"string"
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"bill_address": {
"address": "string",
"city": "string",
"postal_code": "string",
"province": "string",
"country": "string",
"country_code": "ES",
"info": "string"
},
"client_record": {
"num": 0,
"name": "string"
},
"supplier_record": {
"num": 0,
"name": "string"
},
"defaults": {
"sales_channel": "string",
"expenses_account": "string",
"due_days": 0,
"payment_day": 0,
"payment_method": "string",
"discount": 0,
"language": "string",
"currency": "string",
"sales_tax": [
"..."
],
"purchases_tax": [
"..."
],
"accumulate_in_form_347": false,
"numbering_series": {
"invoice": "...",
"receipt": "...",
"salesorder": "...",
"estimate": "...",
"order": "...",
"proform": "...",
"waybill": "..."
}
},
"shipping_addresses": [
{
"shipping_id": "...",
"name": "...",
"address": "...",
"city": "...",
"postal_code": "...",
"province": "...",
"country": "...",
"country_code": "...",
"notes": "...",
"private_notes": "..."
}
],
"notes": [
{
"note_id": "...",
"name": "...",
"description": "...",
"color": "...",
"updated_at": "..."
}
],
"contact_persons": [
{
"id": "..."
}
],
"custom_fields": [
{
"field": "...",
"value": "..."
}
],
"extra_emails": [
"string"
],
"website": "string",
"social_networks": {},
"rate": {
"id": "string",
"name": "string",
"description": "string"
}
}
],
"cursor": "string",
"has_more": false
}Respostes exitoses
200Llistat de contactes que coincideixen amb els criteris de cercaapplication/jsonUnique identifier of the contact
Your external reference identifier for this contact
Full name of the contact or company
Tax identification number
EU VAT number for intra-community operations
Commercial trading name, if different from the legal name
Whether the contact is an individual person rather than a company
Primary email address
Mobile phone number
Landline phone number
Classification of the contact
clientdebtorsuppliercreditorleadIBAN bank account number
SWIFT/BIC code of the bank
SEPA mandate reference for direct debit collections
Date the SEPA direct debit mandate was signed
Fiscal operation type of the contact (e.g. general, intra, receq, exento)
Identifier of the contact group this contact belongs to
List of tags attached to the contact
Timestamp when the contact was created
Timestamp when the contact was last modified
Billing address of the contact
Accounting account (chart of accounts) used when this contact acts as a client
Accounting account (chart of accounts) used when this contact acts as a supplier
Default settings applied to new documents for this contact
List of shipping addresses
Internal notes attached to the contact
People associated with this contact. Only their ids are returned, get the contact by this `id` for the rest of the fields
User-defined custom fields
Additional email addresses for the contact
Website URL of the contact
Social network profiles of the contact
Price rate assigned to this contact
Respostes d'error
400Falta el paràmetre `name` obligatoriapplication/json401API key no vàlida o no proporcionadaapplication/json403Permisos insuficientsapplication/json429Límit de sol·licituds exceditapplication/json