Les champs personnalisés
Custom_Fields - Ajouter des champs personnalisés
L'URL de soumission pour la demande POST des champs personnalisés reste la même pour chaque point de terminaison (c'est-à-dire api/contacts pour le point de terminaison Contacts, api/invoices pour le point de terminaison Factures, etc.)
Dans cet exemple, nous utiliserons les données de formulaire suivantes qui correspondent aux types de champs personnalisés suivants :
custom_fields[invoice][1] = Type d'entrée
custom_fields[invoice][2] = Number
custom_fields[invoice][3] = Textarea
custom_fields[invoice][4] = Radio
custom_fields[invoice][5] = Case à cocher
custom_fields[invoice][6] = Multiselect
custom_fields[invoice][7] = Date
custom_fields[invoice][8] = Datetime
custom_fields[invoice][9] = Couleur
custom_fields[invoice][10] = Lien
POST votredomaine.com/N/A
Paramètre
json
Champ |
Type |
Description |
champs_personnalisés[typeChamppersonnalisé] |
String/tableau |
La clé de champ personnalisé doit être la même que celle field_namerenvoyée par les informations des valeurs de champ personnalisé de recherche |
-
Réponse réussie
HTTP/1.1 200 OK Same as Original request
-
Réponse d’erreur
HTTP/1.1 404 Not FoundSame as Original request
Custom_Fields - Supprimer les champs personnalisés
Pour supprimer une valeur de champ personnalisé particulière, vous pouvez utiliser l'action Mettre à jour et une valeur vide dans le champ personnalisé.
Remarque : lorsque vous supprimez un enregistrement, les données du champ personnalisé correspondant seront automatiquement supprimées .
SUPPRIMER votredomaine.com/N/A
Custom_Fields - Demander des champs personnalisés
Les données des champs personnalisés seront renvoyées combinées avec les informations d'autres requêtes lors de la requête GET initiale de chaque point de terminaison disponible (contacts, factures, etc.) avec leur clé labelrespective.value
OBTENEZ votredomaine.com/N/A
-
Réponse réussie
HTTP/1.1 200 OK
{
"id": "1",
"sent": "0",
"datesend": null,
"clientid": "1",
"deleted_customer_name": null,
"number": "10",
"prefix": "INV-",
"number_format": "1",
"datecreated": "2021-05-14 00:44:52",
"date": "2021-08-28",
"duedate": "2021-09-27",
"currency": "1",
"subtotal": "110.00",
"total_tax": "0.00",
"total": "110.00",
"adjustment": "0.00",
"addedfrom": "0",
"hash": "4222d2f53404324ea73535d3c0f2c3f0",
"status": "1",
"clientnote": "",
"adminnote": "",
"last_overdue_reminder": null,
"cancel_overdue_reminders": "1",
"allowed_payment_modes": "a:2:{i:0;s:1:\"1\";i:1;s:1:\"2\";}",
"token": null,
"discount_percent": "0.00",
"discount_total": "0.00",
"discount_type": "",
"recurring": "0",
"recurring_type": null,
"custom_recurring": "0",
"cycles": "0",
"total_cycles": "0",
"is_recurring_from": null,
"last_recurring_date": null,
"terms": "",
"sale_agent": "0",
"billing_street": "billing address",
"billing_city": "billing city name",
"billing_state": "billing state name",
"billing_zip": "billing zip code",
"billing_country": "0",
"shipping_street": "shipping address",
"shipping_city": "city name",
"shipping_state": "state name",
"shipping_zip": "zip code",
"shipping_country": "0",
"include_shipping": "1",
"show_shipping_on_invoice": "1",
"show_quantity_as": "1",
"project_id": "0",
"subscription_id": "0",
"short_link": null,
"symbol": "$",
"name": "USD",
"decimal_separator": ".",
"thousand_separator": ",",
"placement": "before",
"isdefault": "1",
"currencyid": "1",
"currency_name": "USD",
"total_left_to_pay": "110.00",
"items": [
{
"id": "1",
"rel_id": "1",
"rel_type": "invoice",
"description": "item description",
"long_description": "item long description",
"qty": "1.00",
"rate": "10.00",
"unit": "1",
"item_order": "1",
"customfields": [
{
"label": "Input 1",
"value": "test 12 item 1"
},
{
"label": "Number 1",
"value": "10"
},
{
"label": "Textarea 1",
"value": "Lorem Ipsum is simply dummy text of the printing and typesetting industry"
},
{
"label": "Select 1",
"value": "Option 1"
},
{
"label": "Multiselect 1",
"value": "Option 1, Option 2"
},
{
"label": "Checkbox 1",
"value": "Option 1, Option 3"
},
{
"label": "Datepicker 1",
"value": "2021-05-06"
},
{
"label": "Datetime Picker 1",
"value": "2021-05-06 00:23:25"
},
{
"label": "Colorpicker 1",
"value": "#ffffff"
},
{
"label": "Hyperlink 1",
"value": "<a>Link</a>"
}
]
},
{
"id": "2",
"rel_id": "1",
"rel_type": "invoice",
"description": "updated item 2 description",
"long_description": "updated item 2 logn description",
"qty": "1.00",
"rate": "100.00",
"unit": "",
"item_order": "2",
"customfields": [
{
"label": "Input 1",
"value": "test 12 item 2"
},
{
"label": "Number 1",
"value": "10"
},
{
"label": "Textarea 1",
"value": "Lorem Ipsum is simply dummy text of the printing and typesetting industry"
},
{
"label": "Select 1",
"value": "Option 1"
},
{
"label": "Multiselect 1",
"value": "Option 1, Option 2"
},
{
"label": "Checkbox 1",
"value": "Option 1, Option 3"
},
{
"label": "Datepicker 1",
"value": "2021-05-06"
},
{
"label": "Datetime Picker 1",
"value": "2021-05-06 00:23:25"
},
{
"label": "Colorpicker 1",
"value": "#ffffff"
},
{
"label": "Hyperlink 1",
"value": "<a>Link</a>"
}
]
}
],
"attachments": [],
"visible_attachments_to_customer_found": false,
"client": {
"userid": "1",
"company": "updated company",
"vat": "",
"phonenumber": "",
"country": "0",
"city": "",
"zip": "",
"state": "",
"address": "",
"website": "",
"datecreated": "2021-05-14 00:15:06",
"active": "1",
"leadid": null,
"billing_street": "",
"billing_city": "",
"billing_state": "",
"billing_zip": "",
"billing_country": "0",
"shipping_street": "",
"shipping_city": "",
"shipping_state": "",
"shipping_zip": "",
"shipping_country": "0",
"longitude": null,
"latitude": null,
"default_language": "",
"default_currency": "0",
"show_primary_contact": "0",
"stripe_id": null,
"registration_confirmed": "1",
"addedfrom": "0"
},
"payments": [],
"scheduled_email": null,
"customfields": [
{
"label": "Input 1",
"value": "test 12"
},
{
"label": "Number 1",
"value": "10"
},
{
"label": "Textarea 1",
"value": "Lorem Ipsum is simply dummy text of the printing and typesetting industry"
},
{
"label": "Select 1",
"value": "Option 1"
},
{
"label": "Multiselect 1",
"value": "Option 1, Option 2"
},
{
"label": "Checkbox 1",
"value": "Option 1, Option 3"
},
{
"label": "Datepicker 1",
"value": "2021-05-06"
},
{
"label": "Datetime Picker 1",
"value": "2021-05-06 00:23:25"
},
{
"label": "Colorpicker 1",
"value": "#ffffff"
},
{
"label": "Hyperlink 1",
"value": "<a>Link</a>"
}
]
}
-
Réponse d’erreur
HTTP/1.1 404 Not FoundSame as Original request
Custom_Fields - Demander les valeurs des champs personnalisés
GET yourdomain.com/api/custom_fields/:FieldBelongsto/:id
Header
json
Champ |
Type |
Description |
Authorization |
String |
Jeton d'authentification d'accès de base. |
Paramètre
json
Champ |
Type |
Description |
ChampAppartient à |
String |
Appartient à Champ obligatoire Appartient à. Valeurs autorisées : |
id (facultatif) |
Number |
Identifiant unique facultatif. |
Succès 200
json
Champ |
Type |
Description |
Coutume |
Objet |
Informations sur les champs personnalisés avec des valeurs. |
Erreur 4xx
json
Nom |
Type |
Description |
status |
booléen |
État de la demande. |
message |
String |
Aucune donnée n'a été trouvée. |
-
Réponse réussie
HTTP/1.1 200 OK
[
{
"field_name": "custom_fields[invoice][1]",
"custom_field_id": "1",
"label": "Input 1",
"required": "0",
"type": "input",
"value": "input1 data"
},
{
"field_name": "custom_fields[invoice][2]",
"custom_field_id": "2",
"label": "Number 1",
"required": "0",
"type": "number",
"value": "12"
},
{
"field_name": "custom_fields[invoice][3]",
"custom_field_id": "3",
"label": "Textarea 1",
"required": "0",
"type": "textarea",
"value": "textarea content"
},
{
"field_name": "custom_fields[invoice][4]",
"custom_field_id": "4",
"label": "Select 1",
"required": "0",
"type": "select",
"value": "[\"Option 1\"]",
"options": "[\"Option 1\",\"Option 2\",\"Option 3\"]"
},
{
"field_name": "custom_fields[invoice][5]",
"custom_field_id": "5",
"label": "Multiselect 1",
"required": "0",
"type": "multiselect",
"value": "[\"Option 1\",\" Option 2\"]",
"options": "[\"Option 1\",\"Option 2\",\"Option 3\"]"
},
{
"field_name": "custom_fields[invoice][6]",
"custom_field_id": "6",
"label": "Checkbox 1",
"required": "0",
"type": "checkbox",
"value": "[\"Option 1\",\" Option 2\"]",
"options": "[\"Option 1\",\"Option 2\",\"Option 3\"]"
},
{
"field_name": "custom_fields[invoice][7]",
"custom_field_id": "7",
"label": "Datepicker 1",
"required": "0",
"type": "date_picker",
"value": "2021-05-16"
},
{
"field_name": "custom_fields[invoice][8]",
"custom_field_id": "8",
"label": "Datetime Picker 1",
"required": "0",
"type": "date_picker_time",
"value": "2021-05-25 23:06:00"
},
{
"field_name": "custom_fields[invoice][9]",
"custom_field_id": "9",
"label": "Colorpicker 1",
"required": "0",
"type": "colorpicker",
"value": "#8f1b1b"
},
{
"field_name": "custom_fields[invoice][10]",
"custom_field_id": "10",
"label": "Hyperlink 1",
"required": "0",
"type": "link",
"value": "<a href=\"https://google.com\" target=\"_blank\">google</a>"
}
]
-
Réponse d’erreur
HTTP/1.1 404 Not Found{ "status": false, "message": "No data were found"}
Custom_Fields - Rechercher des informations sur les valeurs de champs personnalisés
Les données des champs personnalisés seront renvoyées combinées avec les informations d'autres requêtes lors de la requête SEARCH initiale de chaque point de terminaison disponible (contacts, factures, etc.) avec leur clé respective labeletvalue
OBTENEZ votredomaine.com/N/A
-
Réponse réussie
HTTP/1.1 200 OK
[
{
"id": "1",
"sent": "0",
"datesend": null,
"clientid": "1",
"deleted_customer_name": null,
"number": "10",
"prefix": "INV-",
"number_format": "1",
"datecreated": "2021-05-14 00:15:06",
"date": "2021-08-28",
"duedate": "2021-09-27",
"currency": "1",
"subtotal": "110.00",
"total_tax": "0.00",
"total": "110.00",
"adjustment": "0.00",
"addedfrom": "0",
"hash": "4222d2f53404324ea73535d3c0f2c3f0",
"status": "1",
"clientnote": "",
"adminnote": "",
"last_overdue_reminder": null,
"cancel_overdue_reminders": "1",
"allowed_payment_modes": "a:2:{i:0;s:1:\"1\";i:1;s:1:\"2\";}",
"token": null,
"discount_percent": "0.00",
"discount_total": "0.00",
"discount_type": "",
"recurring": "0",
"recurring_type": null,
"custom_recurring": "0",
"cycles": "0",
"total_cycles": "0",
"is_recurring_from": null,
"last_recurring_date": null,
"terms": "",
"sale_agent": "0",
"billing_street": "",
"billing_city": "",
"billing_state": "",
"billing_zip": "",
"billing_country": "0",
"shipping_street": "",
"shipping_city": "",
"shipping_state": "",
"shipping_zip": "",
"shipping_country": "0",
"include_shipping": "1",
"show_shipping_on_invoice": "1",
"show_quantity_as": "1",
"project_id": "0",
"subscription_id": "0",
"short_link": null,
"userid": "1",
"company": "updated company",
"vat": "",
"phonenumber": "",
"country": "0",
"city": "",
"zip": "",
"state": "",
"address": "",
"website": "",
"active": "1",
"leadid": null,
"longitude": null,
"latitude": null,
"default_language": "",
"default_currency": "0",
"show_primary_contact": "0",
"stripe_id": null,
"registration_confirmed": "1",
"invoiceid": "1",
"customfields": [
{
"label": "Input 1",
"value": "test 12"
},
{
"label": "Number 1",
"value": "10"
},
{
"label": "Textarea 1",
"value": "Lorem Ipsum is simply dummy text of the printing and typesetting industry"
},
{
"label": "Select 1",
"value": "Option 1"
},
{
"label": "Multiselect 1",
"value": "Option 1, Option 2"
},
{
"label": "Checkbox 1",
"value": "Option 1, Option 3"
},
{
"label": "Datepicker 1",
"value": "2021-05-06"
},
{
"label": "Datetime Picker 1",
"value": "2021-05-06 00:23:25"
},
{
"label": "Colorpicker 1",
"value": "#ffffff"
},
{
"label": "Hyperlink 1",
"value": "<a>Link</a>"
}
]
},
{
"id": "2",
"sent": "0",
"datesend": null,
"clientid": "1",
"deleted_customer_name": null,
"number": "4",
"prefix": "INV-",
"number_format": "1",
"datecreated": "2021-05-14 00:15:06",
"date": "2021-05-28",
"duedate": "2021-06-27",
"currency": "1",
"subtotal": "110.00",
"total_tax": "0.00",
"total": "110.00",
"adjustment": "0.00",
"addedfrom": "0",
"hash": "630f8cc7ed2e6a70c4113ab24041bdf5",
"status": "6",
"clientnote": "",
"adminnote": "",
"last_overdue_reminder": null,
"cancel_overdue_reminders": "1",
"allowed_payment_modes": "a:2:{i:0;s:1:\"1\";i:1;s:1:\"2\";}",
"token": null,
"discount_percent": "0.00",
"discount_total": "0.00",
"discount_type": "",
"recurring": "0",
"recurring_type": null,
"custom_recurring": "0",
"cycles": "0",
"total_cycles": "0",
"is_recurring_from": null,
"last_recurring_date": null,
"terms": "",
"sale_agent": "0",
"billing_street": "",
"billing_city": "",
"billing_state": "",
"billing_zip": "",
"billing_country": "0",
"shipping_street": "",
"shipping_city": "",
"shipping_state": "",
"shipping_zip": "",
"shipping_country": "0",
"include_shipping": "1",
"show_shipping_on_invoice": "1",
"show_quantity_as": "1",
"project_id": "0",
"subscription_id": "0",
"short_link": null,
"userid": "1",
"company": "updated company",
"vat": "",
"phonenumber": "",
"country": "0",
"city": "",
"zip": "",
"state": "",
"address": "",
"website": "",
"active": "1",
"leadid": null,
"longitude": null,
"latitude": null,
"default_language": "",
"default_currency": "0",
"show_primary_contact": "0",
"stripe_id": null,
"registration_confirmed": "1",
"invoiceid": "2",
"customfields": [
{
"label": "Input 1",
"value": "test 12"
},
{
"label": "Number 1",
"value": "10"
},
{
"label": "Textarea 1",
"value": "Lorem Ipsum is simply dummy text of the printing and typesetting industry"
},
{
"label": "Select 1",
"value": "Option 1"
},
{
"label": "Multiselect 1",
"value": "Option 1, Option 2"
},
{
"label": "Checkbox 1",
"value": "Option 1, Option 3"
},
{
"label": "Datepicker 1",
"value": "2021-05-06"
},
{
"label": "Datetime Picker 1",
"value": "2021-05-06 00:23:25"
},
{
"label": "Colorpicker 1",
"value": "#ffffff"
},
{
"label": "Hyperlink 1",
"value": "<a>Link</a>"
}
]
}
]
-
Réponse d’erreur
HTTP/1.1 404 Not FoundSame as Original request
Custom_Fields - Mettre à jour les champs personnalisés
L'URL de soumission pour la demande PUT des champs personnalisés reste la même pour chaque point de terminaison (c'est-à-dire api/contactspour le point de terminaison Contacts, api/invoicespour le point de terminaison Factures, etc.)
Dans cet exemple, nous utiliserons les données de formulaire suivantes qui correspondent aux types de champs personnalisés suivants :
custom_fields[invoice][1] = Type d'entrée
custom_fields[invoice][2] = Number
custom_fields[invoice][3] = Textarea
custom_fields[invoice][4] = Radio
custom_fields[invoice][5] = Case à cocher
custom_fields[invoice][6] = Multiselect
custom_fields[invoice][7] = Date
custom_fields[invoice][8] = Datetime
custom_fields[invoice][9] = Couleur
custom_fields[invoice][10] = Lien
PUT votredomaine.com/N/A
Paramètre
json
Champ |
Type |
Description |
champs_personnalisés[typeChamppersonnalisé] |
String/tableau |
Le champ personnalisé JSON doit être le même que ci-dessous avec field_nameet custom_field_idrenvoyé à partir des informations des valeurs de champ personnalisé de recherche |
-
Réponse réussie
HTTP/1.1 200 OK Same as Original request
-
Réponse d’erreur
HTTP/1.1 404 Not FoundSame as Original request