Route
POST /rest/contacts
Paramètres
Body
| Valeur |
Type |
Obligatoire |
valeur par défaut |
Description |
| civility |
string |
Non |
|
Civilité (correspond aux balises title dans apps/maarch_entreprise/xml/entreprise.xml) |
| firstname |
string |
Non |
|
Prénom |
| lastname |
string |
Oui (Si company est vide) |
|
Nom |
| company |
string |
Oui (Si lastname est vide) |
|
Nom de la société |
| department |
string |
Non |
|
Service de la société |
| function |
string |
Non |
|
Fonction du contact |
| addressNumber |
string |
Non |
|
Numéro |
| addressStreet |
string |
Non |
|
Voie |
| addressPostcode |
string |
Non |
|
Code postal |
| addressTown |
string |
Non |
|
Ville |
| addressCountry |
string |
Non |
|
Pays |
| email |
string |
Non |
|
Email |
| phone |
string |
Non |
|
Téléphone |
| communicationMeans |
string |
Non |
|
Moyen de communication M2M (uri ou email) |
| notes |
string |
Non |
|
Notes |
| externalId |
array |
Non |
|
Identifiants externe |
| customFields |
array |
Non |
|
Champs personalisés |
Exemple
{
"civility" : "title1",
"firstname" : "Clark",
"lastname" : "Kent",
"company" : "Daily Planet",
"function" : "Reporter",
"addressNumber" : "30",
"addressStreet" : "Rue des avions",
"addressPostcode" : "75001",
"addressTown" : "Paris",
"addressCountry" : "France",
"email" : "clark.kent@daily-planet.com",
"phone" : "+33120212223",
"communicationMeans" : "http://1.1.1.1/maarch_courrier/",
"notes" : "Awesome",
"externalId" : {"companyId" : "123456789"},
"customFields" : {"2" : "ma valeur custom"}
}
Si un contact existe déjà avec le même email, id correspondra au contact existant, et votre contact ne sera pas créé.
Retour
| Code Http |
Type |
Description |
Exemple |
| 200 |
array |
Le contact a bien été créé |
['id' => 21] |
400 |
array |
Un paramètre obligatoire est manquant |
['errors' => 'Bad Request'] |
403 |
array |
Droits insuffisants pour cette action |
['errors' => 'Service forbidden'] |
500 |
array |
Une erreur s'est produite |
['errors' => '[ContactController create] Contact creation has failed'] |
Route
PUT /rest/contacts/{id}
Le paramètre id de la route représente l'identifiant (int) du contact à modifier
Paramètres
Body
| Valeur |
Type |
Obligatoire |
valeur par défaut |
Description |
| civility |
string |
Non |
|
Civilité (correspond aux balises title dans apps/maarch_entreprise/xml/entreprise.xml) |
| firstname |
string |
Non |
|
Prénom |
| lastname |
string |
Oui (Si company est vide) |
|
Nom |
| company |
string |
Oui (Si lastname est vide) |
|
Nom de la société |
| department |
string |
Non |
|
Service de la société |
| function |
string |
Non |
|
Fonction du contact |
| addressNumber |
string |
Non |
|
Numéro |
| addressStreet |
string |
Non |
|
Voie |
| addressPostcode |
string |
Non |
|
Code postal |
| addressTown |
string |
Non |
|
Ville |
| addressCountry |
string |
Non |
|
Pays |
| email |
string |
Non |
|
Email |
| phone |
string |
Non |
|
Téléphone |
| communicationMeans |
string |
Non |
|
Moyen de communication M2M (uri ou email) |
| notes |
string |
Non |
|
Notes |
| externalId |
array |
Non |
|
Identifiants externe |
| customFields |
array |
Non |
|
Champs personalisés |
Exemple
{
"civility" : "title",
"firstname" : "Kal",
"lastname" : "EL",
"company" : "The Torch",
"function" : "Reporter",
"addressNumber" : "50",
"addressStreet" : "Rue des avions",
"addressPostcode" : "75001",
"addressTown" : "Paris",
"addressCountry" : "France",
"email" : "clark.kent@daily-planet.com",
"phone" : "+33120212223",
"communicationMeans" : "http://1.1.1.1/maarch_courrier/",
"notes" : "Awesome",
"externalId" : {"companyId" : "123456789"},
"customFields" : {"2" : "ma valeur custom"}
}
Retour
| Code Http |
Type |
Description |
Exemple |
| 204 |
array |
Le contact a bien été modifié |
|
400 |
array |
Un paramètre obligatoire est manquant |
['errors' => 'Bad Request'] |
403 |
array |
Droits insuffisants pour cette action |
['errors' => 'Service forbidden'] |
500 |
array |
Une erreur s'est produite |
['errors' => '...'] |
Route
GET /rest/contactsParameters
Retour
| Code Http |
Type |
Description |
| 200 |
array |
Informations liées aux paramètres des contacts |
Données
| Valeur |
Type |
Description |
| id |
int |
Identifiant technique |
| enable |
bool |
Indique si la fonctionnalité est activée |
| rating_columns |
array |
Liste les colonnes prises en compte pour le calcul du taux |
| first_threshold |
int |
Premier palier (%) |
| second_threshold |
int |
Second palier (%) |
La couleur rouge correspond de 0 à {first_threshold} %
La couleur orange correspond de {first_threshold} à {second_threshold} %
La couleur verte correspond de {second_threshold} à 100 %
| Valeur |
Type |
Description |
| id |
int |
Identifiant technique |
| identifier |
string |
Identifiant du champ dans le formulaire de contact |
| mandatory |
array |
Indique si le champ est obligatoire pour la création d'un contact |
| filling |
int |
Indique si le champ est comptabilisé dans la complétude |
| searchable |
int |
Indique si l'autocompletion recherche sur ce champ |
| displayable |
int |
Indique si ce champ est affiché dans l'autocomplétion |
| label |
int |
Libellé du champ (dans le cas d'un champ personnalisable) |
Exemple
{
"contactsFilling" : {
"id" : 1,
"enable" : true,
"rating_columns" : ["society", "function", "other_data"],
"first_threshold" : 33,
"second_threshold" : 66
},
"contactsParameters": [
{
"id": 7,
"identifier": "civility",
"mandatory": false,
"filling": false,
"searchable": false,
"displayable": true,
"label": null
},
{
"id": 8,
"identifier": "firstname",
"mandatory": false,
"filling": true,
"searchable": true,
"displayable": true,
"label": null
},
{
"id": 9,
"identifier": "lastname",
"mandatory": true,
"filling": true,
"searchable": true,
"displayable": true,
"label": null
}
]
}
Route
PUT /rest/contactsParameters
Paramètres
Body
Le corps de la requête correspond à ce que retourne la route GET /rest/contactsParameters
```
Retour
| Code Http |
Type |
Description |
Exemple |
| 200 |
array |
Les paramètres ont bien été modifié |
['success' => 'success'] |
400 |
array |
Un paramètre obligatoire est manquant |
['errors' => 'Bad Request'] |
403 |
array |
Droits insuffisants pour cette action |
['errors' => 'Service forbidden'] |
500 |
array |
Une erreur s'est produite |
['errors' => '...'] |