REST api Create address

When i do the PUT command on https://XXXXX.axelor.com/ws/rest/com.axelor.apps.base.db.Address with following data (or every kind of variation, full city details, only id , id and name, …) i have always the error [city] cannot be null.

"data": {
    "streetNumber": "105",
    "street": "RUE DES MOULINS VERTS",
    "inseeCode": "34830",
    "city": {"id":25602}
    }
}

}

{
“status”: -1,
“data”: {
“title”: “Erreur de validation”,
“message”: " • [city] - ne peut pas être nul\n"
}
}

Could someone show me how in REST call he creates a new address (assuming the city exists already) ?

1 « J'aime »

I reply myself, perhaps someone lost here in this ghost forum will find it …

Minimum data i find to be valid is these:
{ “data”: {
“certifiedOk”: false,
“addressL7Country”: {
“id”:67,
“name”: “FRANCE”
},
“addressL4”: “125 RUE DES MOULINS VERTS”,
“zip”: “34000”,
“city”: {
“id”:13379,
“name”: “MONTPELLIER”
},
“street”: null,
“addressL6”: “34000 MONTPELLIER”,
“isUsed”: false,
“_original”: {}
}
}

Headers:
“Content-Type”, “application/json”
“X-Requested-With”, “XMLHttpRequest”
“Accept”, “application/json”
“Cookie”, “JSESSIONID=your value”

PUT on ws/rest/com.axelor.apps.base.db.Address

1 « J'aime »

Thank you for auto-answering !
It will certainly be usefull … to me for example :smile: !

1 « J'aime »

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.